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
edb0044e
Commit
edb0044e
authored
Jul 16, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opengl32: Generate a function table with null OpenGL entry points and store it in the TEB.
parent
bddea5b5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
0 deletions
+52
-0
make_opengl
dlls/opengl32/make_opengl
+43
-0
opengl_norm.c
dlls/opengl32/opengl_norm.c
+0
-0
wgl.c
dlls/opengl32/wgl.c
+9
-0
No files found.
dlls/opengl32/make_opengl
View file @
edb0044e
...
...
@@ -319,6 +319,35 @@ sub GenerateThunk($$$$$)
return
$ret
;
}
sub
generate_null_func
($)
{
my
(
$func_ref
)
=
@_
;
my
$ret
;
return
""
if
$func_ref
->
[
0
]
eq
"glDebugEntry"
;
$ret
=
"static "
.
ConvertType
(
$func_ref
->
[
1
])
.
" null_$func_ref->[0]( "
;
for
(
my
$i
=
0
;
$i
<
@
{
$func_ref
->
[
2
]};
$i
++
)
{
my
$type
=
$func_ref
->
[
2
]
->
[
$i
]
->
[
0
];
my
$name
=
ConvertVarName
(
$func_ref
->
[
2
]
->
[
$i
]
->
[
1
]);
$ret
.=
ConvertType
(
$type
)
.
" $name"
;
$ret
.=
","
if
(
$i
+
1
<
@
{
$func_ref
->
[
2
]});
$ret
.=
" "
;
}
$ret
.=
'void '
if
(
!
@
{
$func_ref
->
[
2
]});
$ret
.=
") {"
;
if
(
$func_ref
->
[
0
]
eq
"glGetError"
)
{
$ret
.=
" return GL_INVALID_OPERATION;"
;
}
elsif
(
$func_ref
->
[
1
]
ne
"void"
)
{
$ret
.=
" return 0;"
;
}
$ret
.=
" }\n"
;
return
$ret
;
}
sub
get_func_proto
($)
{
my
$func
=
shift
;
...
...
@@ -769,7 +798,10 @@ print NORM "
/* Auto-generated file... Do not edit ! */
#include \"config.h\"
#include <stdarg.h>
#include \"opengl_ext.h\"
#include \"winternl.h\"
#include \"wine/wgl_driver.h\"
#include \"wine/debug.h\"
WINE_DEFAULT_DEBUG_CHANNEL(opengl);
...
...
@@ -779,6 +811,17 @@ foreach (sort keys %norm_functions) {
print
NORM
"\n$string"
if
$string
;
}
print
NORM
"\n"
;
foreach
(
sort
keys
%
norm_functions
)
{
print
NORM
generate_null_func
(
$norm_functions
{
$_
});
}
print
NORM
"\n#define USE_GL_FUNC(name) null_##name,\n"
;
print
NORM
"struct opengl_funcs null_opengl_funcs = { { ALL_WGL_FUNCS } };\n"
;
print
NORM
"#undef USE_GL_FUNC\n"
;
close
(
NORM
);
#
...
...
dlls/opengl32/opengl_norm.c
View file @
edb0044e
This diff is collapsed.
Click to expand it.
dlls/opengl32/wgl.c
View file @
edb0044e
...
...
@@ -40,6 +40,7 @@
#include <GL/glu.h>
#endif
#include "wine/gdi_driver.h"
#include "wine/wgl_driver.h"
#include "wine/library.h"
#include "wine/debug.h"
...
...
@@ -70,6 +71,8 @@ MAKE_FUNCPTR(gluTessVertex)
static
HMODULE
opengl32_handle
;
static
void
*
libglu_handle
=
NULL
;
extern
struct
opengl_funcs
null_opengl_funcs
;
const
GLubyte
*
WINAPI
wine_glGetString
(
GLenum
name
);
/* internal GDI functions */
...
...
@@ -253,6 +256,7 @@ BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc)
if
(
!
prev
->
funcs
->
p_wglMakeCurrent
(
0
,
NULL
))
return
FALSE
;
prev
->
tid
=
0
;
NtCurrentTeb
()
->
glCurrentRC
=
0
;
NtCurrentTeb
()
->
glTable
=
&
null_opengl_funcs
;
}
else
if
(
!
hdc
)
{
...
...
@@ -318,6 +322,7 @@ static BOOL WINAPI wglMakeContextCurrentARB( HDC draw_hdc, HDC read_hdc, HGLRC h
if
(
!
prev
->
funcs
->
p_wglMakeCurrent
(
0
,
NULL
))
return
FALSE
;
prev
->
tid
=
0
;
NtCurrentTeb
()
->
glCurrentRC
=
0
;
NtCurrentTeb
()
->
glTable
=
&
null_opengl_funcs
;
}
return
ret
;
}
...
...
@@ -1338,7 +1343,11 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
case
DLL_PROCESS_ATTACH
:
opengl32_handle
=
hinst
;
DisableThreadLibraryCalls
(
hinst
);
NtCurrentTeb
()
->
glTable
=
&
null_opengl_funcs
;
return
process_attach
();
case
DLL_THREAD_ATTACH
:
NtCurrentTeb
()
->
glTable
=
&
null_opengl_funcs
;
break
;
case
DLL_PROCESS_DETACH
:
process_detach
();
break
;
...
...
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