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
06be26da
Commit
06be26da
authored
Aug 13, 2023
by
Zebediah Figura
Committed by
Alexandre Julliard
Aug 14, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opengl32: Preserve the remainder of the version string when limiting the version to 4.3.
parent
efbf28af
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
3 deletions
+20
-3
unix_wgl.c
dlls/opengl32/unix_wgl.c
+20
-3
No files found.
dlls/opengl32/unix_wgl.c
View file @
06be26da
...
...
@@ -71,6 +71,7 @@ struct opengl_context
GLubyte
*
extensions
;
/* extension string */
GLuint
*
disabled_exts
;
/* indices of disabled extensions */
struct
wgl_context
*
drv_ctx
;
/* driver context */
GLubyte
*
version_string
;
};
struct
wgl_handle
...
...
@@ -412,7 +413,7 @@ static BOOL check_extension_support( TEB *teb, const char *extension, const char
return
FALSE
;
}
static
void
parse_gl_version
(
const
char
*
gl_version
,
int
*
major
,
int
*
minor
)
static
const
char
*
parse_gl_version
(
const
char
*
gl_version
,
int
*
major
,
int
*
minor
)
{
const
char
*
ptr
=
gl_version
;
...
...
@@ -425,6 +426,9 @@ static void parse_gl_version( const char *gl_version, int *major, int *minor )
ERR
(
"Invalid OpenGL version string %s.
\n
"
,
debugstr_a
(
gl_version
)
);
*
minor
=
atoi
(
ptr
);
while
(
isdigit
(
*
ptr
))
++
ptr
;
return
ptr
;
}
static
void
wrap_glGetIntegerv
(
TEB
*
teb
,
GLenum
pname
,
GLint
*
data
)
...
...
@@ -469,13 +473,25 @@ static const GLubyte *wrap_glGetString( TEB *teb, GLenum name )
}
else
if
(
name
==
GL_VERSION
&&
is_win64
&&
is_wow64
())
{
struct
wgl_handle
*
ptr
=
get_current_context_ptr
(
teb
);
int
major
,
minor
;
const
char
*
rest
;
parse_gl_version
(
(
const
char
*
)
ret
,
&
major
,
&
minor
);
if
(
ptr
->
u
.
context
->
version_string
)
return
ptr
->
u
.
context
->
version_string
;
rest
=
parse_gl_version
(
(
const
char
*
)
ret
,
&
major
,
&
minor
);
/* 4.4 depends on ARB_buffer_storage, which we don't support on wow64. */
if
(
major
>
4
||
(
major
==
4
&&
minor
>=
4
))
return
(
const
GLubyte
*
)
"4.3"
;
{
char
*
str
=
malloc
(
3
+
strlen
(
rest
)
+
1
);
sprintf
(
str
,
"4.3%s"
,
rest
);
if
(
InterlockedCompareExchangePointer
(
(
void
**
)
&
ptr
->
u
.
context
->
version_string
,
str
,
NULL
))
free
(
str
);
return
ptr
->
u
.
context
->
version_string
;
}
}
}
...
...
@@ -700,6 +716,7 @@ static BOOL wrap_wglDeleteContext( TEB *teb, HGLRC hglrc )
}
if
(
hglrc
==
teb
->
glCurrentRC
)
wrap_wglMakeCurrent
(
teb
,
0
,
0
);
ptr
->
funcs
->
wgl
.
p_wglDeleteContext
(
ptr
->
u
.
context
->
drv_ctx
);
free
(
ptr
->
u
.
context
->
version_string
);
free
(
ptr
->
u
.
context
->
disabled_exts
);
free
(
ptr
->
u
.
context
->
extensions
);
free
(
ptr
->
u
.
context
);
...
...
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