Skip to main content
GameDev.net gamedev.net
🔒 Locked

SwapBuffers issue

Started by grasshop May 25, 2013 at 8:39 PM 0 replies 1k views
Original Post
grasshop
grasshop

Hey guys.

I'm using double buffering with the flags:

void EnableDrawing (HGLRC *hRC)
{
PIXELFORMATDESCRIPTOR pfd;
int iFormat;

window_hDC = GetDC (hWnd);
ZeroMemory (&pfd, sizeof (pfd));
pfd.nSize = sizeof (pfd);
pfd.nVersion = 1;
pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cColorBits = 24;
pfd.cDepthBits = 16;
pfd.iLayerType = PFD_MAIN_PLANE;
iFormat = ChoosePixelFormat (enigma::window_hDC, &pfd);

if (iFormat==0) { show_error("Total failure. Abort.",1); }

SetPixelFormat (window_hDC, iFormat, &pfd);
*hRC = wglCreateContext(window_hDC );
wglMakeCurrent(window_hDC, *hRC );
}

Then I'm trying to use SwapBuffers(window_hDC); to update a rending scene at certain intervals, but there is a problem with it just switching between buffer images instead of keeping a solid image on the screen. So it winds up looking like this:

Qjd44TQ.png

Alternating between the two buffers instead of displaying a solid image.

Is this an issue caused by my card driver? Because I think this behaviour has actually changed, I never remember it doing this before - and I think I might have updated my driver at some point. In any case does anybody please know a way of possibly resolving or working around this? I need to keep a double buffer mechanism though.

Thanks for any help.

-

System Info:

http://pastebin.com/S2neAq4S

ps. I know this isn't directly OpenGL but I thought it fitted best here, please move it if it's in the wrong forum sorry.

grasshop
grasshop

Ok I've found out what changed on my system. It's because I turned off Vista Aero that this started to happen. Turning it back on it works properly. So what is it about Aero being off that makes it work differently?

EDIT: More specifically it is the "enable desktop composition" effect.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.