Hi Terry,

On Tue, 2005-05-17 at 10:13 -0500, Terry Welsh wrote:
> 
> You have probably given this way more thought than me, but I'll just
> ask anyway.  Why not have TextureChunks generate their IDs with
> glGenTextures when they first try to render and store a map of
> contexts to texture IDs?  Then you would only be generating IDs in a
> valid rendering context.

Initially that additional indirection just seemed unnecessary, but given
that more people than expected are using OpenSG and other OpenGL code
that's what I'm planning to do in the future (implemented a little
differently, but same idea). I just wanted to give you a solution that
works right now.

> This could probably work for just me, but not when using other
> libraries with OpenGL code.  Currently I'm avoiding the problem with
> this nice little hack that comes before all the OpenGL code:
> 
> GLuint ids[1000];
> glGenTextures(1000, ids);

Given that you don't really need to use glGenTextures, it's probably
safer to just use some range of large numbers (1000000 and up or so), as
otherwise you might still run into trouble with large scenes. OpenSG
uses a uniform namespace, so texture ids and display list ids come from
the same pool, which means that large scenes with > 1000 objects might
create texture ids > 1000.

HIH

        Dirk

-- 
-- Dirk Reiners               OpenSG Forum             [EMAIL PROTECTED] 
-- The OpenSG Open Source Scenegraph:            http://www.opensg.org
-- Join the list at    http://lists.sf.net/lists/listinfo/opensg-users



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to