Sign in to follow this  
myers

FBOs in fullscreen

Recommended Posts

myers    143
This is strange. I've just switched from pbuffers to FBOs, and they work fine for rendering to texture in windowed mode - but in fullscreen, the texture remains blank. Here's how I set up the FBO and its accompanying texture and renderbuffer:
 glGenTextures(1,&texture);
 glBindTexture(GL_TEXTURE_2D,texture);
 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB16, size, size, 0, GL_RGB, GL_UNSIGNED_BYTE, 0);

 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
	
 glGenFramebuffersEXT(1,&framebuffer);
 glGenRenderbuffersEXT(1,&renderbuffer);

 glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, renderbuffer);
 glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24, size, size);

 GLenum status=glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
 switch(status){
  case GL_FRAMEBUFFER_COMPLETE_EXT:
   break;
  case GL_FRAMEBUFFER_UNSUPPORTED_EXT:
   break;
  default:
   glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
   exit(0);
 }

 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, framebuffer);

 glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, texture, 0);
 glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, renderbuffer);
 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);

And rendering (which hardly seems worth posting):
 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, framebuffer);

 Render();

 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);

Anyone else experienced problems using FBOs in fullscreen? The code is so straightforward that I don't see much that could be going wrong with it, so I'm wondering if this is a driver issue. This is on a creaky old GF Go5200, with the latest drivers from guru3d. Thanks for any help.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this