I am trying to learn the use of SDL in C++ :
I copied / pasted the code, have compiled no problem. But when I test, or even when I open the corresponding executable file, nothing happens. The window does not open. Can nay one give the example of SDL in C++.Code:# include <stdlib.h> # include <stdio.h> # include <SDL/SDL.h> void pause (); int main (int argc, char * argv []) ( SDL_Init (SDL_INIT_VIDEO) / / Initialize SDL SDL_SetVideoMode (640, 480, 32, SDL_HWSURFACE) / / open the window pause () / / Pause program SDL_Quit () / / stop the SDL return EXIT_SUCCESS; / / Closing Program ) void pause () ( int continue = 1; SDL_Event event; while (continue) ( SDL_WaitEvent (& event); switch (event. type) ( SDL_QUIT box: continue = 0; ) ) )
Bookmarks