MCPcopy Create free account
hub / github.com/TomClabault/HIPRT-Path-Tracer / resize_framebuffer

Method resize_framebuffer

src/UI/DisplayView/DisplayViewSystem.cpp:118–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118void DisplayViewSystem::resize_framebuffer()
119{
120 glDeleteTextures(1, &m_fbo_texture);
121 glGenTextures(1, &m_fbo_texture);
122 glBindTexture(GL_TEXTURE_2D, m_fbo_texture);
123
124 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, m_render_window->get_width(), m_render_window->get_height(), 0, GL_RGB, GL_UNSIGNED_BYTE, NULL);
125
126 // GL_NEAREST because we don't want to linearly interpolate between those beautiful pixels, THAT'S DISGUSTING!
127 // We want maximum monte carlo noise crispiness!
128 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
129 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
130
131 glBindFramebuffer(GL_FRAMEBUFFER, m_framebuffer);
132 glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_fbo_texture, 0);
133}
134
135bool DisplayViewSystem::update_selected_display_view()
136{

Callers

nothing calls this directly

Calls 2

get_widthMethod · 0.45
get_heightMethod · 0.45

Tested by

no test coverage detected