mirror of
https://github.com/ggerganov/ggwave.git
synced 2026-02-24 16:16:10 +08:00
Waver emscripten build (#8)
* waver: add indicators for new messages and capture data * wip * waver : adding favicons * waver : emscripten build ready
This commit is contained in:
@@ -25,6 +25,13 @@ bool ImGui_PreInit() {
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);
|
||||
#elif __EMSCRIPTEN__
|
||||
const char* glsl_version = "#version 100";
|
||||
//const char* glsl_version = "#version 300 es";
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, 0);
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
|
||||
#else
|
||||
// GL 3.0 + GLSL 130
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, 0);
|
||||
@@ -46,6 +53,8 @@ ImGuiContext* ImGui_Init(SDL_Window* window, SDL_GLContext gl_context) {
|
||||
#if __APPLE__
|
||||
// GL 3.2 Core + GLSL 150
|
||||
const char* glsl_version = "#version 150";
|
||||
#elif __EMSCRIPTEN__
|
||||
const char* glsl_version = "#version 100";
|
||||
#else
|
||||
// GL 3.0 + GLSL 130
|
||||
const char* glsl_version = "#version 130";
|
||||
@@ -83,12 +92,7 @@ ImGuiContext* ImGui_Init(SDL_Window* window, SDL_GLContext gl_context) {
|
||||
// Setup Platform/Renderer bindings
|
||||
bool res = true;
|
||||
res &= ImGui_ImplSDL2_InitForOpenGL(window, gl_context);
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
res &= ImGui_ImplOpenGL3_Init("#version 300 es");
|
||||
#else
|
||||
res &= ImGui_ImplOpenGL3_Init(glsl_version);
|
||||
#endif
|
||||
|
||||
return res ? ctx : nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user