How does OpenGL know to FLIP or BLIT?

Started by
2 comments, last by malachii 22 years, 2 months ago
In a nutshell, I''m new to OpenGL, but have some Direct3D experience (8.1). I want to know how OpenGL knows to FLIP or BLIT when you go into fullscreen mode, versus windowed, because based on NeHe''s tutorials, there isn''t really any difference (since we set the screen resolution and depth ourselves, manually). In Direct3D, when going full screen versus windowed mode, you specifically tell Direct3D to FLIP versus BLIT, and it takes care of setting the screen resolution, etc. For example, in Direct3D I have:
  
d3dpp.SwapEffect= D3DSWAPEFFECT_FLIP;
d3dpp.Windowed= FALSE;
d3dpp.BackBufferFormat= m_displayFormat;
  
In OpenGL, I do nothing differently (other than some window resizing, and using the PFD to set the screen mode). To switch swap the back and front buffers, I use:
  
SwapBuffers(m_hDC);
  
Thanks so much! Mal.
Advertisement
The driver decides usually. In the PFD you can set a flag PFD_SWAP_COPY or PFD_SWAP_EXCHANGE when you use glAddSwapHintRectWIN() extension. The driver can ignore it though, it''s just a hint. In Nvidia''s drivers the user can decide from auto/swap/blit in the device control panel as well. Obviously in windowed mode the driver blits no matter what. So bottom line, the driver usually decides.

------------
- outRider -
outRider,

I''m not yet familiar with extensions, and so haven''t installed any. I guess that''s why my OpenGL doesn''t recognise the "glAddSwapHintRectWIN" you mention.

So, out of curiosity, what do you think prods the OpenGL driver into knowing when to FLIP?

(perhaps it checks your hWnd client area and if it is equal to your screen resolution, it FLIPs?)

Thanks!

Mal.
Probably. Email Nvidia and find out

------------
- outRider -

This topic is closed to new replies.

Advertisement