MCPcopy Create free account
hub / github.com/SpartanJ/eepp / resize

Method resize

src/eepp/graphics/framebufferfbo.cpp:216–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214}
215
216void FrameBufferFBO::resize( const Uint32& Width, const Uint32& Height ) {
217 if ( Sizei( Width, Height ) == mSize )
218 return;
219
220 mSize.x = Width;
221 mSize.y = Height;
222
223 bindFrameBuffer();
224
225 if ( mHasDepthBuffer ) {
226 bindDepthBuffer();
227
228 GLi->renderbufferStorage( GL_RENDERBUFFER, GL_DEPTH_COMPONENT, Width, Height );
229
230 GLi->framebufferRenderbuffer( GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER,
231 mDepthBuffer );
232
233 GLi->bindRenderbuffer( GL_RENDERBUFFER, mLastDB );
234 }
235
236 if ( mHasStencilBuffer ) {
237 bindStencilBuffer();
238
239 GLi->renderbufferStorage( GL_RENDERBUFFER, GL_STENCIL_INDEX8, Width, Height );
240
241 GLi->framebufferRenderbuffer( GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER,
242 mStencilBuffer );
243
244 GLi->bindRenderbuffer( GL_RENDERBUFFER, mLastSB );
245 }
246
247 if ( NULL != mTexture ) {
248 Image newImage( Width, Height, mChannels );
249 mTexture->replace( &newImage );
250 } else if ( mColorBuffer ) {
251 bindColorBuffer();
252
253 GLi->renderbufferStorage( GL_RENDERBUFFER, mChannels == 3 ? GL_RGB8 : GL_RGBA8, Width,
254 Height );
255
256 GLi->framebufferRenderbuffer( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER,
257 mColorBuffer );
258
259 GLi->bindRenderbuffer( GL_RENDERBUFFER, mLastCB );
260 }
261
262 GLi->bindFramebuffer( GL_FRAMEBUFFER, mLastFB );
263}
264
265void FrameBufferFBO::draw( const Vector2f& position, const Sizef& size ) {
266 if ( NULL != mTexture ) {

Callers

nothing calls this directly

Calls 5

renderbufferStorageMethod · 0.80
bindRenderbufferMethod · 0.80
bindFramebufferMethod · 0.80
replaceMethod · 0.45

Tested by

no test coverage detected