OpenGL: Attempt to allocate a texture to big for the current hardware
Posted
by
AnonymousMan
on Game Development
See other posts from Game Development
or by AnonymousMan
Published on 2013-06-24T13:06:28Z
Indexed on
2013/06/24
16:39 UTC
Read the original article
Hit count: 433
I'm getting the following error:
java.io.IOException: Attempt to allocate a texture to big for the current hardware at org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:320) at org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:254) at org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:200) at org.newdawn.slick.opengl.TextureLoader.getTexture(TextureLoader.java:64) at org.newdawn.slick.opengl.TextureLoader.getTexture(TextureLoader.java:24)
The image I'm trying to use is 128x128.
System.out.println(GL11.glGetInteger(GL11.GL_MAX_TEXTURE_SIZE));
I get: 32.
32??!! My graphics card is AMD Radeon HD 7970M with 2048 MB GDDR5 RAM, I can run all the latest games in 1080p and 60fps with no problem, and those textures sure as hell doesn't look like they are 32x32 pixels to me!
How can I fix this?
--
Edit: Here's the chaos code I use to init OpenGL:
Display.setDisplayMode(new DisplayMode(500,500));
Display.create();
if (!GLContext.getCapabilities().OpenGL11) {
throw new Exception("OpenGL 1.1 not supported.");
}
Display.setTitle("Game");
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
GLU.gluPerspective(45, 1, 0.1f, 5000);
Mouse.setGrabbed(true);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glEnable(GL_TEXTURE_2D);
glClearColor(0, 0, 0, 0);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
glEnable(GL_POINT_SMOOTH);
glEnable(GL_LINE_SMOOTH);
glEnable(GL_POLYGON_SMOOTH);
glEnable(GL_POLYGON_OFFSET_FILL);
glShadeModel(GL_SMOOTH);
Display is a LWJGL thing, it makes the OpenGL context and the window.
Anyway, I don't think there's anything in the init code that can help me but you never know...
© Game Development or respective owner