Peter,
 
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,
 
Kevin.
 

Date: Sat, 6 Mar 2010 23:08:19 -0800
From: my_name_tallulah@yahoo.com
To: perl-win32-gui-users@lists.sourceforge.net
Subject: [perl-win32-gui-users] child window for opengl

Hi
in 14 Jul 2009 http://www.mail-archive.com/perl-win32-gui-users@lists.sourceforge.net/msg05703.html i have posted an opengl example to run from within win32gui , the example depends on kevin Marshall code posted here http://www.mail-archive.com/perl-win32-gui-users@lists.sourceforge.net/msg05673.html .
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:
  glViewport(0,0,320,240);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluPerspective(45.0, 320 / 240, 0.1, 500.0);
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();
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:
http://rapidshare.com/files/360063815/win32gui_opengl2.pl
its picture like this:
http://img192.imageshack.us/img192/3226/win32guiopengl.jpg
 
regards
peter
 

 



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