Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add idtech5 patch, remove deprecated warframe patch
- Loading branch information
1 parent
82ac752
commit e09b7a5
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c | ||
index b73920cb25..7140dfa3ca 100644 | ||
--- a/dlls/opengl32/wgl.c | ||
+++ b/dlls/opengl32/wgl.c | ||
@@ -250,6 +250,31 @@ BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc) | ||
return ret; | ||
} | ||
|
||
+static | ||
+const int* remove_profile_mask(const int *attribs) | ||
+{ | ||
+ int* ret = NULL; | ||
+ int i = 0; | ||
+ int j = 0; | ||
+ int attr_num = 0; | ||
+ int profile_mask = 0; | ||
+ for (i = 0; attribs[i] != NULL; i += 2) { | ||
+ if (attribs[i] == WGL_CONTEXT_PROFILE_MASK_ARB) | ||
+ profile_mask = 1; | ||
+ ++attr_num; | ||
+ } | ||
+ if (profile_mask == 0) return attribs; | ||
+ ret = calloc(attr_num*2 - 1, sizeof(int)); | ||
+ for (i = 0; attribs[i] != NULL; i += 2) { | ||
+ if (attribs[i] != WGL_CONTEXT_PROFILE_MASK_ARB) { | ||
+ ret[j] = attribs[i]; | ||
+ ret[j+1] = attribs[i+1]; | ||
+ j += 2; | ||
+ } | ||
+ } | ||
+ return ret; | ||
+} | ||
+ | ||
/*********************************************************************** | ||
* wglCreateContextAttribsARB | ||
* | ||
@@ -262,6 +287,7 @@ HGLRC WINAPI wglCreateContextAttribsARB( HDC hdc, HGLRC share, const int *attrib | ||
struct wgl_handle *share_ptr = NULL; | ||
struct opengl_context *context; | ||
struct opengl_funcs *funcs = get_dc_funcs( hdc ); | ||
+ attribs = remove_profile_mask(attribs); | ||
|
||
if (!funcs) | ||
{ |