Your problem could be caused by the code that you added to the render sub. It would probably add some overhead to resize the viewport every frame. Try moving the code to just before the dialog loop. Also, you could try using the Win32::GUI::OpenGLFrame module created by Robert May. This module basically shortcuts all the code necessary for using OpenGL with Win32::GUI, and uses an XS interface to the required functions, instead of loading them with Win32::API. This may provide a speed increase. The module can be found on CPAN.
Hope this helps,

Date: Sat, 6 Mar 2010 23:08:19 -0800
Subject: [perl-win32-gui-users] child window for opengl

in 14 Jul 2009 i have posted an opengl example to run from within win32gui , the example depends on kevin Marshall code posted here .
the example show a popup child window in wich the opengl scene rendered.
now i have tried the same example but the opengl scene will be rendered to a child window inside the main window; it is working but with one problem; the launching of the program lasts about 5 seconds before the main window appears. why is this behaviour?, since in the popup child window example the main window appears in one second only.
the only adjustments i have made is :
1- adding the following lines to the render sub since the sticky child window can't be resized so the -onResize => sub {...} is not operative:
  gluPerspective(45.0, 320 / 240, 0.1, 500.0);
2-adding to the child properties:
 -popstyle    => WS_CAPTION | WS_SIZEBOX,
 -pushstyle   => WS_CHILD,
 -pushexstyle => WS_EX_CLIENTEDGE,
and the else of the program is the same as the first example.
for convenience here is the modified program, so you can check the 5 seconds delay before the main window appears:
its picture like this:


Sign up for SEEK Jobmail. Get the latest jobs delivered.