realbasic-games
[Top] [All Lists]

Re: using opengl to draw video

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: using opengl to draw video
From: Frank Condello <developer at chaoticbox dot com>
Date: Tue, 30 May 2006 17:55:53 -0400
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-games at lists dot realsoftware dot com
References: <C074788B-B53E-4021-99F6-FBCF2551C911 at divergentmedia dot com>
On 28-Apr-06, at 5:24 PM, Mike Woodworth wrote:

hey all,

i'm looking into speeding up an app i'm currently workign on by using opengl to do the screen drawing. i found asher's opengl declare library, and i started trying to shoe horn some of the examples i've found into his example project... but they don't work, and i'm not sure where to look. the problem is, the code compiles fine, but nothing is displayed. for someone with so little experience, this makes for tough debugging. are there any tools out there to help me try to diagnose the problem? or does opengl fail silently when trying to load something improperly?

You should call glGetError frequently in debug builds to get an idea of where (or if) stuff is failing. Set up a method that calls glGetError in a loop until it returns GL_NO_ERROR, and log any errors it finds (System.DebugLog will do in a pinch). I call a method like this at the end of every single method that declares into OpenGL, passing the current method name so I can easily go in and narrow things down further when needed. Wrap these calls in "#if DebugBuild" conditionals though, 'cause you don't this overhead for release builds.

You should also call aglGetError during the context/drawable setup (or whatever's appropriate for the windowing API you're using) but these errors are usually easier to spot - e.g. the function calls themselves will fail outright rather than posting an error and continuing as gl* functions might.

Once you rule out actual errors you'll have to do some tougher debugging. An empty display could simply mean your projection isn't set up right, or your geometry is outside the frustum, or facing the wrong way, etc.

Frank.
–––––––––––––––––––––––––––––––––
Open Source RB Goodies and Shareware
<http://developer.chaoticbox.com/>
<http://www.chaoticbox.com/>
–––––––––––––––––––––––––––––––––

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>