Discussion:
OpenGL - keeping track of used textures and display lists
(too old to reply)
R.Wieser
2018-01-26 21:21:15 UTC
Permalink
Hello All,

I'm writing some OpenGL code, and at some point I want to delete a display
list, from which I need to be able to determine which textures and sub
display lists are referenced by it, so I can figure out if I need to delete
them too (if noone else is referring to them that is).

The question is therefore: How do I the above (get the referenced textures
and/or sub display lists) ?

Regards,
Rudy Wieser
Johann Klammer
2018-01-27 21:40:45 UTC
Permalink
Post by R.Wieser
Hello All,
I'm writing some OpenGL code, and at some point I want to delete a display
list, from which I need to be able to determine which textures and sub
display lists are referenced by it, so I can figure out if I need to delete
them too (if noone else is referring to them that is).
The question is therefore: How do I the above (get the referenced textures
and/or sub display lists) ?
Regards,
Rudy Wieser
some sort of structure with a reference counter.
R.Wieser
2018-01-28 07:35:19 UTC
Permalink
Johann,
Post by Johann Klammer
some sort of structure with a reference counter.
Thats one way to do it, but than I need to manage seperate structures while
taking care/assume that they will stay in sync.

I was hoping that I could maybe enumerate display lists, to figure out which
textures and sub display lists threy contain.

Though the best solution would be if some kind of OpenGL-managed reference
count would be already present, with me simply not yet being aware of it.

Regards,
Rudy Wieser
Johann Klammer
2018-01-29 19:31:24 UTC
Permalink
Post by R.Wieser
Johann,
Post by Johann Klammer
some sort of structure with a reference counter.
Thats one way to do it, but than I need to manage seperate structures while
taking care/assume that they will stay in sync.
I was hoping that I could maybe enumerate display lists, to figure out which
textures and sub display lists threy contain.
Though the best solution would be if some kind of OpenGL-managed reference
count would be already present, with me simply not yet being aware of it.
Regards,
Rudy Wieser
Ja, maybe they'll also write that program for you then.
R.Wieser
2018-01-29 21:17:31 UTC
Permalink
Johann,
Post by Johann Klammer
Ja, maybe they'll also write that program for you then.
I'm sorry you think I'm one of *those* guys.

FYI: I already got a solution running, using objects which hold a single
display list as well as a structure holding the used textures. And I
rather dislike it. As databases 101 will tell you, having duplicate data
(in your program) is just asking for trouble.

I was just out for some info on a *better*, maybe even already existing
solution, as I cannot really imagine from a logical POV that the same API
which allows you to dynamically create textures and display lists and have
both of them used multiple times does not have any way to track their usage.
Thats just asking for resource leakage problems (or textures and/or meshes
disappearing ofcourse).

Than again, OpenGL has, as far as I'm concerned, more oddities. Like only
being able to fill a single display list at a time, as well as not being
able to draw to the canvas (monitor) as long as a display list is open. In
other words, loading new data (meshes) while moving thru a 3D world is out
of the question ...

Well, thanks for your response.

A remark though:
Too bad though that you, as so many people do, thought it would be a good
idea to reply with something which does not even answer my question. A
simple "no, OpenGL does not have it" would have been enough.

Regards,
Rudy Wieser

Loading...