MCPcopy Create free account
hub / github.com/atraczyk/2d-engine / Resize

Method Resize

engine/src/rendertarget.cpp:42–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42void RenderTarget::Resize(int w, int h)
43{
44 width = w;
45 height = h;
46 glBindTexture(GL_TEXTURE_2D, fbo_texture);
47 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
48 glBindTexture(GL_TEXTURE_2D, 0);
49
50 if (hasdepthbuffer)
51 {
52 glBindRenderbuffer(GL_RENDERBUFFER, rbo_depth);
53 glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, width, height);
54 glBindRenderbuffer(GL_RENDERBUFFER, 0);
55 }
56}
57
58void RenderTarget::Clear(float r, float g, float b, float a)
59{

Callers 1

R_resizeFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected