sdl

Compiling with int main(void) fails; main(int argc, char *argv[]) succeeds. Why?

▼魔方 西西 提交于 2019-12-18 06:25:56
问题 Problem Why would compiling a program which has an int main(void) main function differ from compiling a program which has an int main(int argc, char *argv[]) main function, if the program does not use arguments passed on the command line? Is this OS or compiler specific? I do not get the same results using mingw and g++ (which is weird isn't it as wingw is a port of gcc) . Example Code #include <iostream> #include"SDL/SDL.h" int main(void) { return 0; } Compilation commands g++ test.cpp; #g++

Setting up SDL on Mac OS X Lion with Xcode 4

旧城冷巷雨未停 提交于 2019-12-18 04:54:18
问题 I've been trying to get a super simple SDL program to work. I'm using Mac OS X Lion. I've got SDL to work in Snow Leopard, but it doesn't seem to want to work in lion. So far I have this: #include <iostream> #include "SDL/SDL.h" using namespace std; /* #ifdef main # undef main #endif */ int main( int argc, char* args[] ) { SDL_Surface* hello = NULL; SDL_Surface* screen = NULL; SDL_Init( SDL_INIT_EVERYTHING ); screen = SDL_SetVideoMode( 640, 480, 32, SDL_SWSURFACE ); hello = SDL_LoadBMP(

Performant 2D OpenGL graphics in R for fast display of raster image using qtpaint (qt) or rdyncall (SDL/OpenGL) packages?

穿精又带淫゛_ 提交于 2019-12-18 02:04:08
问题 For a real-time interactive Mandelbrot viewer I was making in R & Rcpp+OpenMP & Shiny I am on the lookout for a performant way to display 1920x1080 matrices as raster images in the hope of being able to achieve ca. 5-10 fps (calculating the Mandelbrot images themselves now achieves ca. 20-30 fps at moderate zooms, and certainly scrolling around should go fast). Using image() with option useRaster=TRUE , plot.raster or even grid.raster() still doesn't quite cut it, so I am on the lookout for a

How do you include files in C++ from the /Library/Framework folder in MAC

℡╲_俬逩灬. 提交于 2019-12-17 23:43:11
问题 I am trying to use SDL. I have a folder in /Library/Frameworks called SDL2.framework . I want to include the file SDL.h in my project. How do I do this? My code looks like: // Example program: // Using SDL2 to create an application window #include <SDL.h> #include <stdio.h> int main(int argc, char* argv[]) { SDL_Window *window; // Declare a pointer SDL_Init(SDL_INIT_VIDEO); // Initialize SDL2 // Create an application window with the following settings: window = SDL_CreateWindow( "An SDL2

How mature is SDL for iPhone?

末鹿安然 提交于 2019-12-17 23:26:52
问题 For a while I've been thinking of trying to do a port of one of my favorite classic PC games, The Ur-Quan Masters (aka Star Control 2) to the iPhone. UQM uses SDL for all its graphics, sound, input and other gamey stuff and there does seem to be a port of SDL to iPhone but it doesn't look very mature at this point. Has anyone put the iPhone SDL port through its paces? How well does it work? What kinds of issues can I expect taking this project, which is already cross platform code to iPhone?

How to render fonts and text with SDL2 efficiently?

本小妞迷上赌 提交于 2019-12-17 22:47:03
问题 Saw this post here about using SDL_ttf to render text in a game. However that approach requires calling SDL_CreateTextureFromSurface(), along with the SDL_FreeSurface() and SDL_DestroyTexture() every single frame. Is creating textures (and probably subsequently having to send them to the GPU) every frame something that can significally impact my performance? would it be wiser to use SDL_ttf only to create a texture with my whole rendered charset and then to blit from there myself, character

Static-linking of SDL2 libraries

别等时光非礼了梦想. 提交于 2019-12-17 22:16:50
问题 I am using Windows 7, Code::Blocks and MinGW. I have little to no experience when it comes to compiling/building anything, especially when Code::Blocks doesn't use makefiles. I downloaded SDL2-devel-2.0.0-mingw.tar.gz (SDL Development Libraries) from http://www.libsdl.org/tmp/download-2.0.php, and I'd like to create a standalone executable using SDL2 libraries, but so far I've always had to bundle the SDL2.dll file with the executable to make it work. I've heard that I can not static-link

Using SDL_image in Visual studio 2010, with error “application was unable to start correctly 0xc000007b”

不打扰是莪最后的温柔 提交于 2019-12-17 19:53:55
问题 I'm trying to do the SDL tutorial here http://lazyfoo.net/SDL_tutorials/lesson03/windows/msvsnet2010e/index.php I did everything they asked me to do, everything built correctly, but when I tried to run the executable, I always get the error: "application was unable to start correctly 0xc000007b" I'm using Win7 on a mac (bootcamp), with visual stdio 2010 professional 回答1: If you have placed SDL.dll under C:\Windows\system32 or \SysWOW64 like the tutorial says, doing this may work: Download SDL

SDL2: LNK1561: entry point must be defined

限于喜欢 提交于 2019-12-17 18:33:56
问题 I want to compile this code: #include <SDL.h> int main(int argc, char* argv[]) { return 0; } But it can't be linked: Error 1 error LNK1561: entry point must be defined There is some strange code in this library: http://hg.libsdl.org/SDL/file/75726efbf679/include/SDL_main.h #define main SDL_main Also I added SDL2.lib;SDL2main.lib to Project Settings => Linker => Input. What can I do to run this project? VS 2012 SP3, empty C++ project. 回答1: According to this thread on Dream.In.Code: Right click

How do I use Qt and SDL together?

大憨熊 提交于 2019-12-17 17:45:10
问题 I am building a physics simulation engine and editor in Windows. I want to build the editor part using Qt and I want to run the engine using SDL with OpenGL. My first idea was to build the editor using only Qt and share as much code with the engine (the resource manager, the renderer, the maths). But, I would also like to be able to run the simulation inside the editor. This means I also have to share the simulation code which uses SDL threads. So, my question is this: Is there a way to have