MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / setSurface

Method setSurface

framework/render/gl20/ogl_2_0_renderer.cpp:681–696  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

679
680 friend class RendererSurfaceBinding;
681 void setSurface(sp<Surface> s) override
682 {
683 if (this->currentSurface == s)
684 {
685 return;
686 }
687 this->flush();
688 this->currentSurface = s;
689 if (!s->rendererPrivateData)
690 s->rendererPrivateData.reset(new FBOData(s->size, this));
691
692 FBOData *fbo = static_cast<FBOData *>(s->rendererPrivateData.get());
693 gl20::BindFramebufferEXT(gl20::FRAMEBUFFER_EXT, fbo->fbo);
694 this->currentBoundFBO = fbo->fbo;
695 gl20::Viewport(0, 0, s->size.x, s->size.y);
696 }
697 sp<Surface> getSurface() override { return currentSurface; }
698 sp<Surface> defaultSurface;
699

Callers 2

Calls 3

flushMethod · 0.95
resetMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected