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
4a367c57
Commit
4a367c57
authored
Jun 27, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Export wglMakeCurrent and wglMakeContextCurrentARB as standard extension functions.
parent
bebf84f7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
86 deletions
+20
-86
gdi32.spec
dlls/gdi32/gdi32.spec
+1
-2
opengl.c
dlls/gdi32/opengl.c
+0
-70
wgl.c
dlls/opengl32/wgl.c
+8
-3
opengl.c
dlls/winex11.drv/opengl.c
+11
-11
No files found.
dlls/gdi32/gdi32.spec
View file @
4a367c57
...
...
@@ -499,9 +499,8 @@
################################################################
# Wine extensions: OpenGL support
#
@ stdcall wglCreateContext(long)
@ stdcall
-private
wglCreateContext(long)
@ stdcall -private wglGetProcAddress(str)
@ stdcall wglMakeCurrent(long long)
################################################################
# Wine extensions: Win16 functions that are needed by other dlls
...
...
dlls/gdi32/opengl.c
View file @
4a367c57
...
...
@@ -101,74 +101,6 @@ static HGLRC WINAPI wglCreateContextAttribsARB(HDC hdc, HGLRC hShareContext, con
return
ret
;
}
/***********************************************************************
* wglMakeCurrent (OPENGL32.@)
*/
BOOL
WINAPI
wglMakeCurrent
(
HDC
hdc
,
HGLRC
hglrc
)
{
BOOL
ret
=
FALSE
;
DC
*
dc
=
NULL
;
/* When the context hglrc is NULL, the HDC is ignored and can be NULL.
* In that case use the global hDC to get access to the driver. */
if
(
hglrc
==
NULL
)
{
if
(
hdc
==
NULL
&&
!
NtCurrentTeb
()
->
glContext
)
{
WARN
(
"Current context is NULL
\n
"
);
SetLastError
(
ERROR_INVALID_HANDLE
);
return
FALSE
;
}
dc
=
OPENGL_GetDefaultDC
();
}
else
dc
=
get_dc_ptr
(
hdc
);
TRACE
(
"hdc: (%p), hglrc: (%p)
\n
"
,
hdc
,
hglrc
);
if
(
dc
)
{
PHYSDEV
physdev
=
GET_DC_PHYSDEV
(
dc
,
pwglMakeCurrent
);
update_dc
(
dc
);
ret
=
physdev
->
funcs
->
pwglMakeCurrent
(
physdev
,
hglrc
);
release_dc_ptr
(
dc
);
}
return
ret
;
}
/***********************************************************************
* wglMakeContextCurrentARB
*/
static
BOOL
WINAPI
wglMakeContextCurrentARB
(
HDC
hDrawDC
,
HDC
hReadDC
,
HGLRC
hglrc
)
{
BOOL
ret
=
FALSE
;
PHYSDEV
draw_physdev
,
read_physdev
;
DC
*
DrawDC
;
DC
*
ReadDC
;
TRACE
(
"hDrawDC: (%p), hReadDC: (%p) hglrc: (%p)
\n
"
,
hDrawDC
,
hReadDC
,
hglrc
);
/* Both hDrawDC and hReadDC need to be valid */
DrawDC
=
get_dc_ptr
(
hDrawDC
);
if
(
!
DrawDC
)
return
FALSE
;
ReadDC
=
get_dc_ptr
(
hReadDC
);
if
(
!
ReadDC
)
{
release_dc_ptr
(
DrawDC
);
return
FALSE
;
}
update_dc
(
DrawDC
);
update_dc
(
ReadDC
);
draw_physdev
=
GET_DC_PHYSDEV
(
DrawDC
,
pwglMakeContextCurrentARB
);
read_physdev
=
GET_DC_PHYSDEV
(
ReadDC
,
pwglMakeContextCurrentARB
);
if
(
draw_physdev
->
funcs
==
read_physdev
->
funcs
)
ret
=
draw_physdev
->
funcs
->
pwglMakeContextCurrentARB
(
draw_physdev
,
read_physdev
,
hglrc
);
release_dc_ptr
(
DrawDC
);
release_dc_ptr
(
ReadDC
);
return
ret
;
}
/**************************************************************************************
* WINE-specific wglSetPixelFormat which can set the iPixelFormat multiple times
*
...
...
@@ -219,8 +151,6 @@ PROC WINAPI wglGetProcAddress(LPCSTR func)
*/
if
(
ret
&&
strcmp
(
func
,
"wglCreateContextAttribsARB"
)
==
0
)
return
(
PROC
)
wglCreateContextAttribsARB
;
else
if
(
ret
&&
strcmp
(
func
,
"wglMakeContextCurrentARB"
)
==
0
)
return
(
PROC
)
wglMakeContextCurrentARB
;
else
if
(
ret
&&
strcmp
(
func
,
"wglSetPixelFormatWINE"
)
==
0
)
return
(
PROC
)
wglSetPixelFormatWINE
;
...
...
dlls/opengl32/wgl.c
View file @
4a367c57
...
...
@@ -48,7 +48,6 @@ WINE_DECLARE_DEBUG_CHANNEL(opengl);
static
struct
{
PROC
(
WINAPI
*
p_wglGetProcAddress
)(
LPCSTR
lpszProc
);
BOOL
(
WINAPI
*
p_wglMakeCurrent
)(
HDC
hdc
,
HGLRC
hglrc
);
HGLRC
(
WINAPI
*
p_wglCreateContext
)(
HDC
hdc
);
INT
(
WINAPI
*
p_GetPixelFormat
)(
HDC
hdc
);
...
...
@@ -60,6 +59,7 @@ static struct
HGLRC
(
WINAPI
*
p_wglGetCurrentContext
)(
void
);
HDC
(
WINAPI
*
p_wglGetCurrentDC
)(
void
);
void
(
WINAPI
*
p_wglGetIntegerv
)(
GLenum
pname
,
GLint
*
params
);
BOOL
(
WINAPI
*
p_wglMakeCurrent
)(
HDC
hdc
,
HGLRC
hglrc
);
BOOL
(
WINAPI
*
p_wglShareLists
)(
HGLRC
hglrc1
,
HGLRC
hglrc2
);
}
wine_wgl
;
...
...
@@ -126,7 +126,12 @@ BOOL WINAPI wglDeleteContext(HGLRC hglrc)
*/
BOOL
WINAPI
wglMakeCurrent
(
HDC
hdc
,
HGLRC
hglrc
)
{
return
wine_wgl
.
p_wglMakeCurrent
(
hdc
,
hglrc
);
if
(
!
hglrc
&&
!
hdc
&&
!
NtCurrentTeb
()
->
glContext
)
{
SetLastError
(
ERROR_INVALID_HANDLE
);
return
FALSE
;
}
return
wine_wgl
.
p_wglMakeCurrent
(
hdc
,
hglrc
);
}
/***********************************************************************
...
...
@@ -1090,7 +1095,6 @@ static BOOL process_attach(void)
}
wine_wgl
.
p_wglGetProcAddress
=
(
void
*
)
GetProcAddress
(
mod_gdi32
,
"wglGetProcAddress"
);
wine_wgl
.
p_wglMakeCurrent
=
(
void
*
)
GetProcAddress
(
mod_gdi32
,
"wglMakeCurrent"
);
wine_wgl
.
p_wglCreateContext
=
(
void
*
)
GetProcAddress
(
mod_gdi32
,
"wglCreateContext"
);
wine_wgl
.
p_GetPixelFormat
=
(
void
*
)
GetProcAddress
(
mod_gdi32
,
"GetPixelFormat"
);
...
...
@@ -1102,6 +1106,7 @@ static BOOL process_attach(void)
wine_wgl
.
p_wglGetCurrentContext
=
(
void
*
)
wine_wgl
.
p_wglGetProcAddress
(
"wglGetCurrentContext"
);
wine_wgl
.
p_wglGetCurrentDC
=
(
void
*
)
wine_wgl
.
p_wglGetProcAddress
(
"wglGetCurrentDC"
);
wine_wgl
.
p_wglGetIntegerv
=
(
void
*
)
wine_wgl
.
p_wglGetProcAddress
(
"wglGetIntegerv"
);
wine_wgl
.
p_wglMakeCurrent
=
(
void
*
)
wine_wgl
.
p_wglGetProcAddress
(
"wglMakeCurrent"
);
wine_wgl
.
p_wglShareLists
=
(
void
*
)
wine_wgl
.
p_wglGetProcAddress
(
"wglShareLists"
);
return
TRUE
;
}
...
...
dlls/winex11.drv/opengl.c
View file @
4a367c57
...
...
@@ -1469,6 +1469,8 @@ static HGLRC glxdrv_wglCreateContext(PHYSDEV dev)
return
(
HGLRC
)
ret
;
}
static
BOOL
WINAPI
X11DRV_wglMakeCurrent
(
HDC
hdc
,
HGLRC
hglrc
);
/**
* X11DRV_wglDeleteContext
*
...
...
@@ -1497,7 +1499,7 @@ static BOOL WINAPI X11DRV_wglDeleteContext(HGLRC hglrc)
/* WGL makes a context not current if it is active before deletion. GLX waits until the context is not current. */
if
(
ctx
==
NtCurrentTeb
()
->
glContext
)
wglMakeCurrent
(
ctx
->
hdc
,
NULL
);
X11DRV_
wglMakeCurrent
(
ctx
->
hdc
,
NULL
);
wine_tsx11_lock
();
list_remove
(
&
ctx
->
entry
);
...
...
@@ -1584,13 +1586,12 @@ static GLXPixmap get_context_pixmap( HDC hdc, struct wine_glcontext *ctx )
}
/**
*
glxdrv
_wglMakeCurrent
*
X11DRV
_wglMakeCurrent
*
* For OpenGL32 wglMakeCurrent.
*/
static
BOOL
glxdrv_wglMakeCurrent
(
PHYSDEV
dev
,
HGLRC
hglrc
)
static
BOOL
WINAPI
X11DRV_wglMakeCurrent
(
HDC
hdc
,
HGLRC
hglrc
)
{
HDC
hdc
=
dev
->
hdc
;
BOOL
ret
;
Wine_GLContext
*
prev_ctx
=
NtCurrentTeb
()
->
glContext
;
Wine_GLContext
*
ctx
=
(
Wine_GLContext
*
)
hglrc
;
...
...
@@ -1667,14 +1668,12 @@ static BOOL glxdrv_wglMakeCurrent(PHYSDEV dev, HGLRC hglrc)
}
/**
*
glxdrv
_wglMakeContextCurrentARB
*
X11DRV
_wglMakeContextCurrentARB
*
* For OpenGL32 wglMakeContextCurrentARB
*/
static
BOOL
glxdrv_wglMakeContextCurrentARB
(
PHYSDEV
draw_dev
,
PHYSDEV
read_dev
,
HGLRC
hglrc
)
static
BOOL
WINAPI
X11DRV_wglMakeContextCurrentARB
(
HDC
draw_hdc
,
HDC
read_hdc
,
HGLRC
hglrc
)
{
HDC
draw_hdc
=
draw_dev
->
hdc
;
HDC
read_hdc
=
read_dev
->
hdc
;
Wine_GLContext
*
ctx
=
(
Wine_GLContext
*
)
hglrc
;
Wine_GLContext
*
prev_ctx
=
NtCurrentTeb
()
->
glContext
;
struct
x11drv_escape_get_drawable
escape_draw
,
escape_read
;
...
...
@@ -3070,6 +3069,7 @@ static const WineGLExtension WGL_internal_functions =
{
"wglGetCurrentContext"
,
X11DRV_wglGetCurrentContext
},
{
"wglGetCurrentDC"
,
X11DRV_wglGetCurrentDC
},
{
"wglGetIntegerv"
,
X11DRV_wglGetIntegerv
},
{
"wglMakeCurrent"
,
X11DRV_wglMakeCurrent
},
{
"wglShareLists"
,
X11DRV_wglShareLists
},
}
};
...
...
@@ -3096,7 +3096,7 @@ static const WineGLExtension WGL_ARB_make_current_read =
"WGL_ARB_make_current_read"
,
{
{
"wglGetCurrentReadDCARB"
,
X11DRV_wglGetCurrentReadDCARB
},
{
"wglMakeContextCurrentARB"
,
(
void
*
)
1
/* not called directly */
},
{
"wglMakeContextCurrentARB"
,
X11DRV_wglMakeContextCurrentARB
},
}
};
...
...
@@ -3584,8 +3584,8 @@ static const struct gdi_dc_funcs glxdrv_funcs =
glxdrv_wglCreateContext
,
/* pwglCreateContext */
glxdrv_wglCreateContextAttribsARB
,
/* pwglCreateContextAttribsARB */
glxdrv_wglGetProcAddress
,
/* pwglGetProcAddress */
glxdrv_wglMakeContextCurrentARB
,
/* pwglMakeContextCurrentARB */
glxdrv_wglMakeCurrent
,
/* pwglMakeCurrent */
NULL
,
/* pwglMakeContextCurrentARB */
NULL
,
/* pwglMakeCurrent */
glxdrv_wglSetPixelFormatWINE
,
/* pwglSetPixelFormatWINE */
GDI_PRIORITY_GRAPHICS_DRV
+
20
/* priority */
};
...
...
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