Skip to content

Commit

Permalink
Fix #143
Browse files Browse the repository at this point in the history
  • Loading branch information
W2Wizard authored Oct 21, 2024
1 parent b8a3231 commit d2d64bb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/mlx_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,14 @@ mlx_t* mlx_init(int32_t width, int32_t height, const char* title, bool resize)
mlxctx->initialWidth = width;
mlxctx->initialHeight = height;

// NOTE(W2): For emscripten, this value will be ignored anyway.
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
#ifdef EMSCRIPTEN
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
glfwWindowHint(GLFW_DECORATED, GLFW_TRUE);
glfwWindowHint(GLFW_VISIBLE, GLFW_TRUE);
glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_DECORATED, GLFW_TRUE);
glfwWindowHint(GLFW_VISIBLE, GLFW_TRUE);
glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API);
#else
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
Expand Down

0 comments on commit d2d64bb

Please sign in to comment.