LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: mustan9 on January 14, 2005, 23:08:49

Title: where is glAreTexturesResident???
Post by: mustan9 on January 14, 2005, 23:08:49
Help!

I'm looking for the OpenGL API's

glAreTexturesResident and glPrioritizeTextures

I can't find them anywhere in LWJGL, except in "org_lwjgl_opengl_GL11.c" but these API's are commented out??

Why? What's going on?

Is there a work around for checking if a texture is resident on the GPU, and why is a basic GL 1.1 API missing?
Title: where is glAreTexturesResident???
Post by: princec on January 15, 2005, 11:48:17
I'm not sure. But don't use either of these two functions, as they are completely useless.

Cas :)
Title: where is glAreTexturesResident???
Post by: samskivert on March 31, 2006, 17:58:34
Not to dredge up ancient history, but why is glAreTexturesResident useless? If I want to find out whether or not I'm blowing through texture memory and swapping like a crazy fool, how else am I to do it without querying whether my textures are resident?

I can call glGetTexParameter(..., GL_TEXTURE_RESIDENT) on every single texture but glAreTexturesResident() would seem to be more efficient.

Are you saying most graphics cards/drivers don't implement it? (Or don't implement it properly?)
Title: where is glAreTexturesResident???
Post by: princec on March 31, 2006, 21:06:04
Well, ask yourself, which mipmap is resident too then :)
Basically OpenGL works like this: all textures are loaded into RAM, somewhere. Either a texture is needed in a scene or it isn't, so there's no way of not having the texture. As OpenGL manages when the texture is uploaded and unloaded there's no point in querying whether they're resident at the server as there's nothing you can do about it anyway.

Cas :)
Title: where is glAreTexturesResident???
Post by: samskivert on March 31, 2006, 22:18:15
I agree that the specification is unclear as to whether a texture is considered "resident" if any or all of its mimaps are resident, however it is still useful to have some indication.

If I want to switch to lower resolution textures or even just get debugging information from a wide variety of users that are using my game, it's extremely handy for me to periodically sample whether my textures are in memory. I know of no other way to determine whether OpenGL is constantly loading and unloading textures.

Anyhow, if there's no technical obstacle, it seems nicer to expose every GL function that can be exposed. Let users of the library decide whether or not they want to make use of a particular API rather than forcing their decision.
Title: where is glAreTexturesResident???
Post by: elias on April 01, 2006, 19:18:41
I've added the two functions, but CVS is down so I can't commit yet.

- elias