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
5115f55e
Commit
5115f55e
authored
Apr 19, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 19, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Use WGL_ARB_create_context when available.
parent
147765a5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
10 deletions
+51
-10
context.c
dlls/wined3d/context.c
+19
-10
directx.c
dlls/wined3d/directx.c
+31
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/context.c
View file @
5115f55e
...
...
@@ -1266,11 +1266,11 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
const
struct
wined3d_format
*
color_format
;
struct
wined3d_context
*
ret
;
BOOL
auxBuffers
=
FALSE
;
HGLRC
ctx
,
share_ctx
;
int
pixel_format
;
unsigned
int
s
;
int
swap_interval
;
DWORD
state
;
HGLRC
ctx
;
HDC
hdc
;
TRACE
(
"swapchain %p, target %p, window %p.
\n
"
,
swapchain
,
target
,
swapchain
->
win_handle
);
...
...
@@ -1367,19 +1367,28 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
goto
out
;
}
if
(
!
(
ctx
=
wglCreateContext
(
hdc
)))
share_ctx
=
device
->
context_count
?
device
->
contexts
[
0
]
->
glCtx
:
NULL
;
if
(
gl_info
->
p_wglCreateContextAttribsARB
)
{
ERR
(
"Failed to create a WGL context.
\n
"
);
context_release
(
ret
);
goto
out
;
if
(
!
(
ctx
=
gl_info
->
p_wglCreateContextAttribsARB
(
hdc
,
share_ctx
,
NULL
)))
{
ERR
(
"Failed to create a WGL context.
\n
"
);
context_release
(
ret
);
goto
out
;
}
}
if
(
device
->
context_count
)
else
{
if
(
!
wglShareLists
(
device
->
contexts
[
0
]
->
glCtx
,
ctx
))
if
(
!
(
ctx
=
wglCreateContext
(
hdc
)))
{
ERR
(
"Failed to create a WGL context.
\n
"
);
context_release
(
ret
);
goto
out
;
}
if
(
share_ctx
&&
!
wglShareLists
(
share_ctx
,
ctx
))
{
ERR
(
"wglShareLists(%p, %p) failed, last error %#x.
\n
"
,
device
->
contexts
[
0
]
->
glCtx
,
ctx
,
GetLastError
());
ERR
(
"wglShareLists(%p, %p) failed, last error %#x.
\n
"
,
share_ctx
,
ctx
,
GetLastError
());
context_release
(
ret
);
if
(
!
wglDeleteContext
(
ctx
))
ERR
(
"wglDeleteContext(%p) failed, last error %#x.
\n
"
,
ctx
,
GetLastError
());
...
...
dlls/wined3d/directx.c
View file @
5115f55e
...
...
@@ -296,6 +296,35 @@ static void WineD3D_ReleaseFakeGLContext(const struct wined3d_fake_gl_ctx *ctx)
ERR
(
"Failed to restore previous GL context.
\n
"
);
}
static
void
wined3d_create_fake_gl_context_attribs
(
struct
wined3d_fake_gl_ctx
*
fake_gl_ctx
,
struct
wined3d_gl_info
*
gl_info
)
{
HGLRC
new_ctx
;
if
(
!
(
gl_info
->
p_wglCreateContextAttribsARB
=
(
void
*
)
wglGetProcAddress
(
"wglCreateContextAttribsARB"
)))
return
;
if
(
!
(
new_ctx
=
gl_info
->
p_wglCreateContextAttribsARB
(
fake_gl_ctx
->
dc
,
NULL
,
NULL
)))
{
ERR
(
"Failed to create a context using wglCreateContextAttribsARB(), last error %#x.
\n
"
,
GetLastError
());
gl_info
->
p_wglCreateContextAttribsARB
=
NULL
;
return
;
}
if
(
!
wglMakeCurrent
(
fake_gl_ctx
->
dc
,
new_ctx
))
{
ERR
(
"Failed to make new context current, last error %#x.
\n
"
,
GetLastError
());
if
(
!
wglDeleteContext
(
new_ctx
))
ERR
(
"Failed to delete new context, last error %#x.
\n
"
,
GetLastError
());
gl_info
->
p_wglCreateContextAttribsARB
=
NULL
;
return
;
}
if
(
!
wglDeleteContext
(
fake_gl_ctx
->
gl_ctx
))
ERR
(
"Failed to delete old context, last error %#x.
\n
"
,
GetLastError
());
fake_gl_ctx
->
gl_ctx
=
new_ctx
;
}
/* Do not call while under the GL lock. */
static
BOOL
WineD3D_CreateFakeGLContext
(
struct
wined3d_fake_gl_ctx
*
ctx
)
{
...
...
@@ -4919,6 +4948,8 @@ static BOOL wined3d_adapter_init(struct wined3d_adapter *adapter, UINT ordinal)
return
FALSE
;
}
wined3d_create_fake_gl_context_attribs
(
&
fake_gl_ctx
,
gl_info
);
if
(
!
wined3d_adapter_init_gl_caps
(
adapter
))
{
ERR
(
"Failed to initialize GL caps for adapter %p.
\n
"
,
adapter
);
...
...
dlls/wined3d/wined3d_private.h
View file @
5115f55e
...
...
@@ -1552,6 +1552,7 @@ struct wined3d_gl_info
BOOL
supported
[
WINED3D_GL_EXT_COUNT
];
GLint
wrap_lookup
[
WINED3D_TADDRESS_MIRROR_ONCE
-
WINED3D_TADDRESS_WRAP
+
1
];
HGLRC
(
WINAPI
*
p_wglCreateContextAttribsARB
)(
HDC
dc
,
HGLRC
share
,
const
GLint
*
attribs
);
struct
opengl_funcs
gl_ops
;
struct
wined3d_fbo_ops
fbo_ops
;
...
...
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