   SDL. How to disable mouse ?
  My program lags when I move the pointer around the screen, so I need to disable it. Pretty common problem, but the usual answer is:SDL_ShowCursor(0); which doesn't work for me because it only hides it, while I need my game to ignore\disable any mouse input so it won't be counted in the SDL_PollEvent. Is that possible ?   
  I have never noticed such lags, how does your event loop looks like?Are you handling all events every frame?// main loopwhile(1){    // event loop    while(SDL_PollEvent(&event)) {   ...    }    ...};  Yes,while(gameRunning)   {  //draw sprite here  if(SDL_PollEvent(&event)){if(event.type == SDL_QUIT)gameRunning=false; if(event.type == SDL_KEYDOWN){ keyHold[event.key.keysym.sym] = true;}if(event.type == SDL_KEYUP){keyHold[event.key.keysym.sym] = false;} }//keyHold[] array stores values for every key, so the character//moves constantly on KEYDOWN and stops on KEYUP.if(keyHold[SDLK_ESCAPE])gameRunning = false; if( keyHold[SDLK_LEFT] ){Player->moveLeft();}if( keyHold[SDLK_UP] ){Player->moveUp();}if( keyHold[SDLK_DOWN] ){Player->moveDown();}if( keyHold[SDLK_RIGHT] ){Player->moveRight();}    }   ;Quote:Original post by danDemonYes. I use input method similar to the one posted in Aaron's tutorial:http://www.aaroncox.net/tutorials/2dtutorials/sdlkeyboard.htmlThat tutorial is checking just one event per frame:if (SDL_PollEvent(&event)) ...notice that I had a while instead of the if.   ;Quote:Original post by KambizQuote:Original post by danDemonYes. I use input method similar to the one posted in Aaron's tutorial:http://www.aaroncox.net/tutorials/2dtutorials/sdlkeyboard.htmlThat tutorial is checking just one event per frame:if (SDL_PollEvent(&event)) ...notice that I had a while instead of the if.Damn I would never suspect simple operation would fix the problem, thanks a LOT man! :)   ;Quote:Original post by danDemonwhile I need my game to ignore\disable any mouse input so it won't be counted in the SDL_PollEvent. Is that possible ?This is only posted for completeness of the thread, as the OP's problem is fixed.Yes if this is really what you want. You can set up an event filter in which you can decide if to allow the event onto the queue. This enables you to switch the mouse events on and off at your will. There is a special note to take into consideration, this being that mouse wheel events are sent as button events. Alternately if you never want to get the events then simply set the state to ignore using SDL_EventState.   