aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/test/wx_opengl_SUITE.erl
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2012-12-21 11:51:31 +0100
committerDan Gudmundsson <[email protected]>2013-01-09 11:44:29 +0100
commit7108397ed9bccfc4cf9ace23f0d29dc3e69b31da (patch)
treebe3f2d08eedea09a141a0a7330018c397f5d980d /lib/wx/test/wx_opengl_SUITE.erl
parentc722d65fbd9be59bd8698149e3cc1a98096fc345 (diff)
downloadotp-7108397ed9bccfc4cf9ace23f0d29dc3e69b31da.tar.gz
otp-7108397ed9bccfc4cf9ace23f0d29dc3e69b31da.tar.bz2
otp-7108397ed9bccfc4cf9ace23f0d29dc3e69b31da.zip
wx: Fix demo and tests
Added debugging and workarounds for wx-2.9 on Mac
Diffstat (limited to 'lib/wx/test/wx_opengl_SUITE.erl')
-rw-r--r--lib/wx/test/wx_opengl_SUITE.erl16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/wx/test/wx_opengl_SUITE.erl b/lib/wx/test/wx_opengl_SUITE.erl
index 089036e47c..f351bc93ed 100644
--- a/lib/wx/test/wx_opengl_SUITE.erl
+++ b/lib/wx/test/wx_opengl_SUITE.erl
@@ -98,7 +98,8 @@ canvas(Config) ->
?WX_GL_MIN_GREEN,8,
?WX_GL_MIN_BLUE,8,
?WX_GL_DEPTH_SIZE,24,0]}],
- Canvas = ?mt(wxGLCanvas, wxGLCanvas:new(Frame, Attrs)),
+ Canvas = ?mt(wxGLCanvas, wxGLCanvas:new(Frame, [{style,?wxFULL_REPAINT_ON_RESIZE}|
+ Attrs])),
wxFrame:connect(Frame, show),
?m(true, wxWindow:show(Frame)),
@@ -142,11 +143,20 @@ canvas(Config) ->
%% This may fail when window is deleted
catch draw_loop(2,Data,Canvas)
end),
+ %% Needed on mac with wx-2.9
+ wxGLCanvas:connect(Canvas, paint,
+ [{callback, fun(_,_) ->
+ wxGLCanvas:setCurrent(Canvas),
+ DC= wxPaintDC:new(Canvas),
+ wxPaintDC:destroy(DC)
+ end}]),
+
+
?m_receive(works),
?m([], flush()),
io:format("Undef func ~p ~n", [catch gl:uniform1d(2, 0.75)]),
timer:sleep(500),
- ?m([], flush()),
+ flush(),
wx_test_lib:wx_destroy(Frame, Config).
flush() ->
@@ -161,6 +171,8 @@ flush(Collected) ->
draw_loop(Deg,Data,Canvas) ->
timer:sleep(15),
+ {NW,NH} = wxGLCanvas:getClientSize(Canvas),
+ gl:viewport(0,0,NW,NH),
drawBox(Deg,Data),
?m(ok, wxGLCanvas:swapBuffers(Canvas)),
draw_loop(Deg+1, Data,Canvas).