Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public FboHelper(int displayWidth, int displayHeight) {
- framebufferId = glGenFramebuffers();
- System.out.println(glCheckFramebufferStatus(framebufferId)); // 0x500 here
- glBindFramebuffer(GL_FRAMEBUFFER, framebufferId);
- // 0x500 here
- colorTexture = glGenTextures();
- glBindTexture(GL_TEXTURE_2D, colorTexture);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32UI, displayWidth, displayHeight, 0, GL_RGBA, GL_UNSIGNED_INT, (ByteBuffer) null);
- glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, colorTexture, 0);
- depthRenderBuffer = glGenRenderbuffers();
- glBindRenderbuffer(GL_RENDERBUFFER, depthRenderBuffer);
- glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT, displayWidth, displayHeight);
- glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depthRenderBuffer);
- if (glCheckFramebufferStatus(framebufferId) != GL_FRAMEBUFFER_COMPLETE) { // Still 0x500
- logger.error("[RENDER] Incomplete framebuffer (status 0x" + Integer.toHexString(glCheckFramebufferStatus(framebufferId)) + ")");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment