opengl: Add support for rendering on bitmaps.
This commit is contained in:
parent
dbc14a5cb5
commit
412cb77d51
@ -47,6 +47,11 @@ enum x11drv_escape_codes
|
|||||||
X11DRV_GET_DRAWABLE, /* get current drawable for a DC */
|
X11DRV_GET_DRAWABLE, /* get current drawable for a DC */
|
||||||
X11DRV_GET_FONT, /* get current X font for a DC */
|
X11DRV_GET_FONT, /* get current X font for a DC */
|
||||||
X11DRV_SET_DRAWABLE, /* set current drawable 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;
|
void (*wine_tsx11_lock_ptr)(void) = NULL;
|
||||||
@ -121,11 +126,11 @@ inline static Display *get_display( HDC 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 )
|
inline static Drawable get_drawable( HDC hdc )
|
||||||
{
|
{
|
||||||
Drawable drawable;
|
GLXDrawable drawable;
|
||||||
enum x11drv_escape_codes escape = X11DRV_GET_DRAWABLE;
|
enum x11drv_escape_codes escape = X11DRV_GET_GLX_DRAWABLE;
|
||||||
|
|
||||||
if (!ExtEscape( hdc, X11DRV_ESCAPE, sizeof(escape), (LPCSTR)&escape,
|
if (!ExtEscape( hdc, X11DRV_ESCAPE, sizeof(escape), (LPCSTR)&escape,
|
||||||
sizeof(drawable), (LPSTR)&drawable )) drawable = 0;
|
sizeof(drawable), (LPSTR)&drawable )) drawable = 0;
|
||||||
@ -144,7 +149,7 @@ inline static HDC get_hdc_from_Drawable(GLXDrawable d)
|
|||||||
return NULL;
|
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 )
|
inline static Font get_font( HDC hdc )
|
||||||
{
|
{
|
||||||
Font font;
|
Font font;
|
||||||
@ -469,6 +474,7 @@ PROC WINAPI wglGetProcAddress(LPCSTR lpszProc) {
|
|||||||
BOOL WINAPI wglMakeCurrent(HDC hdc,
|
BOOL WINAPI wglMakeCurrent(HDC hdc,
|
||||||
HGLRC hglrc) {
|
HGLRC hglrc) {
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
|
DWORD type = GetObjectType(hdc);
|
||||||
|
|
||||||
TRACE("(%p,%p)\n", hdc, hglrc);
|
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);
|
TRACE(" make current for dis %p, drawable %p, ctx %p\n", ctx->display, (void*) drawable, ctx->ctx);
|
||||||
ret = glXMakeCurrent(ctx->display, drawable, ctx->ctx);
|
ret = glXMakeCurrent(ctx->display, drawable, ctx->ctx);
|
||||||
|
if(ret && type == OBJ_MEMDC)
|
||||||
|
glDrawBuffer(GL_FRONT_LEFT);
|
||||||
}
|
}
|
||||||
LEAVE_GL();
|
LEAVE_GL();
|
||||||
TRACE(" returning %s\n", (ret ? "True" : "False"));
|
TRACE(" returning %s\n", (ret ? "True" : "False"));
|
||||||
|
@ -415,6 +415,7 @@ INT X11DRV_ExtEscape( X11DRV_PDEVICE *physDev, INT escape, INT in_count, LPCVOID
|
|||||||
if(!physDev->bitmap->glxpixmap)
|
if(!physDev->bitmap->glxpixmap)
|
||||||
physDev->bitmap->glxpixmap = create_glxpixmap(physDev);
|
physDev->bitmap->glxpixmap = create_glxpixmap(physDev);
|
||||||
|
|
||||||
|
X11DRV_CoerceDIBSection(physDev, DIB_Status_GdiMod, FALSE);
|
||||||
*(Drawable *)out_data = physDev->bitmap->glxpixmap;
|
*(Drawable *)out_data = physDev->bitmap->glxpixmap;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -199,12 +199,6 @@ int X11DRV_ChoosePixelFormat(X11DRV_PDEVICE *physDev,
|
|||||||
dump_PIXELFORMATDESCRIPTOR((const PIXELFORMATDESCRIPTOR *) ppfd);
|
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 */
|
/* Now, build the request to GLX */
|
||||||
|
|
||||||
if (ppfd->iPixelType == PFD_TYPE_COLORINDEX) {
|
if (ppfd->iPixelType == PFD_TYPE_COLORINDEX) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user