Hello, what this function is suppose to do is wait for the user to either click button one, button two, or ex out the program. Instead, i get this error:
Here is the code that triggers this error:Code:Unhandled exception at 0x00973faa in TicTacToe v2.0.exe: 0xC0000005: Access violation reading location 0xfeeefeee.
Code:void Title::HandleEvents() { SDL_Event event; //While there's events to handle while( SDL_PollEvent( &event ) ) { if( event.type == SDL_MOUSEBUTTONDOWN ) { if( event.button.button == SDL_BUTTON_LEFT ) { int x = event.button.x; int y = event.button.y; if( (x > 200 && x < 300) && (y > 160 && y < 200 ) ) { SetNextState( STATE_TITLE, STATE_1PLAYER ); } if( (x > 330 && x < 430) && (y > 160 && y < 200 ) ) { SetNextState( STATE_TITLE, STATE_2PLAYER ); } } } if( event.type == SDL_QUIT ) { //Quit the program SetNextState( STATE_TITLE, STATE_EXIT ); } } }




Reply With Quote