Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
1113706c
Commit
1113706c
authored
May 23, 2000
by
Lionel Ulmer
Committed by
Alexandre Julliard
May 23, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- fixed the OpenGL32 spec file (and the make_opengl_spec tool)
- prevent HalfLife from crashing when it frees three times the same rendering context
parent
3be104e0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
23 deletions
+71
-23
make_opengl_spec
dlls/opengl32/make_opengl_spec
+3
-2
opengl32.spec
dlls/opengl32/opengl32.spec
+3
-3
wgl.c
dlls/opengl32/wgl.c
+65
-18
No files found.
dlls/opengl32/make_opengl_spec
View file @
1113706c
...
...
@@ -22,7 +22,7 @@ type win32
@ stdcall wglShareLists(long long) wglShareLists
@ stdcall wglSwapLayerBuffers(long long) wglSwapLayerBuffers
@ stdcall wglUseFontBitmapsA(long long long long) wglUseFontBitmapsA
@ stdcall wglUseFontOutlinesA(long long long long long long long) wglUseFontOutlinesA
@ stdcall wglUseFontOutlinesA(long long long long long long long
ptr
) wglUseFontOutlinesA
@ stub glGetLevelParameterfv
@ stub glGetLevelParameteriv
@ stub wglUseFontBitmapsW
...
...
@@ -63,7 +63,8 @@ while ($line = <INC>) {
print
"ptr "
;
}
elsif
(
$_
=~
/[a-zA-Z]/
)
{
(
$type
)
=
(
$_
=~
/^ *(.*) +.*/
);
if
(
$type
=~
/double/
)
{
if
((
$type
=~
/double/
)
||
(
$type
=~
/clampd/
))
{
print
"double "
;
}
elsif
(
$type
!~
/void/
)
{
print
"long "
;
...
...
dlls/opengl32/opengl32.spec
View file @
1113706c
...
...
@@ -17,7 +17,7 @@ type win32
@ stdcall wglShareLists(long long) wglShareLists
@ stdcall wglSwapLayerBuffers(long long) wglSwapLayerBuffers
@ stdcall wglUseFontBitmapsA(long long long long) wglUseFontBitmapsA
@ stdcall wglUseFontOutlinesA(long long long long long long long) wglUseFontOutlinesA
@ stdcall wglUseFontOutlinesA(long long long long long long long
ptr
) wglUseFontOutlinesA
@ stub glGetLevelParameterfv
@ stub glGetLevelParameteriv
@ stub wglUseFontBitmapsW
...
...
@@ -70,10 +70,10 @@ type win32
@ stdcall glFinish() wine_glFinish
@ stdcall glFlush() wine_glFlush
@ stdcall glHint(long long ) wine_glHint
@ stdcall glClearDepth(
long
) wine_glClearDepth
@ stdcall glClearDepth(
double
) wine_glClearDepth
@ stdcall glDepthFunc(long ) wine_glDepthFunc
@ stdcall glDepthMask(long ) wine_glDepthMask
@ stdcall glDepthRange(
long long
) wine_glDepthRange
@ stdcall glDepthRange(
double double
) wine_glDepthRange
@ stdcall glClearAccum(long long long long ) wine_glClearAccum
@ stdcall glAccum(long long ) wine_glAccum
@ stdcall glMatrixMode(long ) wine_glMatrixMode
...
...
dlls/opengl32/wgl.c
View file @
1113706c
...
...
@@ -5,11 +5,14 @@
#include <stdlib.h>
#include "wine/exception.h"
#include "config.h"
#include "debugtools.h"
#include "gdi.h"
#include "dc.h"
#include "windef.h"
#include "winerror.h"
#include "wine_gl.h"
#include "x11drv.h"
#include "x11font.h"
...
...
@@ -19,6 +22,17 @@
DEFAULT_DEBUG_CHANNEL
(
opengl
);
static
int
XGLErrorFlag
=
0
;
static
int
XGLErrorHandler
(
Display
*
dpy
,
XErrorEvent
*
event
)
{
XGLErrorFlag
=
1
;
return
0
;
}
/* filter for page-fault exceptions */
static
WINE_EXCEPTION_FILTER
(
page_fault
)
{
return
EXCEPTION_EXECUTE_HANDLER
;
}
/***********************************************************************
* wglCreateContext
*/
...
...
@@ -78,13 +92,36 @@ BOOL WINAPI wglCopyContext(HGLRC hglrcSrc,
* wglDeleteContext
*/
BOOL
WINAPI
wglDeleteContext
(
HGLRC
hglrc
)
{
int
(
*
WineXHandler
)(
Display
*
,
XErrorEvent
*
);
BOOL
ret
=
TRUE
;
TRACE
(
"(%p)
\n
"
,
hglrc
);
ENTER_GL
();
glXDestroyContext
(
display
,
(
GLXContext
)
hglrc
);
/* A game (Half Life not to name it) deletes twice the same context. To prevent
crashes, run with our own error function enabled */
XSync
(
display
,
False
);
XGLErrorFlag
=
0
;
WineXHandler
=
XSetErrorHandler
(
XGLErrorHandler
);
__TRY
{
glXDestroyContext
(
display
,
(
GLXContext
)
hglrc
);
XSync
(
display
,
False
);
XFlush
(
display
);
}
__EXCEPT
(
page_fault
)
{
XGLErrorFlag
=
1
;
}
__ENDTRY
XSetErrorHandler
(
WineXHandler
);
if
(
XGLErrorFlag
)
{
TRACE
(
"Error deleting context !
\n
"
);
SetLastError
(
ERROR_INVALID_HANDLE
);
ret
=
FALSE
;
}
LEAVE_GL
();
return
TRUE
;
return
ret
;
}
/***********************************************************************
...
...
@@ -220,25 +257,35 @@ void* WINAPI wglGetProcAddress(LPCSTR lpszProc) {
*/
BOOL
WINAPI
wglMakeCurrent
(
HDC
hdc
,
HGLRC
hglrc
)
{
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
X11DRV_PDEVICE
*
physDev
;
BOOL
ret
;
TRACE
(
"(%08x,%p)
\n
"
,
hdc
,
hglrc
);
if
(
dc
==
NULL
)
{
ERR
(
"Null DC !!!
\n
"
);
return
FALSE
;
}
physDev
=
(
X11DRV_PDEVICE
*
)
dc
->
physDev
;
ENTER_GL
();
ret
=
glXMakeCurrent
(
display
,
(
hglrc
==
NULL
?
None
:
physDev
->
drawable
),
(
GLXContext
)
hglrc
);
LEAVE_GL
();
if
(
hglrc
==
NULL
)
{
ENTER_GL
();
ret
=
glXMakeCurrent
(
display
,
None
,
NULL
);
LEAVE_GL
();
}
else
{
DC
*
dc
=
DC_GetDCPtr
(
hdc
);
if
(
dc
==
NULL
)
{
ERR
(
"Null DC !!!
\n
"
);
ret
=
FALSE
;
}
else
{
X11DRV_PDEVICE
*
physDev
;
physDev
=
(
X11DRV_PDEVICE
*
)
dc
->
physDev
;
ENTER_GL
();
ret
=
glXMakeCurrent
(
display
,
physDev
->
drawable
,
(
GLXContext
)
hglrc
);
LEAVE_GL
();
}
}
TRACE
(
"Returning %s
\n
"
,
(
ret
?
"True"
:
"False"
));
return
ret
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment