Advertisement

Rendering problems

Started by February 28, 2005 07:47 AM
0 comments, last by CRACK123 19 years, 11 months ago
My game was working fine, i had my models loaded etc and movement was ok. now when i have come to add text to my screen i use nehe's lesson 13, the lwjgl version and now i have problems. If i call the method to print text onto the screen, indeed text is displayed but now no models are displayed. if i didnt call the print method but still called buildFont then the models are still not drawn so i know that it is something within this method. i then narrowed the problem down to the following within the buildFont method: // Create A IntBuffer For Image Address In Memory IntBuffer buf = ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer(); GL11.glGenTextures(buf); // Create Texture In OpenGL GL11.glBindTexture(GL11.GL_TEXTURE_2D, buf.get(0)); and there is something within here that is stopping anything else from being drawn. My models are stored as FloatBuffer but i cant see what here would stop them from being drawn, nothing is reset. Now i dont know much about OpenGL but if someone has any ideas the i would be very greatful, i would also be willing to send my code if anyone would find it of use. The game does not crash at all, everything keeps running but nothing is displayed on the screen, thanks ps below is a code snippet of how i am drawing my models: private void renderShipModel() { GL11.glColor3f(rColour, gColour, bColour); GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); GL11.glVertexPointer(3, 0, shipData); GL11.glDrawArrays(GL11.GL_TRIANGLES, 0, coords.size() / 3); GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); }
Try disabling GL_TEXTURE_2D before rendering.
The more applications I write, more I find out how less I know

This topic is closed to new replies.

Advertisement