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: Mike Woodworth <mike at divergentmedia dot com>
Date: Fri, 28 Apr 2006 20:59:06 -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> <7D249781-5454-4751-A1CC-04CC1FE37577 at chaoticbox dot com>
well, it seems that i did have one error, but fixing it doesn't replace the boring black screen with anything more intentional. guess i need to dig around more, maybe start with a simpler goal, and work my way up to video... though i was hoping not to have to delve too deeply into opengl in this process.

mike
--
Mike Woodworth
mike at divergentmedia dot com



On May 30, 2006, at 5:55 PM, Frank Condello wrote:

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>

_______________________________________________
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>