displaying an image (texture) in LWJGL java

Perhaps a very primitive and hackneyed question, but how to display a picture (image texture) in a window using lwjgl. I wanted to create my own button casts, because for obvious reasons, there are no buttons in opengl. I want to use full-fledged button textures instead of squares, but I don't know how to create and place a texture on the field. I tried to Google for a long time, but everywhere either offer castes or bible libraries or write about c / c++. I sincerely hope for help from you and hope I will not be sent to google)

Author: Ula La, 2017-06-10

1 answers

First, we need to expand the texture on the 2d plane and cut out parts of it that can later be passed 3d coordinates for texturing models.

 ModelTexture texture = model.getTexture();
    shader.loadShineVariables(texture.getShineDamper(), texture.getReflectivity());

GL13.glActiveTexture(GL13.GL_TEXTURE0);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, model.getTexture().getID());
 0
Author: Ula La, 2017-07-12 13:14:39