Guest User

Untitled

a guest
Sep 11th, 2015
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.15 KB | None | 0 0
  1. public FboHelper(int displayWidth, int displayHeight) {
  2.         framebufferId = glGenFramebuffers();
  3.         System.out.println(glCheckFramebufferStatus(framebufferId)); // 0x500 here
  4.         glBindFramebuffer(GL_FRAMEBUFFER, framebufferId);
  5.     // 0x500 here
  6.  
  7.         colorTexture = glGenTextures();
  8.         glBindTexture(GL_TEXTURE_2D, colorTexture);
  9.         glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32UI, displayWidth, displayHeight, 0, GL_RGBA, GL_UNSIGNED_INT, (ByteBuffer) null);
  10.         glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, colorTexture, 0);
  11.  
  12.         depthRenderBuffer = glGenRenderbuffers();
  13.         glBindRenderbuffer(GL_RENDERBUFFER, depthRenderBuffer);
  14.         glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT, displayWidth, displayHeight);
  15.         glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depthRenderBuffer);
  16.  
  17.         if (glCheckFramebufferStatus(framebufferId) != GL_FRAMEBUFFER_COMPLETE) { // Still 0x500
  18.             logger.error("[RENDER] Incomplete framebuffer (status 0x" + Integer.toHexString(glCheckFramebufferStatus(framebufferId)) + ")");
  19.         }
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment