if i use this code when i enter help page my cursor's image stop at one place since 'if' not inside while.
if i put cursor inside while ( only cursor and flip), the cursor are moving but had trail and those trail won't dissapear.
if i put both help screen and cursor inside while (no if(quit==false){}) cursor move just like what i want but the help screen seems to be rewrite again and again and leave black mark beside help box and my help box aren't transparent anymore, (see picture).
help please :)
void Button::HelpClick(){ bool endHelp = false; if( quit == false ) { //apply the back ground apply_surface( 0, 0, otherBG,screen ); SDL_GetMouseState(&mouseX, &mouseY); apply_surface( mouseX , mouseY , cursor , screen , Rcurs ); //update_screen(); SDL_Flip( screen ); // Draw the string 'help' to the center of the screen, position: y drawString(screen,font1,325,45,helpjudul); drawString(screen,font2,30,110,helpisi); // Draw the webspace url to the bottom-right of the screen drawString(screen,font3,800,730,"Untuk Keluar Tekan ESCAPE"); SDL_GetMouseState(&mouseX, &mouseY); apply_surface( mouseX , mouseY , cursor , screen , Rcurs ); //update_screen(); SDL_Flip( screen ); } //while the help is still going while( ( endHelp == false ) && ( quit == false ) ) { //if there's events to be handled if( SDL_PollEvent( &event ) ) { //if a button was pressed if( event.type == SDL_KEYDOWN ) { //if esc was pressed if( event.key.keysym.sym == SDLK_ESCAPE ) { //quit the game endHelp = true; } //end the help } //if the user Xed out if( event.type == SDL_QUIT ) { //quit the game quit = true; } } }}
"http://img600.imageshack.us/i/cursorproblem.png/"