Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
4a367c57
Commit
4a367c57
authored
12 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
winex11: Export wglMakeCurrent and wglMakeContextCurrentARB as standard extension functions.
parent
bebf84f7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
dlls/gdi32/gdi32.spec
+1
-2
1 addition, 2 deletions
dlls/gdi32/gdi32.spec
dlls/gdi32/opengl.c
+0
-70
0 additions, 70 deletions
dlls/gdi32/opengl.c
dlls/opengl32/wgl.c
+8
-3
8 additions, 3 deletions
dlls/opengl32/wgl.c
dlls/winex11.drv/opengl.c
+11
-11
11 additions, 11 deletions
dlls/winex11.drv/opengl.c
with
20 additions
and
86 deletions
dlls/gdi32/gdi32.spec
+
1
−
2
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
...
...
This diff is collapsed.
Click to expand it.
dlls/gdi32/opengl.c
+
0
−
70
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
;
...
...
This diff is collapsed.
Click to expand it.
dlls/opengl32/wgl.c
+
8
−
3
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
;
}
...
...
This diff is collapsed.
Click to expand it.
dlls/winex11.drv/opengl.c
+
11
−
11
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 */
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment