Changeset 500 for trunk/src/gl/gl_context.cc
- Timestamp:
- 06/08/16 20:14:43 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gl/gl_context.cc
r499 r500 132 132 } 133 133 134 void nv::gl_context::attach( framebuffer f, output_slot slot, texture t )134 void nv::gl_context::attach( framebuffer f, output_slot slot, texture t, int layer /* = -1*/ ) 135 135 { 136 136 // TODO: framebuffer variable, so no re-binding? … … 143 143 glBindFramebuffer( GL_FRAMEBUFFER, info->glid ); 144 144 unsigned gl_type = texture_type_to_enum( tinfo->type ); 145 146 if ( tinfo ) 147 { 148 // if ( tinfo->size.y == 0 ) 149 // glFramebufferTexture1D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0+(unsigned)slot, GL_TEXTURE_1D, tinfo->glid, 0 ); 150 glFramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0+unsigned( slot ), gl_type, tinfo->glid, 0 ); 145 unsigned tglid = tinfo ? tinfo->glid : 0; 146 147 if ( layer >= 0 ) 148 { 149 glFramebufferTextureLayer( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + unsigned( slot ), tglid, 0, layer ); 151 150 } 152 151 else 153 152 { 154 glFramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 +unsigned( slot ), gl_type, 0, 0 );153 glFramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + unsigned( slot ), gl_type, tglid, 0 ); 155 154 } 156 155 … … 171 170 if ( layer >= 0 ) 172 171 { 173 glFramebufferTextureLayer( GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, tinfo->glid, 0, layer );172 glFramebufferTextureLayer( GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, glid, 0, layer ); 174 173 } 175 174 else
Note: See TracChangeset
for help on using the changeset viewer.