Hi Matthias,

On Tue, 2004-09-21 at 02:00, Matthias Biedermann wrote:
> Hi there,
> 
> Although I got my things done in the past somehow, I'm still not sure about
> the "right way" to use OpenGL extensions within OpenSG.
> 
> What has to be done to exploit the functionality of different extensions?

The core idea is to register the extension and the extension functions
with the Window (static UInt32 Window::registerExtension(const Char8
*s); and static UInt32 Window::registerFunction(const Char8 *s, Int32
ext = -1);). Botyh return an UInt32 handle, which can be used to check
the availability of the extension on a given Window (not all Windows
have to have the same set of extensions) (bool hasExtension(UInt32 
id);), or get the function pointer (void *getFunction(UInt32 id);). The
ext parameter to registerFunction is the extension this function is part
of, to prevent looking for functions that are not supported anyway. The
example I usually copy off when I need to write that is the BlendChunk,
it has one extension and one extension function and not much more.

> Are there any criteria if extensions are usable at all, as there are some
> like ARB_draw_buffers that might interfere with OpenSG's way of rendering
> etc. 

Hm, that's an interesting one. This gets into Window/buffer management
territory, and that part of the map says "Here be dragons". ;) I haven't
used ARB_draw_buffers before, what exactly are you thinking about?

The general place to put most of the OpenGL extensions is the
StateChunk, but things like draw buffers don't fit in there.

> What do I have to keep in mind when using my application on another
> system which provides all extensions needed, but has some different OpenSG
> running (i.e. a different OSGGLEXT.h)?

Are you talking about writing an application or an extension here? If
you need a certain version of OpenSG (or a later one), that's what you
need. Nonetheless, the extension registration mechanism mentioned above
is totally agnostic about what's used in OpenSG itself. If you have the
name, you can register it, no matter what's defined in OSGGLEXT.h.

Hope it helps

        Dirk




-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to