Emscripten expects GLES2 (WebGL 1).

This commit is contained in:
Bartosz Taudul 2022-09-30 00:39:42 +02:00
parent 1d482a417d
commit 863b36d04b
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
2 changed files with 14 additions and 2 deletions

View File

@ -1,6 +1,10 @@
#include "imgui/imgui_impl_glfw.h" #include "imgui/imgui_impl_glfw.h"
#include "imgui/imgui_impl_opengl3.h" #include "imgui/imgui_impl_opengl3.h"
#include "imgui/imgui_impl_opengl3_loader.h" #ifdef __EMSCRIPTEN__
# include <GLES2/gl2.h>
#else
# include "imgui/imgui_impl_opengl3_loader.h"
#endif
#include <chrono> #include <chrono>
#include <GLFW/glfw3.h> #include <GLFW/glfw3.h>
@ -80,7 +84,11 @@ Backend::Backend( const char* title, std::function<void()> redraw, RunQueue* mai
glfwSetWindowRefreshCallback( s_window, []( GLFWwindow* ) { s_redraw(); } ); glfwSetWindowRefreshCallback( s_window, []( GLFWwindow* ) { s_redraw(); } );
ImGui_ImplGlfw_InitForOpenGL( s_window, true ); ImGui_ImplGlfw_InitForOpenGL( s_window, true );
#ifdef __EMSCRIPTEN__
ImGui_ImplOpenGL3_Init( "#version 100" );
#else
ImGui_ImplOpenGL3_Init( "#version 150" ); ImGui_ImplOpenGL3_Init( "#version 150" );
#endif
s_redraw = redraw; s_redraw = redraw;
s_mainThreadTasks = mainThreadTasks; s_mainThreadTasks = mainThreadTasks;

View File

@ -1,6 +1,10 @@
#include <inttypes.h> #include <inttypes.h>
#include "../profiler/src/imgui/imgui_impl_opengl3_loader.h" #ifdef __EMSCRIPTEN__
# include <GLES2/gl2.h>
#else
# include "../profiler/src/imgui/imgui_impl_opengl3_loader.h"
#endif
#include "TracyTexture.hpp" #include "TracyTexture.hpp"
#ifndef COMPRESSED_RGB_S3TC_DXT1_EXT #ifndef COMPRESSED_RGB_S3TC_DXT1_EXT