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
bbdf77a3
Commit
bbdf77a3
authored
Jun 28, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opengl32: Move wglCreateContext to the WGL driver.
parent
3bcb8057
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
37 deletions
+17
-37
gdi32.spec
dlls/gdi32/gdi32.spec
+0
-1
opengl.c
dlls/gdi32/opengl.c
+0
-20
wgl.c
dlls/opengl32/wgl.c
+1
-3
opengl.c
dlls/winex11.drv/opengl.c
+14
-12
gdi_driver.h
include/wine/gdi_driver.h
+2
-1
No files found.
dlls/gdi32/gdi32.spec
View file @
bbdf77a3
...
@@ -499,7 +499,6 @@
...
@@ -499,7 +499,6 @@
################################################################
################################################################
# Wine extensions: OpenGL support
# Wine extensions: OpenGL support
#
#
@ stdcall -private wglCreateContext(long)
@ stdcall -private wglGetProcAddress(str)
@ stdcall -private wglGetProcAddress(str)
################################################################
################################################################
...
...
dlls/gdi32/opengl.c
View file @
bbdf77a3
...
@@ -62,26 +62,6 @@ static DC* OPENGL_GetDefaultDC(void)
...
@@ -62,26 +62,6 @@ static DC* OPENGL_GetDefaultDC(void)
}
}
/***********************************************************************
/***********************************************************************
* wglCreateContext (OPENGL32.@)
*/
HGLRC
WINAPI
wglCreateContext
(
HDC
hdc
)
{
HGLRC
ret
=
0
;
DC
*
dc
=
get_dc_ptr
(
hdc
);
TRACE
(
"(%p)
\n
"
,
hdc
);
if
(
dc
)
{
PHYSDEV
physdev
=
GET_DC_PHYSDEV
(
dc
,
pwglCreateContext
);
update_dc
(
dc
);
ret
=
physdev
->
funcs
->
pwglCreateContext
(
physdev
);
release_dc_ptr
(
dc
);
}
return
ret
;
}
/***********************************************************************
* Internal wglGetProcAddress for retrieving WGL extensions
* Internal wglGetProcAddress for retrieving WGL extensions
*/
*/
PROC
WINAPI
wglGetProcAddress
(
LPCSTR
func
)
PROC
WINAPI
wglGetProcAddress
(
LPCSTR
func
)
...
...
dlls/opengl32/wgl.c
View file @
bbdf77a3
...
@@ -49,7 +49,6 @@ WINE_DECLARE_DEBUG_CHANNEL(opengl);
...
@@ -49,7 +49,6 @@ WINE_DECLARE_DEBUG_CHANNEL(opengl);
static
struct
static
struct
{
{
PROC
(
WINAPI
*
p_wglGetProcAddress
)(
LPCSTR
lpszProc
);
PROC
(
WINAPI
*
p_wglGetProcAddress
)(
LPCSTR
lpszProc
);
HGLRC
(
WINAPI
*
p_wglCreateContext
)(
HDC
hdc
);
INT
(
WINAPI
*
p_GetPixelFormat
)(
HDC
hdc
);
INT
(
WINAPI
*
p_GetPixelFormat
)(
HDC
hdc
);
/* internal WGL functions */
/* internal WGL functions */
...
@@ -174,7 +173,7 @@ HDC WINAPI wglGetCurrentDC(void)
...
@@ -174,7 +173,7 @@ HDC WINAPI wglGetCurrentDC(void)
*/
*/
HGLRC
WINAPI
wglCreateContext
(
HDC
hdc
)
HGLRC
WINAPI
wglCreateContext
(
HDC
hdc
)
{
{
return
wine_wgl
.
p_wglCreateContext
(
hdc
);
return
wgl_driver
->
p_wglCreateContext
(
hdc
);
}
}
/***********************************************************************
/***********************************************************************
...
@@ -1130,7 +1129,6 @@ static BOOL process_attach(void)
...
@@ -1130,7 +1129,6 @@ static BOOL process_attach(void)
}
}
wine_wgl
.
p_wglGetProcAddress
=
(
void
*
)
GetProcAddress
(
mod_gdi32
,
"wglGetProcAddress"
);
wine_wgl
.
p_wglGetProcAddress
=
(
void
*
)
GetProcAddress
(
mod_gdi32
,
"wglGetProcAddress"
);
wine_wgl
.
p_wglCreateContext
=
(
void
*
)
GetProcAddress
(
mod_gdi32
,
"wglCreateContext"
);
wine_wgl
.
p_GetPixelFormat
=
(
void
*
)
GetProcAddress
(
mod_gdi32
,
"GetPixelFormat"
);
wine_wgl
.
p_GetPixelFormat
=
(
void
*
)
GetProcAddress
(
mod_gdi32
,
"GetPixelFormat"
);
/* internal WGL functions */
/* internal WGL functions */
...
...
dlls/winex11.drv/opengl.c
View file @
bbdf77a3
...
@@ -1413,36 +1413,37 @@ static BOOL glxdrv_wglCopyContext(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask)
...
@@ -1413,36 +1413,37 @@ static BOOL glxdrv_wglCopyContext(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask)
return
TRUE
;
return
TRUE
;
}
}
/**
/***********************************************************************
* X11DRV_wglCreateContext
* glxdrv_wglCreateContext
*
* For OpenGL32 wglCreateContext.
*/
*/
static
HGLRC
glxdrv_wglCreateContext
(
PHYSDEV
dev
)
static
HGLRC
glxdrv_wglCreateContext
(
HDC
hdc
)
{
{
struct
glx_physdev
*
physdev
=
get_glxdrv_dev
(
dev
)
;
struct
x11drv_escape_get_drawable
escape
;
Wine_GLContext
*
ret
;
Wine_GLContext
*
ret
;
WineGLPixelFormat
*
fmt
;
WineGLPixelFormat
*
fmt
;
int
fmt_count
=
0
;
int
fmt_count
=
0
;
TRACE
(
"(%p)->(PF:%d)
\n
"
,
dev
->
hdc
,
physdev
->
pixel_format
);
TRACE
(
"(%p)
\n
"
,
hdc
);
if
(
!
has_opengl
())
return
0
;
escape
.
code
=
X11DRV_GET_DRAWABLE
;
if
(
!
ExtEscape
(
hdc
,
X11DRV_ESCAPE
,
sizeof
(
escape
.
code
),
(
LPCSTR
)
&
escape
.
code
,
sizeof
(
escape
),
(
LPSTR
)
&
escape
))
return
0
;
fmt
=
ConvertPixelFormatWGLtoGLX
(
gdi_display
,
physdev
->
pixel_format
,
TRUE
/* Offscreen */
,
&
fmt_count
);
fmt
=
ConvertPixelFormatWGLtoGLX
(
gdi_display
,
escape
.
pixel_format
,
TRUE
/* Offscreen */
,
&
fmt_count
);
/* We can render using the iPixelFormat (1) of Wine's Main visual AND using some offscreen formats.
/* We can render using the iPixelFormat (1) of Wine's Main visual AND using some offscreen formats.
* Note that standard WGL-calls don't recognize offscreen-only formats. For that reason pbuffers
* Note that standard WGL-calls don't recognize offscreen-only formats. For that reason pbuffers
* use a sort of 'proxy' HDC (wglGetPbufferDCARB).
* use a sort of 'proxy' HDC (wglGetPbufferDCARB).
* If this fails something is very wrong on the system. */
* If this fails something is very wrong on the system. */
if
(
!
fmt
)
{
if
(
!
fmt
)
{
ERR
(
"Cannot get FB Config for iPixelFormat %d, expect problems!
\n
"
,
physdev
->
pixel_format
);
ERR
(
"Cannot get FB Config for iPixelFormat %d, expect problems!
\n
"
,
escape
.
pixel_format
);
SetLastError
(
ERROR_INVALID_PIXEL_FORMAT
);
SetLastError
(
ERROR_INVALID_PIXEL_FORMAT
);
return
NULL
;
return
NULL
;
}
}
if
(
!
(
ret
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
ret
))))
return
0
;
if
(
!
(
ret
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
ret
))))
return
0
;
ret
->
hdc
=
dev
->
hdc
;
ret
->
hdc
=
hdc
;
ret
->
fmt
=
fmt
;
ret
->
fmt
=
fmt
;
ret
->
has_been_current
=
FALSE
;
ret
->
has_been_current
=
FALSE
;
ret
->
sharing
=
FALSE
;
ret
->
sharing
=
FALSE
;
...
@@ -3591,7 +3592,7 @@ static const struct gdi_dc_funcs glxdrv_funcs =
...
@@ -3591,7 +3592,7 @@ static const struct gdi_dc_funcs glxdrv_funcs =
glxdrv_SwapBuffers
,
/* pSwapBuffers */
glxdrv_SwapBuffers
,
/* pSwapBuffers */
NULL
,
/* pUnrealizePalette */
NULL
,
/* pUnrealizePalette */
NULL
,
/* pWidenPath */
NULL
,
/* pWidenPath */
glxdrv_wglCreateContext
,
/* pwglCreateContext */
NULL
,
/* pwglCreateContext */
NULL
,
/* pwglCreateContextAttribsARB */
NULL
,
/* pwglCreateContextAttribsARB */
glxdrv_wglGetProcAddress
,
/* pwglGetProcAddress */
glxdrv_wglGetProcAddress
,
/* pwglGetProcAddress */
glxdrv_wine_get_wgl_driver
,
/* wine_get_wgl_driver */
glxdrv_wine_get_wgl_driver
,
/* wine_get_wgl_driver */
...
@@ -3601,6 +3602,7 @@ static const struct gdi_dc_funcs glxdrv_funcs =
...
@@ -3601,6 +3602,7 @@ static const struct gdi_dc_funcs glxdrv_funcs =
static
const
struct
wgl_funcs
glxdrv_wgl_funcs
=
static
const
struct
wgl_funcs
glxdrv_wgl_funcs
=
{
{
glxdrv_wglCopyContext
,
/* p_wglCopyContext */
glxdrv_wglCopyContext
,
/* p_wglCopyContext */
glxdrv_wglCreateContext
,
/* p_wglCreateContext */
glxdrv_wglCreateContextAttribsARB
,
/* p_wglCreateContextAttribsARB */
glxdrv_wglCreateContextAttribsARB
,
/* p_wglCreateContextAttribsARB */
glxdrv_wglDeleteContext
,
/* p_wglDeleteContext */
glxdrv_wglDeleteContext
,
/* p_wglDeleteContext */
glxdrv_wglGetCurrentDC
,
/* p_wglGetCurrentDC */
glxdrv_wglGetCurrentDC
,
/* p_wglGetCurrentDC */
...
...
include/wine/gdi_driver.h
View file @
bbdf77a3
...
@@ -203,7 +203,7 @@ struct gdi_dc_funcs
...
@@ -203,7 +203,7 @@ struct gdi_dc_funcs
};
};
/* increment this when you change the DC function table */
/* increment this when you change the DC function table */
#define WINE_GDI_DRIVER_VERSION 3
5
#define WINE_GDI_DRIVER_VERSION 3
6
#define GDI_PRIORITY_NULL_DRV 0
/* null driver */
#define GDI_PRIORITY_NULL_DRV 0
/* null driver */
#define GDI_PRIORITY_FONT_DRV 100
/* any font driver */
#define GDI_PRIORITY_FONT_DRV 100
/* any font driver */
...
@@ -234,6 +234,7 @@ static inline void push_dc_driver( PHYSDEV *dev, PHYSDEV physdev, const struct g
...
@@ -234,6 +234,7 @@ static inline void push_dc_driver( PHYSDEV *dev, PHYSDEV physdev, const struct g
struct
wgl_funcs
struct
wgl_funcs
{
{
BOOL
(
*
p_wglCopyContext
)(
HGLRC
,
HGLRC
,
UINT
);
BOOL
(
*
p_wglCopyContext
)(
HGLRC
,
HGLRC
,
UINT
);
HGLRC
(
*
p_wglCreateContext
)(
HDC
);
HGLRC
(
*
p_wglCreateContextAttribsARB
)(
HDC
,
HGLRC
,
const
int
*
);
HGLRC
(
*
p_wglCreateContextAttribsARB
)(
HDC
,
HGLRC
,
const
int
*
);
BOOL
(
*
p_wglDeleteContext
)(
HGLRC
);
BOOL
(
*
p_wglDeleteContext
)(
HGLRC
);
HDC
(
*
p_wglGetCurrentDC
)(
void
);
HDC
(
*
p_wglGetCurrentDC
)(
void
);
...
...
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