Help translating opengl texture tutorial to lwjgl

Started by rileld, March 02, 2015, 03:32:45

Previous topic - Next topic

rileld

I'm trying to recreate this tutorial: https://open.gl/textures using lwjgl. This is the source code I'm working off: https://open.gl/content/code/c3_basic.txt.

Here's a repo of my current progress: https://github.com/kevinm416/java-game. There is a main method in https://github.com/kevinm416/java-game/blob/master/src/main/java/com/kevinm416/game/OpenGlTextureTutorial.java, which I expect to produce a window with the texture showing. However, I can not get anything to show up.

Let me know if there's anything else I can do to make it easy for any of you to help me.


Kai

I hate to break this on you, but your demo project with 20 source files, various "service" abstractions and also the use of reflection to simply instantiate a class is by far too complex and unwieldy for a tutorial about simple OpenGL textures.
Bring that down to a single source file that preferrably looks similar to the C source file you are porting, and people will like what you did. Simplicity and conciseness is key for tutorials!
Sorry if that maybe came along rude, but it is just very hard to grasp what is going on right now and what the error might be, given that the C source is so darn simple to understand because it focuses on the important part: the use of the OpenGL API.
Cheers,
Kai

Katsu

I tried to translate it to Java + LWJGL3: http://pastebin.com/uKqiPBct
It is almost the same code as the text file on open.gl. To run this, you just need a texture called test.jpg in the project folder (or you can change line ~135). It works on my laptop which has OpenGL 3.1.

Katsu