win32-tweak opengl display method

This commit is contained in:
zeromus 2013-02-09 19:02:17 +00:00
parent 533b810efe
commit 24647e57e0
2 changed files with 10 additions and 10 deletions

View File

@ -1511,12 +1511,13 @@ static void OGL_DoDisplay()
ScreenToClient(hwnd,(LPPOINT)&dr[i].right); ScreenToClient(hwnd,(LPPOINT)&dr[i].right);
} }
//clear entire area, for cases where the screen is maximized //clear entire area, for cases where the screen is maximized
glClearColor(0,0,0,0); glClearColor(0,0,0,0);
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);
glDisable(GL_LIGHTING);
glDisable(GL_DEPTH_TEST);
//use clear+scissor for gap //use clear+scissor for gap
if(video.screengap > 0) if(video.screengap > 0)
{ {

View File

@ -75,15 +75,14 @@ bool initContext(HWND hwnd, HGLRC *hRC, HDC *hdc)
memset(&pfd,0, sizeof(PIXELFORMATDESCRIPTOR)); memset(&pfd,0, sizeof(PIXELFORMATDESCRIPTOR));
pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR); pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
pfd.nVersion = 1; pfd.nVersion = 1;
pfd.dwFlags = PFD_SUPPORT_OPENGL; pfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW;
pfd.iPixelType = PFD_TYPE_RGBA; pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cColorBits = 24; pfd.cColorBits = 24;
pfd.cDepthBits = 24;
pfd.cAlphaBits = 8; pfd.cAlphaBits = 8;
pfd.cStencilBits = 8;
pfd.iLayerType = PFD_MAIN_PLANE; pfd.iLayerType = PFD_MAIN_PLANE;
PixelFormat = ChoosePixelFormat(oglDC, &pfd); PixelFormat = ChoosePixelFormat(oglDC, &pfd);
SetPixelFormat(oglDC, PixelFormat, &pfd); SetPixelFormat(oglDC, PixelFormat, &pfd);
printf("GL display context pixel format: %d\n",PixelFormat);
*hRC = wglCreateContext(oglDC); *hRC = wglCreateContext(oglDC);
if (!hRC) if (!hRC)
@ -123,8 +122,8 @@ static bool makeBootstrapContext()
pfd.dwFlags = PFD_SUPPORT_OPENGL; pfd.dwFlags = PFD_SUPPORT_OPENGL;
pfd.iPixelType = PFD_TYPE_RGBA; pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cColorBits = 24; pfd.cColorBits = 24;
pfd.cDepthBits = 24;
pfd.cAlphaBits = 8; pfd.cAlphaBits = 8;
pfd.cDepthBits = 24;
pfd.cStencilBits = 8; pfd.cStencilBits = 8;
pfd.iLayerType = PFD_MAIN_PLANE; pfd.iLayerType = PFD_MAIN_PLANE;