diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index b0b9c00..dac5c99 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -87,6 +87,13 @@ my %cat_1_5 = ( %cat_1_4, "GL_VERSION_1_5" => 1 ); my %norm_categories = (); # +# This list represents the functions that require NULL function table +# handling +# + +my @null_table_check = qw/glBindTexture glDeleteTextures/; + +# # This hash table gives the conversion between OpenGL types and what # is used by the TRACE printfs # @@ -282,6 +289,9 @@ sub GenerateThunk($$$$) $ret .= 'void ' if (!@{$func_ref->[1]}); $ret .= ") {\n"; $ret .= " const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;\n"; + if (grep $_ eq $name, @null_table_check) { + $ret .= " if(!funcs) return; /* called without an active gl context */\n"; + } if ($func_ref->[0] ne "void" && $gen_thread_safe) { $ret .= " " . ConvertType($func_ref->[0]) . " ret_value;\n"; }