Huw Davies : opengl: Add support for rendering on bitmaps.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Dec 19 14:22:06 CST 2005


Module: wine
Branch: refs/heads/master
Commit: 412cb77d511fc370932e21e7945d6f902c6992fc
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=412cb77d511fc370932e21e7945d6f902c6992fc

Author: Huw Davies <huw at codeweavers.com>
Date:   Mon Dec 19 17:45:13 2005 +0100

opengl: Add support for rendering on bitmaps.

---

 dlls/opengl32/wgl.c  |   24 ++++++++++++++++--------
 dlls/x11drv/init.c   |    1 +
 dlls/x11drv/opengl.c |    6 ------
 3 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c
index 30ff1d0..55e8242 100644
--- a/dlls/opengl32/wgl.c
+++ b/dlls/opengl32/wgl.c
@@ -43,10 +43,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(opengl);
 #define X11DRV_ESCAPE 6789
 enum x11drv_escape_codes
 {
-    X11DRV_GET_DISPLAY,   /* get X11 display for a DC */
-    X11DRV_GET_DRAWABLE,  /* get current drawable for a DC */
-    X11DRV_GET_FONT,      /* get current X font for a DC */
-    X11DRV_SET_DRAWABLE,     /* set current drawable for a DC */
+    X11DRV_GET_DISPLAY,         /* get X11 display for a DC */
+    X11DRV_GET_DRAWABLE,        /* get current drawable for a DC */
+    X11DRV_GET_FONT,            /* get current X font for a DC */
+    X11DRV_SET_DRAWABLE,        /* set current drawable for a DC */
+    X11DRV_START_EXPOSURES,     /* start graphics exposures */
+    X11DRV_END_EXPOSURES,       /* end graphics exposures */
+    X11DRV_GET_DCE,             /* get the DCE pointer */
+    X11DRV_SET_DCE,             /* set the DCE pointer */
+    X11DRV_GET_GLX_DRAWABLE     /* get current glx drawable for a DC */
 };
 
 void (*wine_tsx11_lock_ptr)(void) = NULL;
@@ -121,11 +126,11 @@ inline static Display *get_display( HDC 
 }
 
 
-/* retrieve the X drawable to use on a given DC */
+/* retrieve the GLX drawable to use on a given DC */
 inline static Drawable get_drawable( HDC hdc )
 {
-    Drawable drawable;
-    enum x11drv_escape_codes escape = X11DRV_GET_DRAWABLE;
+    GLXDrawable drawable;
+    enum x11drv_escape_codes escape = X11DRV_GET_GLX_DRAWABLE;
 
     if (!ExtEscape( hdc, X11DRV_ESCAPE, sizeof(escape), (LPCSTR)&escape,
                     sizeof(drawable), (LPSTR)&drawable )) drawable = 0;
@@ -144,7 +149,7 @@ inline static HDC get_hdc_from_Drawable(
   return NULL;
 }
 
-/* retrieve the X drawable to use on a given DC */
+/* retrieve the X font to use on a given DC */
 inline static Font get_font( HDC hdc )
 {
     Font font;
@@ -469,6 +474,7 @@ PROC WINAPI wglGetProcAddress(LPCSTR  lp
 BOOL WINAPI wglMakeCurrent(HDC hdc,
 			   HGLRC hglrc) {
   BOOL ret;
+  DWORD type = GetObjectType(hdc);
 
   TRACE("(%p,%p)\n", hdc, hglrc);
 
@@ -523,6 +529,8 @@ BOOL WINAPI wglMakeCurrent(HDC hdc,
       }
       TRACE(" make current for dis %p, drawable %p, ctx %p\n", ctx->display, (void*) drawable, ctx->ctx);
       ret = glXMakeCurrent(ctx->display, drawable, ctx->ctx);
+      if(ret && type == OBJ_MEMDC)
+          glDrawBuffer(GL_FRONT_LEFT);
   }
   LEAVE_GL();
   TRACE(" returning %s\n", (ret ? "True" : "False"));
diff --git a/dlls/x11drv/init.c b/dlls/x11drv/init.c
index 69cfa02..c2729b4 100644
--- a/dlls/x11drv/init.c
+++ b/dlls/x11drv/init.c
@@ -415,6 +415,7 @@ INT X11DRV_ExtEscape( X11DRV_PDEVICE *ph
                         if(!physDev->bitmap->glxpixmap)
                             physDev->bitmap->glxpixmap = create_glxpixmap(physDev);
 
+                        X11DRV_CoerceDIBSection(physDev, DIB_Status_GdiMod, FALSE);
                         *(Drawable *)out_data = physDev->bitmap->glxpixmap;
                     }
                     else
diff --git a/dlls/x11drv/opengl.c b/dlls/x11drv/opengl.c
index c119e7c..a2a591e 100644
--- a/dlls/x11drv/opengl.c
+++ b/dlls/x11drv/opengl.c
@@ -199,12 +199,6 @@ int X11DRV_ChoosePixelFormat(X11DRV_PDEV
     dump_PIXELFORMATDESCRIPTOR((const PIXELFORMATDESCRIPTOR *) ppfd);
   }
 
-  if (ppfd->dwFlags & PFD_DRAW_TO_BITMAP) {
-    ERR("Flag not supported !\n");
-    /* Should SetError here... */
-    return 0;
-  }
-
   /* Now, build the request to GLX */
   
   if (ppfd->iPixelType == PFD_TYPE_COLORINDEX) {




More information about the wine-cvs mailing list