opengl to lwjgl

Started by Daslee, December 28, 2012, 11:10:31

Previous topic - Next topic

Daslee

Hello, can someone convert this code: http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-11-2d-text/ to lwjgl? I really need 2d text rendering in 3d content.  :(

Evil-Devil

I guess you have allready texture loading, fragment and pixel shaders working, then it should be an easy task for you to convert it yourself. On the other hand, its quite hard to convert something that is build on top of 10 other previous tutorials. No one will go through all of them just to convert some code.

My advice for you is, read it and learn it. Or use something that allready exists until you did your own font renderer.

Daslee

It's not wrote in Java, so I don't understand everything. And there is not using LWJGL.

CodeBunny

You know, Slick2D has some 2D font classes that are more or less self-contained. They're a decent starting point on getting fonts working. That's probably a better place to look.

Evil-Devil

Quote from: Daslee on December 30, 2012, 14:22:45
It's not wrote in Java, so I don't understand everything. And there is not using LWJGL.
You can convert allmost every C/C++ OpenGL Code to Java and the LWJGL OpenGL Binding. Of course it will be some work to be done, but in the end you know what you were doing.

@Slick: Might work. But iam not sure about if slick will work with the 3.0+ profile. Though its worth a try.

Daslee

I was watching this video before: http://www.youtube.com/watch?v=w9M5svhbMq8 but then I really did not understand so much at LWJGL, but now I tried to do as this tutorial shows and almost solved my problem, just have some black squares under text. Thank you guys for trying to help me. :)

CodeBunny

Quote from: Evil-Devil on December 30, 2012, 18:47:30
@Slick: Might work. But iam not sure about if slick will work with the 3.0+ profile. Though its worth a try.

It won't, but that's not a terrible issue if he's planning on using the default/backwards compatible profile anyway.

Additionally, the Slick font classes could be used as a stepstone to generate VBOs/vertex arrays that draw out fonts (instead of drawing the fonts use similar methods to create the desired vertices).