sdl window static , how ?
Ok, this seems like a very simple probelm, but then again I won''t learn if I don''t ask.
Ok I made a code which just open and closes the window in sdl.
#include
int main()
{
SDL_Init(SDL_INIT_VIDEO);
SDL_SetVideoMode(800,600,16,SDL_DOUBLEBUF|SDL_FULLESCREEN);
SDL_Quit();
}
I compiled it, now I wan''t to make the window static - meaning available till I kill it manually. What code or function will allow me to do this ?
Thank you for your patience.
There is some example code in the test/ section of the SDL source, but the main idea is to make a main program (message) loop, as in all games/window apps.
This main loop should look like this:
cu,
Prefect
---
Sanity is the trademark of a weak mind.
This main loop should look like this:
done = 0;while ( !done ) { /* Check for events */ while ( SDL_PollEvent(&event) ) { switch (event.type) { case SDL_MOUSEBUTTONDOWN: { // Do mouse stuff here } break; case SDL_KEYDOWN: case SDL_KEYUP: switch(event.key.keysym.sym) { case SDLK_ESCAPE: done = 1; break; // Handle other keys.. default: ; } break; case SDL_QUIT: done = 1; break; default: break; } } // Do game logic here... // Render the scene here R_RenderScene(); SDL_Flip(screen);}
cu,
Prefect
---
Sanity is the trademark of a weak mind.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement