Commit 7e5c2c04 authored by Lionel Ulmer's avatar Lionel Ulmer Committed by Alexandre Julliard

- added option to get double-buffered desktop

- implemented wglUseFontBitmapsA and wglDeleteContext
parent 997e0d78
...@@ -21,12 +21,12 @@ type win32 ...@@ -21,12 +21,12 @@ type win32
@ stdcall wglSetLayerPaletteEntries(long long long long ptr) wglSetLayerPaletteEntries @ stdcall wglSetLayerPaletteEntries(long long long long ptr) wglSetLayerPaletteEntries
@ stdcall wglShareLists(long long) wglShareLists @ stdcall wglShareLists(long long) wglShareLists
@ stdcall wglSwapLayerBuffers(long long) wglSwapLayerBuffers @ stdcall wglSwapLayerBuffers(long long) wglSwapLayerBuffers
@ stdcall wglUseFontBitmaps(long long long long) wglUseFontBitmaps @ stdcall wglUseFontBitmapsA(long long long long) wglUseFontBitmapsA
@ stdcall wglUseFontOutlines(long long long long long long long) wglUseFontOutlines @ stdcall wglUseFontOutlinesA(long long long long long long long) wglUseFontOutlinesA
@ stub glGetLevelParameterfv @ stub glGetLevelParameterfv
@ stub glGetLevelParameteriv @ stub glGetLevelParameteriv
@ stub wglUseFontBitmapsA @ stub wglUseFontBitmapsW
@ stub wglUseFontOutlinesA @ stub wglUseFontOutlinesW
@ forward wglChoosePixelFormat GDI32.ChoosePixelFormat @ forward wglChoosePixelFormat GDI32.ChoosePixelFormat
@ forward wglDescribePixelFormat GDI32.DescribePixelFormat @ forward wglDescribePixelFormat GDI32.DescribePixelFormat
@ forward wglGetPixelFormat GDI32.GetPixelFormat @ forward wglGetPixelFormat GDI32.GetPixelFormat
......
...@@ -16,12 +16,12 @@ type win32 ...@@ -16,12 +16,12 @@ type win32
@ stdcall wglSetLayerPaletteEntries(long long long long ptr) wglSetLayerPaletteEntries @ stdcall wglSetLayerPaletteEntries(long long long long ptr) wglSetLayerPaletteEntries
@ stdcall wglShareLists(long long) wglShareLists @ stdcall wglShareLists(long long) wglShareLists
@ stdcall wglSwapLayerBuffers(long long) wglSwapLayerBuffers @ stdcall wglSwapLayerBuffers(long long) wglSwapLayerBuffers
@ stdcall wglUseFontBitmaps(long long long long) wglUseFontBitmaps @ stdcall wglUseFontBitmapsA(long long long long) wglUseFontBitmapsA
@ stdcall wglUseFontOutlines(long long long long long long long) wglUseFontOutlines @ stdcall wglUseFontOutlinesA(long long long long long long long) wglUseFontOutlinesA
@ stub glGetLevelParameterfv @ stub glGetLevelParameterfv
@ stub glGetLevelParameteriv @ stub glGetLevelParameteriv
@ stub wglUseFontBitmapsA @ stub wglUseFontBitmapsW
@ stub wglUseFontOutlinesA @ stub wglUseFontOutlinesW
@ forward wglChoosePixelFormat GDI32.ChoosePixelFormat @ forward wglChoosePixelFormat GDI32.ChoosePixelFormat
@ forward wglDescribePixelFormat GDI32.DescribePixelFormat @ forward wglDescribePixelFormat GDI32.DescribePixelFormat
@ forward wglGetPixelFormat GDI32.GetPixelFormat @ forward wglGetPixelFormat GDI32.GetPixelFormat
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "windef.h" #include "windef.h"
#include "wine_gl.h" #include "wine_gl.h"
#include "x11drv.h" #include "x11drv.h"
#include "x11font.h"
#include "wgl.h" #include "wgl.h"
#include "opengl_ext.h" #include "opengl_ext.h"
...@@ -77,9 +78,13 @@ BOOL WINAPI wglCopyContext(HGLRC hglrcSrc, ...@@ -77,9 +78,13 @@ BOOL WINAPI wglCopyContext(HGLRC hglrcSrc,
* wglDeleteContext * wglDeleteContext
*/ */
BOOL WINAPI wglDeleteContext(HGLRC hglrc) { BOOL WINAPI wglDeleteContext(HGLRC hglrc) {
FIXME("(%p): stub !\n", hglrc); TRACE("(%p)\n", hglrc);
return FALSE; ENTER_GL();
glXDestroyContext(display, (GLXContext) hglrc);
LEAVE_GL();
return TRUE;
} }
/*********************************************************************** /***********************************************************************
...@@ -284,26 +289,36 @@ BOOL WINAPI wglSwapLayerBuffers(HDC hdc, ...@@ -284,26 +289,36 @@ BOOL WINAPI wglSwapLayerBuffers(HDC hdc,
/*********************************************************************** /***********************************************************************
* wglUseFontBitmaps * wglUseFontBitmaps
*/ */
BOOL WINAPI wglUseFontBitmaps(HDC hdc, BOOL WINAPI wglUseFontBitmapsA(HDC hdc,
DWORD first, DWORD first,
DWORD count, DWORD count,
DWORD listBase) { DWORD listBase) {
FIXME("(): stub !\n"); DC * dc = DC_GetDCPtr( hdc );
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
fontObject* pfo = XFONT_GetFontObject( physDev->font );
Font fid = pfo->fs->fid;
return FALSE; TRACE("(%08x, %ld, %ld, %ld)\n", hdc, first, count, listBase);
ENTER_GL();
/* I assume that the glyphs are at the same position for X and for Windows */
glXUseXFont(fid, first, count, listBase);
LEAVE_GL();
return TRUE;
} }
/*********************************************************************** /***********************************************************************
* wglUseFontOutlines * wglUseFontOutlines
*/ */
BOOL WINAPI wglUseFontOutlines(HDC hdc, BOOL WINAPI wglUseFontOutlinesA(HDC hdc,
DWORD first, DWORD first,
DWORD count, DWORD count,
DWORD listBase, DWORD listBase,
FLOAT deviation, FLOAT deviation,
FLOAT extrusion, FLOAT extrusion,
int format, int format,
LPGLYPHMETRICSFLOAT lpgmf) { LPGLYPHMETRICSFLOAT lpgmf) {
FIXME("(): stub !\n"); FIXME("(): stub !\n");
return FALSE; return FALSE;
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "options.h" #include "options.h"
#include "user.h" #include "user.h"
#include "win.h" #include "win.h"
#include "wine_gl.h"
#include "x11drv.h" #include "x11drv.h"
DEFAULT_DEBUG_CHANNEL(x11drv); DEFAULT_DEBUG_CHANNEL(x11drv);
...@@ -153,26 +154,50 @@ static void create_desktop( const char *geometry ) ...@@ -153,26 +154,50 @@ static void create_desktop( const char *geometry )
XSetWindowAttributes win_attr; XSetWindowAttributes win_attr;
XTextProperty window_name; XTextProperty window_name;
Atom XA_WM_DELETE_WINDOW; Atom XA_WM_DELETE_WINDOW;
/* Used to create the desktop window with a good visual */
XVisualInfo *vi = NULL;
#ifdef HAVE_OPENGL
BOOL dblbuf_visual;
/* Get in wine.ini if the desktop window should have a double-buffered visual or not */
dblbuf_visual = PROFILE_GetWineIniBool( "x11drv", "DesktopDoubleBuffered", 0 );
if (dblbuf_visual) {
int dblBuf[]={GLX_RGBA,GLX_DEPTH_SIZE,16,GLX_DOUBLEBUFFER,None};
ENTER_GL();
vi = glXChooseVisual(display, DefaultScreen(display), dblBuf);
win_attr.colormap = XCreateColormap(display, RootWindow(display,vi->screen),
vi->visual, AllocNone);
LEAVE_GL();
}
#endif /* HAVE_OPENGL */
flags = TSXParseGeometry( geometry, &x, &y, &width, &height ); flags = TSXParseGeometry( geometry, &x, &y, &width, &height );
MONITOR_PrimaryMonitor.rect.right = width; MONITOR_PrimaryMonitor.rect.right = width;
MONITOR_PrimaryMonitor.rect.bottom = height; MONITOR_PrimaryMonitor.rect.bottom = height;
/* Create window */ /* Create window */
win_attr.background_pixel = BlackPixel(display, 0); win_attr.background_pixel = BlackPixel(display, 0);
win_attr.event_mask = ExposureMask | KeyPressMask | KeyReleaseMask | win_attr.event_mask = ExposureMask | KeyPressMask | KeyReleaseMask |
PointerMotionMask | ButtonPressMask | PointerMotionMask | ButtonPressMask |
ButtonReleaseMask | EnterWindowMask; ButtonReleaseMask | EnterWindowMask;
win_attr.cursor = TSXCreateFontCursor( display, XC_top_left_arrow ); win_attr.cursor = TSXCreateFontCursor( display, XC_top_left_arrow );
root_window = TSXCreateWindow( display, DefaultRootWindow(display), if (vi != NULL) {
visual = vi->visual;
screen = ScreenOfDisplay(display, vi->screen);
screen_depth = vi->depth;
}
root_window = TSXCreateWindow( display,
(vi == NULL ? DefaultRootWindow(display) : RootWindow(display, vi->screen)),
x, y, width, height, 0, x, y, width, height, 0,
CopyFromParent, InputOutput, CopyFromParent, (vi == NULL ? CopyFromParent : vi->depth),
CWBackPixel | CWEventMask | CWCursor, &win_attr); InputOutput,
(vi == NULL ? CopyFromParent : vi->visual),
CWBackPixel | CWEventMask | CWCursor | (vi == NULL ? 0 : CWColormap),
&win_attr );
/* Set window manager properties */ /* Set window manager properties */
size_hints = TSXAllocSizeHints(); size_hints = TSXAllocSizeHints();
wm_hints = TSXAllocWMHints(); wm_hints = TSXAllocWMHints();
class_hints = TSXAllocClassHint(); class_hints = TSXAllocClassHint();
...@@ -204,7 +229,6 @@ static void create_desktop( const char *geometry ) ...@@ -204,7 +229,6 @@ static void create_desktop( const char *geometry )
TSXFree( class_hints ); TSXFree( class_hints );
/* Map window */ /* Map window */
TSXMapWindow( display, root_window ); TSXMapWindow( display, root_window );
} }
......
...@@ -107,6 +107,9 @@ UseDGA = Y ...@@ -107,6 +107,9 @@ UseDGA = Y
UseXShm = Y UseXShm = Y
; Enable DirectX mouse grab ; Enable DirectX mouse grab
DXGrab = N DXGrab = N
; Create the desktop window with a double-buffered visual
; (useful to play OpenGL games)
DesktopDoubleBuffered = N
[fonts] [fonts]
;Read documentation/fonts before adding aliases ;Read documentation/fonts before adding aliases
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment