1
0
mirror of synced 2025-02-02 12:27:25 +01:00

fix: Disable postprocessing shaders in Web version

This commit is contained in:
WerWolv 2025-01-22 19:55:17 +01:00
parent 637cdd7084
commit 69c5d553b5

View File

@ -77,7 +77,10 @@ namespace hex {
this->initImGui();
this->setupNativeWindow();
this->registerEventHandlers();
#if !defined(OS_WEB)
this->loadPostProcessingShader();
#endif
ContentRegistry::Settings::impl::store();
ContentRegistry::Settings::impl::load();
@ -791,10 +794,14 @@ namespace hex {
glfwMakeContextCurrent(backupContext);
if (shouldRender) {
#if !defined(OS_WEB)
if (m_postProcessingShader.isValid())
drawWithShader();
else
drawImGui();
#else
drawImGui();
#endif
glfwSwapBuffers(m_window);
}
@ -823,6 +830,7 @@ namespace hex {
}
void Window::drawWithShader() {
#if !defined(OS_WEB)
int displayWidth, displayHeight;
glfwGetFramebufferSize(m_window, &displayWidth, &displayHeight);
@ -891,6 +899,7 @@ namespace hex {
glDeleteBuffers(1, &quadVBO);
glDeleteTextures(1, &texture);
glDeleteFramebuffers(1, &fbo);
#endif
}
void Window::initGLFW() {