DXGL r107 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r106‎ | r107 | r108 >
Date:02:36, 29 February 2012
Author:admin
Status:new
Tags:
Comment:
Fix window message loop.
Verify existence of FBO extensions
Modified paths:
  • /ddraw/glExtensions.cpp (modified) (history)
  • /ddraw/glRenderer.cpp (modified) (history)

Diff [purge]

Index: ddraw/glExtensions.cpp
@@ -151,6 +151,7 @@
152152 if(GLEXT_ARB_framebuffer_object)
153153 {
154154 glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)wglGetProcAddress("glGenFramebuffers");
 155+ if(!glGenFramebuffers) GLEXT_ARB_framebuffer_object = 0;
155156 glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)wglGetProcAddress("glBindFramebuffer");
156157 glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)wglGetProcAddress("glGenRenderbuffers");
157158 glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)wglGetProcAddress("glBindRenderbuffer");
@@ -161,6 +162,7 @@
162163 if(GLEXT_EXT_framebuffer_object)
163164 {
164165 glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC)wglGetProcAddress("glGenFramebuffersEXT");
 166+ if(!glGenFramebuffersEXT) GLEXT_EXT_framebuffer_object = 0;
165167 glBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC)wglGetProcAddress("glBindFramebufferEXT");
166168 glGenRenderbuffersEXT = (PFNGLGENRENDERBUFFERSEXTPROC)wglGetProcAddress("glGenRenderbuffersEXT");
167169 glBindRenderbufferEXT = (PFNGLBINDRENDERBUFFEREXTPROC)wglGetProcAddress("glBindRenderbufferEXT");
Index: ddraw/glRenderer.cpp
@@ -493,7 +493,6 @@
494494 hasHWnd = false;
495495 }
496496 SetWindowPos(hRenderWnd,HWND_TOP,0,0,rectRender.right,rectRender.bottom,SWP_SHOWWINDOW);
497 - wndbusy = false;
498497 if(hRC)
499498 {
500499 wglMakeCurrent(NULL,NULL);
@@ -546,6 +545,7 @@
547546 gllock = false;
548547 return FALSE;
549548 }
 549+ wndbusy = false;
550550 gllock = false;
551551 InitGLExt();
552552 SetSwap(1);
@@ -642,7 +642,7 @@
643643 bltvertices[0].s = bltvertices[2].s = (GLfloat)srcrect.right / (GLfloat)ddsdSrc.dwWidth;
644644 bltvertices[0].t = bltvertices[1].t = (GLfloat)srcrect.top / (GLfloat)ddsdSrc.dwHeight;
645645 bltvertices[2].t = bltvertices[3].t = (GLfloat)srcrect.bottom / (GLfloat)ddsdSrc.dwHeight;
646 - glClear(GL_DEPTH_BUFFER_BIT);
 646+ if(dest->zbuffer) glClear(GL_DEPTH_BUFFER_BIT);
647647 if(dwFlags & DDBLT_COLORFILL)
648648 {
649649 SetShader(PROG_FILL,NULL,true);
@@ -1353,7 +1353,6 @@
13541354 case GLEVENT_BLT:
13551355 outputs[0] = (void*)_Blt((LPRECT)inputs[0],(glDirectDrawSurface7*)inputs[1],(glDirectDrawSurface7*)inputs[2],
13561356 (LPRECT)inputs[3],(DWORD)inputs[4],(LPDDBLTFX)inputs[5]);
1357 - wndbusy = false;
13581357 return 0;
13591358 case GLEVENT_DRAWSCREEN:
13601359 _DrawScreen((GLuint)inputs[0],(GLuint)inputs[1],(glDirectDrawSurface7*)inputs[2],(glDirectDrawSurface7*)inputs[3]);
@@ -1374,8 +1373,10 @@
13751374 _DrawIndexedPrimitive((glDirect3DDevice7*)inputs[0],d3dpt,(DWORD)inputs[2],(LPVOID)inputs[3],
13761375 (DWORD)inputs[4],(LPWORD)inputs[5],(DWORD)inputs[6],(DWORD)inputs[7]);
13771376 return 0;
 1377+ default:
 1378+ return DefWindowProc(hwnd,msg,wParam,lParam);
13781379 }
1379 - return DefWindowProc(hwnd,msg,wParam,lParam);
 1380+ return 0;
13801381 }
13811382
13821383