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
@ stdcall wglSetLayerPaletteEntries(long long long long ptr) wglSetLayerPaletteEntries
@ stdcall wglShareLists(long long) wglShareLists
@ stdcall wglSwapLayerBuffers(long long) wglSwapLayerBuffers
@ stdcall wglUseFontBitmaps(long long long long) wglUseFontBitmaps
@ stdcall wglUseFontOutlines(long long long long long long long) wglUseFontOutlines
@ stdcall wglUseFontBitmapsA(long long long long) wglUseFontBitmapsA
@ stdcall wglUseFontOutlinesA(long long long long long long long) wglUseFontOutlinesA
@ stub glGetLevelParameterfv
@ stub glGetLevelParameteriv
@ stub wglUseFontBitmapsA
@ stub wglUseFontOutlinesA
@ stub wglUseFontBitmapsW
@ stub wglUseFontOutlinesW
@ forward wglChoosePixelFormat GDI32.ChoosePixelFormat
@ forward wglDescribePixelFormat GDI32.DescribePixelFormat
@ forward wglGetPixelFormat GDI32.GetPixelFormat
......
......@@ -16,12 +16,12 @@ type win32
@ stdcall wglSetLayerPaletteEntries(long long long long ptr) wglSetLayerPaletteEntries
@ stdcall wglShareLists(long long) wglShareLists
@ stdcall wglSwapLayerBuffers(long long) wglSwapLayerBuffers
@ stdcall wglUseFontBitmaps(long long long long) wglUseFontBitmaps
@ stdcall wglUseFontOutlines(long long long long long long long) wglUseFontOutlines
@ stdcall wglUseFontBitmapsA(long long long long) wglUseFontBitmapsA
@ stdcall wglUseFontOutlinesA(long long long long long long long) wglUseFontOutlinesA
@ stub glGetLevelParameterfv
@ stub glGetLevelParameteriv
@ stub wglUseFontBitmapsA
@ stub wglUseFontOutlinesA
@ stub wglUseFontBitmapsW
@ stub wglUseFontOutlinesW
@ forward wglChoosePixelFormat GDI32.ChoosePixelFormat
@ forward wglDescribePixelFormat GDI32.DescribePixelFormat
@ forward wglGetPixelFormat GDI32.GetPixelFormat
......
......@@ -12,6 +12,7 @@
#include "windef.h"
#include "wine_gl.h"
#include "x11drv.h"
#include "x11font.h"
#include "wgl.h"
#include "opengl_ext.h"
......@@ -77,9 +78,13 @@ BOOL WINAPI wglCopyContext(HGLRC hglrcSrc,
* wglDeleteContext
*/
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,
/***********************************************************************
* wglUseFontBitmaps
*/
BOOL WINAPI wglUseFontBitmaps(HDC hdc,
DWORD first,
DWORD count,
DWORD listBase) {
FIXME("(): stub !\n");
BOOL WINAPI wglUseFontBitmapsA(HDC hdc,
DWORD first,
DWORD count,
DWORD listBase) {
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
*/
BOOL WINAPI wglUseFontOutlines(HDC hdc,
DWORD first,
DWORD count,
DWORD listBase,
FLOAT deviation,
FLOAT extrusion,
int format,
LPGLYPHMETRICSFLOAT lpgmf) {
BOOL WINAPI wglUseFontOutlinesA(HDC hdc,
DWORD first,
DWORD count,
DWORD listBase,
FLOAT deviation,
FLOAT extrusion,
int format,
LPGLYPHMETRICSFLOAT lpgmf) {
FIXME("(): stub !\n");
return FALSE;
......
......@@ -23,6 +23,7 @@
#include "options.h"
#include "user.h"
#include "win.h"
#include "wine_gl.h"
#include "x11drv.h"
DEFAULT_DEBUG_CHANNEL(x11drv);
......@@ -153,26 +154,50 @@ static void create_desktop( const char *geometry )
XSetWindowAttributes win_attr;
XTextProperty window_name;
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 );
MONITOR_PrimaryMonitor.rect.right = width;
MONITOR_PrimaryMonitor.rect.bottom = height;
/* Create window */
win_attr.background_pixel = BlackPixel(display, 0);
win_attr.event_mask = ExposureMask | KeyPressMask | KeyReleaseMask |
PointerMotionMask | ButtonPressMask |
ButtonReleaseMask | EnterWindowMask;
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,
CopyFromParent, InputOutput, CopyFromParent,
CWBackPixel | CWEventMask | CWCursor, &win_attr);
(vi == NULL ? CopyFromParent : vi->depth),
InputOutput,
(vi == NULL ? CopyFromParent : vi->visual),
CWBackPixel | CWEventMask | CWCursor | (vi == NULL ? 0 : CWColormap),
&win_attr );
/* Set window manager properties */
size_hints = TSXAllocSizeHints();
wm_hints = TSXAllocWMHints();
class_hints = TSXAllocClassHint();
......@@ -204,7 +229,6 @@ static void create_desktop( const char *geometry )
TSXFree( class_hints );
/* Map window */
TSXMapWindow( display, root_window );
}
......
......@@ -107,6 +107,9 @@ UseDGA = Y
UseXShm = Y
; Enable DirectX mouse grab
DXGrab = N
; Create the desktop window with a double-buffered visual
; (useful to play OpenGL games)
DesktopDoubleBuffered = N
[fonts]
;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