MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / framebufferColorTexture2D

Method framebufferColorTexture2D

Source/Graphics/graphics.cpp:306–326  ·  view source on GitHub ↗

#pragma optimize("",off)

Source from the content-addressed store, hash-verified

304
305// #pragma optimize("",off)
306void Graphics::framebufferColorTexture2D(TextureRef t, int mipmap_level) {
307 /*if(Textures::Instance()->IsCompressed(t)){
308 Textures::Instance()->Uncompress(t);
309 }*/
310 PROFILER_ENTER(g_profiler_ctx, "EnsureInVRAM");
311 Textures::Instance()->EnsureInVRAM(t);
312 PROFILER_LEAVE(g_profiler_ctx);
313 CHECK_GL_ERROR();
314 GLuint tex = Textures::Instance()->returnTexture(t);
315 LOGS << "Binding gl texture " << tex << " to framebuffer" << std::endl;
316 if (!t.valid()) {
317 LOGE << "Not valid..." << std::endl;
318 }
319 // if(!glIsTexture(tex)){
320 // LOGE << "Not a texture..." << std::endl;
321 // }
322 PROFILER_ENTER(g_profiler_ctx, "glFramebufferTexture2D");
323 glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex, mipmap_level);
324 PROFILER_LEAVE(g_profiler_ctx);
325 CHECK_GL_ERROR();
326}
327// #pragma optimize("",on)
328
329void Graphics::genRenderbuffers(GLuint* rb) {

Callers 6

PreDrawFrameMethod · 0.80
DrawMethod · 0.80
ApplyPostEffectsFunction · 0.80
UpdateShadowCacheFunction · 0.80
DrawMethod · 0.80
DrawImGuiCameraPreviewFunction · 0.80

Calls 3

EnsureInVRAMMethod · 0.80
returnTextureMethod · 0.80
validMethod · 0.45

Tested by

no test coverage detected