OGL-app in fullscreen; other windows on top of it appear strange (win98se)

When my app is in fullscreen mode and I attempt to display any window on top of it they appear strange. They are blinking fast, and the ogl-scene shines through in a way.
My dwStyle is WS_POPUP, WS_POPUPWINDOW for example doesn’t have those problems but is significantly slower, though.

I would like to display a second window that works as a console.

Thanks for any help!

your problem is page flipping.
in window mode when calling swapbuffers, opengl copies the backbuffer with a blit into the fromtbuffer using a clipping-mask (for overlapping windows).
howerver, when you switch to fullscreen the driver uses buffer flipping. in this method, only the pointer to the currently visible buffer is changed. the buffers are switched.

fortunately, there are some a ways from preventing opengl using buffer flipping:

1st method:
with no coding but for nvidia only.
nvidia drivers allow you to choose the buffer flipping mode: set it to “copy buffer”

2nd method:
check all available pixelformats (with DescribePixelFormat) and check for the presence of the PFD_SWAP_COPY or PFD_SWAP_FLIP flags.

3rd method:
this is the easiest way: switch to fullscreen mode but don’t open an fullscren openGL window. make it just 1 pixel smaller (ie: for 800x600 fullscreen use a 799x600 or 800x599 window)
this makes opengl to run in windowed mode and the buffer-copy method is used for swapbuffers.
ofcourse you have to deal with the problem that you have one line or row, wich could show some desktop parts. but this is not a real problem, and i’m sure you know how to handle it…

Thanks for the reply. I am wondering wether this will slow down the app in any way? I could imagine the cards are optimized for this buffer flipping.
And I don’t really like the idea to have fullscreen with queer resolutions.

How to people present their console? (Apart from the quake method)

that’s right. page flipping is the fastest and optimized way. it was inventend back at the time, where it was a real challage to blit the whole screen at once…
but today the blitting of a buffer is made really fast on most GPU’s so you won’t notice any real performace difference.

I tried method 1 & 3. Unfortunately it is slower. I assume 2 will give the same results, but could you explain a bit more detailed how I can enable this, anyway?
Thanks for the help!

try this piece of code out. i think this should explain, how this func works.

int SetDCPixelFormat(gxCONTEXT *gxC,HDC hDC,unsigned int bpp)
{ int nPixelFormat=0;
int t,pfnum,r,pt,maxpt;
char flags[2048];


pfnum = DescribePixelFormat(hDC, 0, 0,0L);
if(!pfnum)return 0L; // ERROR->NOTHING FOUND

//gxdbs(800,(s,“request:ChoosePixelFormat:%d possible modes found”,pfnum));
nPixelFormat = -1;
maxpt = 0;
{ // jetzt alle testen, und den besten match suchen…
r = DescribePixelFormat(hDC, t, sizeof(dpfd),&dpfd);
{ //gxdb(800,“error”);
break; // das wars…
if(dpfd.dwFlags & PFD_DRAW_TO_WINDOW) strcat(flags," DRAW_TO_WINDOW");
if(dpfd.dwFlags & PFD_DRAW_TO_BITMAP) strcat(flags," DRAW_TO_BITMAP");
if(dpfd.dwFlags & PFD_SWAP_COPY) strcat(flags," SWAP_COPY");
if(dpfd.dwFlags & PFD_SWAP_EXCHANGE) strcat(flags," SWAP_FLIP");
if(dpfd.dwFlags & PFD_SUPPORT_OPENGL) strcat(flags," OPENGL");
if(dpfd.dwFlags & PFD_SUPPORT_GDI) strcat(flags," GDI");
if(dpfd.dwFlags & PFD_DOUBLEBUFFER) strcat(flags," DOUBLEBUFFER");
if(dpfd.dwFlags & PFD_STEREO) strcat(flags," STEREO");
if(dpfd.dwFlags & PFD_GENERIC_FORMAT) strcat(flags," GENERIC");
if(dpfd.dwFlags & PFD_NEED_PALETTE) strcat(flags," NEED_PALETTE");
if(dpfd.dwFlags & PFD_NEED_SYSTEM_PALETTE) strcat(flags," NEED_SYSTEM_PALETTE");
if(dpfd.dwFlags & PFD_GENERIC_ACCELERATED) strcat(flags," ACCELERATED");

  // just output
  fprintf(stdout, "color:%d depth:%d alpha:% stencil:%d  %s",
  	dpfd.cStencilBits, flags);

  // make your check for some of the flags HERE




[This message has been edited by AdrianD (edited 08-25-2003).]