Hello guys,
I would like to first start of by saying that I am fairly new with OpenGl so please forgive me for my any stupidness.
When I ever try to render using the glTexImage2D of GL11 I get an OpenGlException. Here is the stacktrace.
Exception in thread "main" org.lwjgl.opengl.OpenGLException: Cannot use offsets when Pixel Unpack Buffer Object is disabled
at org.lwjgl.opengl.GLChecks.ensureUnpackPBOenabled(GLChecks.java:141)
at org.lwjgl.opengl.GL11.glTexImage2D(GL11.java:2889)
at Objects.Npcs.NPC.Draw(NPC.java:50)
at Graphics.Scene.DrawMob(Scene.java:25)
at Graphics.Scene.Render_Graphics(Scene.java:14)
at GameLogic.Gamelogic.run(Gamelogic.java:19)
at Start.main(Start.java:20)
I have done my own research but couldn't find any topic relating to fixing this. This is my initialization code.
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
// enable alpha blending
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glViewport(0, 0, 800, 600);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GL11.glOrtho(0, 800, 600, 0, 1, -1);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
Thanks,
Abhi2011