aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/test
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2010-11-19 14:57:59 +0100
committerDan Gudmundsson <[email protected]>2010-11-19 16:13:05 +0100
commitabc92a6f3b4615e596992eda153da0c09a3c7cbf (patch)
tree48be474d24206c81f1bcd605427648225f1e5472 /lib/wx/test
parentb69da5dbf60e0062982c89524df97066b95ce816 (diff)
downloadotp-abc92a6f3b4615e596992eda153da0c09a3c7cbf.tar.gz
otp-abc92a6f3b4615e596992eda153da0c09a3c7cbf.tar.bz2
otp-abc92a6f3b4615e596992eda153da0c09a3c7cbf.zip
Fix non available opengl functions
Opengl functions are loaded at runtime and differ with drivers and cards.
Diffstat (limited to 'lib/wx/test')
-rw-r--r--lib/wx/test/wx_opengl_SUITE.erl20
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/wx/test/wx_opengl_SUITE.erl b/lib/wx/test/wx_opengl_SUITE.erl
index 9d12711dd7..778d089bce 100644
--- a/lib/wx/test/wx_opengl_SUITE.erl
+++ b/lib/wx/test/wx_opengl_SUITE.erl
@@ -113,7 +113,7 @@ canvas(Config) ->
Data = {?FACES,?VS},
drawBox(0, Data),
?m(ok, wxGLCanvas:swapBuffers(Canvas)),
-
+ ?m([], flush()),
Env = wx:get_env(),
Tester = self(),
spawn_link(fun() ->
@@ -125,10 +125,23 @@ canvas(Config) ->
%% This may fail when window is deleted
catch draw_loop(2,Data,Canvas)
end),
-
?m_receive(works),
+ ?m([], flush()),
+ io:format("Undef func ~p ~n", [catch gl:uniform1d(2, 0.75)]),
+ timer:sleep(500),
+ ?m([], flush()),
wx_test_lib:wx_destroy(Frame, Config).
-
+
+flush() ->
+ flush([]).
+
+flush(Collected) ->
+ receive Msg ->
+ flush([Msg|Collected])
+ after 1 ->
+ lists:reverse(Collected)
+ end.
+
draw_loop(Deg,Data,Canvas) ->
timer:sleep(15),
drawBox(Deg,Data),
@@ -136,6 +149,7 @@ draw_loop(Deg,Data,Canvas) ->
draw_loop(Deg+1, Data,Canvas).
+
drawBox(Deg,{Fs,Vs}) ->
gl:matrixMode(?GL_MODELVIEW),
gl:loadIdentity(),