The bug came back... Re: Needing to include windows.h? [*NOT* SOLVED]

Jason <jesus_freak picknowl.com.au> writes:

hi again all,

Well, fixing that variable’s initialisation worked temporarily. I’ve now added
more code and got the program to clean up after itself a little better, and now
the bug has come back. Only this time, windows.h makes no difference.

So, the bug came back. The very next build, the bug came back… :slight_smile:

I’ve put here the event loop of my program in case there’s anything weird going
on in there, but I can’t see anything myself. Like I said earlier, it works
fine in debug mode but not release mode…

// The event queue!
while( g_quit == false ) {
// If there’s events to handle
SDL_WaitEvent( &event );
// Handle mouse events
if( event.type == SDL_MOUSEBUTTONDOWN ) {
// If the left mouse button was pressed
if( event.button.button == SDL_BUTTON_LEFT ) {
//Get the mouse offsets
int x = event.button.x;
int y = event.button.y;
if(g_menusystem.IsMenuActive()) {
g_menusystem.EventLBDown(x, y);
}
}
}
else if( event.type == SDL_MOUSEBUTTONUP ) {
// If the left mouse button was released
if( event.button.button == SDL_BUTTON_LEFT ) {
//Get the mouse offsets
int x = event.button.x;
int y = event.button.y;
if(g_menusystem.IsMenuActive()) {
g_menusystem.EventLBUp(x, y);
}
}
}
else if(event.type == SDL_MOUSEMOTION ) {
// Get the mouse offsets
int x = event.button.x;
int y = event.button.y;
if(g_menusystem.IsMenuActive()) {
g_menusystem.EventMoveMouse(x, y);
}
}
//If the user has Xed out the window
else if( event.type == SDL_QUIT ) {
//Quit the program
g_quit = true;
}

// Re-draw the screen. Start with the menus!
if(g_menusystem.IsMenuActive()) {
if(g_menusystem.DrawMenu(g_screen, 0, 0) == false) {
ShutDown(killuniverse, killSDL, killTTF, killfonts, killscreen,
killmenus);
return -9;
}
}

// Put the version number at the bottom left!
SDL_BlitSurface(text, &textrect, g_screen, &textwndrect);

//Update the screen
if( SDL_Flip( g_screen ) == -1 ) {
ShutDown(killuniverse, killSDL, killTTF, killfonts, killscreen,
killmenus);
return -10;
}
}

The only difference in my program is that I use fullscreen in release mode, but
even when I changed that so there was no #ifdef _DEBUG in my code it didn’t
work…

-J