Read the MSDN documentation on SetPixelFormat, you can only call it once
per HDC (so you calling it a second time has no effect). You can't
destroy the HDC as HL is using that to render into.

- Alfred

jc wrote:

Phantom wrote:

iirc you cant have a stenscil buffer with a 16bit z-buffer, you have to use
a 32bit z-buffer, 24bits being for z-buffer data and the remaining 8bits
are
used for stencil infomation


I was sure the nehe stencil tuts had a 16bit z-buffer :/ and I still cant get it to work. There is no change in any of the values when i get windows to describe the current pixel format. Its a though its going back to the old settings >_<.... Anyone got this to work? Shimms you said it could be done O_o... how the hell.... Do I have to destroy the DC as well O_o?

   g_hDC = wglGetCurrentDC();
   g_hRC = wglGetCurrentContext();

   if (!g_hDC || !g_hRC)
   {
       ::MessageBox(NULL, "OpenGL Could Not Be Located O_O", "ERROR",
MB_OK);
       exit(1);
   }

PIXELFORMATDESCRIPTOR pfd;

   // we use hl's original pix format as a base...
   int iPixelFormat = GetPixelFormat(g_hDC);
   DescribePixelFormat(g_hDC, iPixelFormat,
sizeof(PIXELFORMATDESCRIPTOR), &pfd);

   wglMakeCurrent( g_hDC, NULL );
   wglDeleteContext( g_hRC );
   g_hRC = NULL;

   pfd.cStencilBits = 1;
   pfd.cDepthBits = 32;

   iPixelFormat = ChoosePixelFormat( g_hDC, &pfd );
   SetPixelFormat( g_hDC, iPixelFormat, &pfd);

   g_hRC = wglCreateContext( g_hDC );
   wglMakeCurrent( g_hDC, g_hRC );

jc

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

_______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders



Reply via email to