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);
}
//clear entire area, for cases where the screen is maximized
glClearColor(0,0,0,0);
glClear(GL_COLOR_BUFFER_BIT);
glDisable(GL_LIGHTING);
glDisable(GL_DEPTH_TEST);
//use clear+scissor for gap
if(video.screengap > 0)
{

View File

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