Jump to content
  • Advertisement


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


Double buffer window

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

Hi, This is a newbie question... I want to have a double-buffered window that is not the full screen size. However, I keep getting an error when creating the directdraw surface unless i set the cooperative level to DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN. For a single buffered window, I can run on DDSCL_NORMAL, but for the double buffered window it seems that I need to do this. However, when I run my program, the entire screen is now taken up by my program as opposed to the small OVERLAPPED window I want. It seems that I cannot run DDSCL_EXCLUSIVE without DDSCL_FULLSCREEN. Does anyone have any ideas on how to do this the right way? Thanks in advance! -Eltri

Share this post

Link to post
Share on other sites
You cannot have exclusive control of the primary surface (which is the entire desktop in windowed mode) since other applications are being rendered also. The only flag you should need to use is DDSCL_NORMAL.

If it still isn''t working try finding out which error DirectDraw is returning. They can be very informative.

[Edited by - JonW on March 15, 2007 8:32:45 AM]

Share this post

Link to post
Share on other sites
Its quite simple, Direct Draw cannot create/attactch backbuffers to surfaces in Normal Mode. So you Cant use the backbuffer flag or set backbuffer count.

So you have to create an offscreen plain the Size of primary surface and Blt it to primary surface .

ZeroMemory(&ddsd, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
ddsd.dwWidth = WIDTH_OF_PRIMARY;
ddsd.dwHeight = HEIGHT_OF_PRIMARY;

And that is your Backbuffer

[edited by - Daerax on August 14, 2002 10:46:34 PM]

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!