diff options
author | Dan Gudmundsson <[email protected]> | 2010-11-15 15:24:58 +0100 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2010-11-15 15:24:58 +0100 |
commit | 8ecbdaf5eb54052d7b4756037e6dc481a36358ed (patch) | |
tree | 3db1d8e9cf250003fa240ba33072d509edeab382 /lib/wx/src/gen/wxGLCanvas.erl | |
parent | 2e605129613ba88427de27520a19456903d40cca (diff) | |
download | otp-8ecbdaf5eb54052d7b4756037e6dc481a36358ed.tar.gz otp-8ecbdaf5eb54052d7b4756037e6dc481a36358ed.tar.bz2 otp-8ecbdaf5eb54052d7b4756037e6dc481a36358ed.zip |
Initilize opengl after setCurrent
No rendering context is available until setCurrent is called the
first time, opengl extensions can not be loaded before the rendering
context is created.
Diffstat (limited to 'lib/wx/src/gen/wxGLCanvas.erl')
-rw-r--r-- | lib/wx/src/gen/wxGLCanvas.erl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/wx/src/gen/wxGLCanvas.erl b/lib/wx/src/gen/wxGLCanvas.erl index e5d7bec4ca..032d42535d 100644 --- a/lib/wx/src/gen/wxGLCanvas.erl +++ b/lib/wx/src/gen/wxGLCanvas.erl @@ -105,7 +105,6 @@ new(#wx_ref{type=ParentT,ref=ParentRef}, Options) ({palette, #wx_ref{type=PaletteT,ref=PaletteRef}}, Acc) -> ?CLASS(PaletteT,wxPalette),[<<7:32/?UI,PaletteRef:32/?UI>>|Acc]; (BadOpt, _) -> erlang:error({badoption, BadOpt}) end, BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)), - {ok, _} = wxe_master:init_opengl(), wxe_util:construct(?wxGLCanvas_new_2, <<ParentRef:32/?UI, 0:32,BinOpt/binary>>). @@ -131,7 +130,6 @@ new(#wx_ref{type=ParentT,ref=ParentRef},#wx_ref{type=SharedT,ref=SharedRef}, Opt ({palette, #wx_ref{type=PaletteT,ref=PaletteRef}}, Acc) -> ?CLASS(PaletteT,wxPalette),[<<7:32/?UI,PaletteRef:32/?UI>>|Acc]; (BadOpt, _) -> erlang:error({badoption, BadOpt}) end, BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)), - {ok, _} = wxe_master:init_opengl(), wxe_util:construct(SharedOP, <<ParentRef:32/?UI,SharedRef:32/?UI, BinOpt/binary>>). @@ -146,8 +144,10 @@ getContext(#wx_ref{type=ThisT,ref=ThisRef}) -> %% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxglcanvas.html#wxglcanvassetcurrent">external documentation</a>. setCurrent(#wx_ref{type=ThisT,ref=ThisRef}) -> ?CLASS(ThisT,wxGLCanvas), - wxe_util:cast(?wxGLCanvas_SetCurrent, - <<ThisRef:32/?UI>>). + _Result = wxe_util:cast(?wxGLCanvas_SetCurrent, + <<ThisRef:32/?UI>>), + {ok, _} = wxe_master:init_opengl(), + _Result. %% @spec (This::wxGLCanvas()) -> ok %% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxglcanvas.html#wxglcanvasswapbuffers">external documentation</a>. |