diff options
Diffstat (limited to 'lib/wx/test/wx_opengl_SUITE.erl')
-rw-r--r-- | lib/wx/test/wx_opengl_SUITE.erl | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/lib/wx/test/wx_opengl_SUITE.erl b/lib/wx/test/wx_opengl_SUITE.erl index ce4651bcb1..778d089bce 100644 --- a/lib/wx/test/wx_opengl_SUITE.erl +++ b/lib/wx/test/wx_opengl_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2009. All Rights Reserved. +%% Copyright Ericsson AB 2008-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -91,7 +91,7 @@ canvas(Config) -> ?m(true, wxWindow:show(Frame)), ?m(false, wx:is_null(wxGLCanvas:getContext(Canvas))), - ?m({'EXIT', {{no_gl_context,_},_}}, gl:getString(?GL_VENDOR)), + ?m({'EXIT', {{error, no_gl_context,_},_}}, gl:getString(?GL_VENDOR)), ?m(ok, wxGLCanvas:setCurrent(Canvas)), io:format("Vendor: ~s~n", [gl:getString(?GL_VENDOR)]), @@ -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(), |