I’m wrote a Texture manager class. It contains texture id’s as issued by OpenGL, with key’s to these Id’s set to the filename of the texture itself.
There is a method called deleteAll that deletes all textures being managed.
public void deleteAll() {
LoggingSystem.getLoggingSystem().getLogger().log(Level.INFO,
"Deleting All Textures");
int id;
String key;
for(int i = 0; i < keyList.size(); i++) {
key = ((TextureData)keyList.get(i)).file;
id = ((Integer)textureList.get(key)).intValue();
if(gl.isTexture(id)) {
gl.deleteTextures(1, id);
}
}
textureList.clear();
keyList.clear();
}
I’m having trouble with this call, specifically gl.deleteTextures(1, id).
I’m getting the following error:
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0xEF8CD90
Function=[Unknown.]
Library=C:\WINNT\System32\nvoglnt.dll
NOTE: We are unable to locate the function name symbol for the error
just occurred. Please refer to release documentation for possible
reason and solutions.
Current Java thread:
at org.lwjgl.opengl.CoreGL.deleteTextures(Native Method)
at monkey.texture.TextureManager.deleteAll(TextureManager.java:367)
at monkey.texture.TextureManager.reload(TextureManager.java:104)
at monkey.Game.mainLoop(Game.java:92)
at monkey.Game.start(Game.java:59)
at monkey.Game.main(Game.java:74)
with a long list of dynamic libraries.
This only seems to happen after I have changed the screen resolution and thus gl.destroy and gl.create have been called. I thought it may be due to me trying to delete a texture that doesn’t exist, but I added the
if(gl.isTextured(id))
statement to take care of this. Any ideas?
Thanks,
Mark
