SDL while loop confusion
Jan 20, 2012 at 7:58am UTC
hello, i was wondering why in SDL where you have your main game loop, it doesnt do the code billions of times like a normal loop..
eg:
1 2 3 4 5 6 7 8 9 10 11 12 13
...
bool run =true ;
while (run ==true )
{
//some events{}
//Openg 2d rendering{}
cout <<"hi" ;
}
SDL_Quit();
This all only happens once. It keeps going as long as the window is closed, of course. but doesnt keep repeated if you know what i mean.
Thankyou
Jan 20, 2012 at 8:10am UTC
but doesnt keep repeated if you know what i mean.
No, not really.
Your loop will continue running until the condition becomes false or until it is exited via break or an exception or until the program is terminated (e.g. by calling exit or abort).
Jan 20, 2012 at 8:18am UTC
but have you coded in SDL and done like the main loop where everything goes?
Jan 20, 2012 at 8:31am UTC
Still no idea what you're asking.
Jan 20, 2012 at 8:42am UTC
have you coded in SDL before?
Jan 20, 2012 at 8:46am UTC
I have coded in SDL and the loop will behave as it always does in C++.
Topic archived. No new replies allowed.