Windows GDI question???
How do I eleminate the tearing effect when graphics are drawn using windows GDI? I use double buffering and my timer which makes the game run at 60 fps, and every 4 - 5 seconds it does the tearing effect. Plz Help!!!
How are you doing the double buffering? You''re just using GDI for all the rendering? Are you rendering to a window or full-screen?
I use a bitmap in memory for the double buffer, then after drawing everything I blit that to the device context for the window, which I sort of make full screen by creating a maximized popup window, that appears as fullscreen. I only use GDI for rendering.
The tearing could be a vertical retrace issue. Take a look at this article, perhaps it''s relevant: Detecting Vertical Retrace in Microsoft Windows.
No, there is no easy way. Detecting the retrace is low level stuff that Windows was designed to stop programs from performing. DirectX is the answer (until Longhorn arrives).
Jason Doucette | Matthew Doucette
Programming Windows, 5th Edition by Charles Petzold, Errata Addendum
projects / games | real-time graphics | artificial intelligence | world records | wallpapers / desktops / backgrounds
"Great minds discuss ideas, average minds discuss events, small minds discuss people." - Anna Eleanor Roosevelt, 1884-1962
Jason Doucette | Matthew Doucette
Programming Windows, 5th Edition by Charles Petzold, Errata Addendum
projects / games | real-time graphics | artificial intelligence | world records | wallpapers / desktops / backgrounds
"Great minds discuss ideas, average minds discuss events, small minds discuss people." - Anna Eleanor Roosevelt, 1884-1962
<< Any other way without any directx? >>
I use GDI only for my full screen Asteroids game and had no tearing at all. Haven''t worked with Windows Bitmaps yet but I expect no tearing. Put a link to your source...
Are you sure you are doing this each frame: (1) erase back buffer, (2) draw all graphics to back buffer, then when all drawing done (3) BitBlt entire back to front at once. If so, you shouldn''t see any tearing...
VazGames.com
Phil P
I use GDI only for my full screen Asteroids game and had no tearing at all. Haven''t worked with Windows Bitmaps yet but I expect no tearing. Put a link to your source...
Are you sure you are doing this each frame: (1) erase back buffer, (2) draw all graphics to back buffer, then when all drawing done (3) BitBlt entire back to front at once. If so, you shouldn''t see any tearing...
VazGames.com
Phil P
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement