Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

JIMbond21

Windows GDI question???

This topic is 5398 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

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!!!

Share this post


Link to post
Share on other sites
Advertisement
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
<< 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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!