• Advertisement
Sign in to follow this  

Game plugin draws on screen but FLICKERS

This topic is 3575 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to code simple plugin that draws on game screen. Here is plugin example from game creator: http://www.rfactor.net/downloads/utils/InternalsPluginsV3.zip This is VC++ project ready to compile. One of the functions returns window handle to games screen so when I code: //in UpdateGraphics finction HDC dc = GetDC( info.mHWND ) ; Rectangle( dc , 0, 0, 100, 100 ) ; ReleaseDC( info.mHWND, dc ) ; but rectangle flickers and when I use buffering it helps little but still flickers

Share this post


Link to post
Share on other sites
Advertisement
What game are you drawing this over? It's very likely to flicker, because the game will be drawing in WM_PAINT if it uses GDI, or at any time if it uses Direct3D or OpenGL.
The only way I can think of that you'll get around that is to do your drawing just after the app, by hooking WM_PAINT, or by hooking the draw calls.

Share this post


Link to post
Share on other sites
it is rFactor - uses DirectX. Can you give some links or code example to solve this problem?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement