|
Can anyone help me with my codes ? I can't really figure out what went wrong . They are keeping GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT all through . But I do think I have attached the image to the attachpoint . Thanks for your replies
GL3 gl = Drawable.getGL().getGL3();
gl.glGenFramebuffers(1, RenderTarget);
gl.glBindFramebuffer(GL3.GL_FRAMEBUFFER, RenderTarget.get(0));
gl.glGenTextures(0, Texture);
gl.glBindTexture(GL3.GL_TEXTURE_2D, Texture.get(0));
gl.glTexImage2D(GL3.GL_TEXTURE_2D, 0, GL3.GL_RGB, TargetFrameSize, TargetFrameSize, 0, GL3.GL_RGB, GL3.GL_UNSIGNED_BYTE, null);
gl.glTexParameteri(GL3.GL_TEXTURE_2D, GL3.GL_TEXTURE_MAG_FILTER, GL3.GL_NEAREST);
gl.glTexParameteri(GL3.GL_TEXTURE_2D, GL3.GL_TEXTURE_MIN_FILTER, GL3.GL_NEAREST);
gl.glFramebufferTexture(GL3.GL_FRAMEBUFFER, GL3.GL_COLOR_ATTACHMENT0, Texture.get(0), 0);
IntBuffer Control = IntBuffer.allocate(1);
Control.put(GL3.GL_COLOR_ATTACHMENT0);
Control.flip();
gl.glDrawBuffers(1, Control);
gl.glViewport(0, 0, TargetFrameSize, TargetFrameSize);
gl.glBindTexture(GL3.GL_TEXTURE_2D, 0);
RenderToScreen(Drawable);
Utils.getErrors(gl,"wtf");
_____
EDIT:
lol my brain must have exploded . I wrote gl.glGenTextures(0, Texture); omg
|