


GL11.glGetTexImage(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGB, GL11.GL_FLOAT, floats) ByteBuffer, so it's a float array for debug purposes. I have unrelated problems while getting the data using a Test if the buffer data is correctly stored in the texture. GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_REPEAT) GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR) GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR) GL11.glBindTexture(GL11.GL_TEXTURE_2D, textureID) Generate the texture and set parameters Throw new RuntimeException("Failed to create the GLFW window") Long window = GLFW.glfwCreateWindow(100, 100, "", NULL, NULL) Throw new IllegalStateException("Unable to initialize GLFW") There's probably something really simple I'm not getting, so any help is appreciated.įull working test program: static .NULL

And yes, my image is RGB and yes, it's 4x4. The function call is also the same as with the float array, except for the type parameter, of course. I've looked at how other people do this but nothing seems to be helping. The texture is empty and will render as completely black. I have gotten the image loaded and the data into a ByteBuffer object, but when I use glTexImage2D like so: GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGB,Ĥ, 4, 0, GL11.GL_RGB, GL11.GL_UNSIGNED_BYTE, buffer) Now, though, I need to load an image from a file and store it in the texture. I just got a test texture working in my LWJGL code using an array of floats.
