diff --git a/libultraship/libultraship/Lib/Fast3D/gfx_opengl.cpp b/libultraship/libultraship/Lib/Fast3D/gfx_opengl.cpp index b42b21b2a..a3eef6355 100644 --- a/libultraship/libultraship/Lib/Fast3D/gfx_opengl.cpp +++ b/libultraship/libultraship/Lib/Fast3D/gfx_opengl.cpp @@ -1,7 +1,5 @@ #include "../../Window.h" #ifdef ENABLE_OPENGL -#endif -#if 1 #include #include @@ -460,13 +458,12 @@ static struct ShaderProgram* gfx_opengl_create_and_load_new_shader(uint64_t shad vs_buf[vs_len] = '\0'; fs_buf[fs_len] = '\0'; - /*puts("Vertex shader:"); + /*puts("Vertex shader:"); puts(vs_buf); puts("Fragment shader:"); puts(fs_buf); puts("End");*/ - const GLchar *sources[2] = { vs_buf, fs_buf }; const GLint lengths[2] = { (GLint) vs_len, (GLint) fs_len }; GLint success; @@ -479,9 +476,9 @@ static struct ShaderProgram* gfx_opengl_create_and_load_new_shader(uint64_t shad GLint max_length = 0; glGetShaderiv(vertex_shader, GL_INFO_LOG_LENGTH, &max_length); char error_log[1024]; - fprintf(stderr, "Vertex shader compilation failed\n"); + //fprintf(stderr, "Vertex shader compilation failed\n"); glGetShaderInfoLog(vertex_shader, max_length, &max_length, &error_log[0]); - fprintf(stderr, "%s\n", &error_log[0]); + //fprintf(stderr, "%s\n", &error_log[0]); abort(); } diff --git a/libultraship/libultraship/Lib/Fast3D/gfx_sdl2.cpp b/libultraship/libultraship/Lib/Fast3D/gfx_sdl2.cpp index c10573fb1..67846a598 100644 --- a/libultraship/libultraship/Lib/Fast3D/gfx_sdl2.cpp +++ b/libultraship/libultraship/Lib/Fast3D/gfx_sdl2.cpp @@ -139,17 +139,6 @@ static void gfx_sdl_init(const char *game_name, bool start_in_fullscreen) { SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); -#if 0 -#ifdef __APPLE__ - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); - // This is important on macOS - SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG); - // specify depth buffer, etc -#endif -#endif - #ifndef __linux #ifndef __APPLE__ timer = CreateWaitableTimer(nullptr, false, nullptr); diff --git a/libultraship/libultraship/Lib/ImGui/backends/imgui_impl_glfw.cpp b/libultraship/libultraship/Lib/ImGui/backends/imgui_impl_glfw.cpp index 366782485..4a5a9855d 100644 --- a/libultraship/libultraship/Lib/ImGui/backends/imgui_impl_glfw.cpp +++ b/libultraship/libultraship/Lib/ImGui/backends/imgui_impl_glfw.cpp @@ -126,7 +126,7 @@ struct ImGui_ImplGlfw_Data GLFWcharfun PrevUserCallbackChar; GLFWmonitorfun PrevUserCallbackMonitor; - ImGui_ImplGlfw_Data() { /*memset(this, 0, sizeof(*this));*/ } + ImGui_ImplGlfw_Data() { memset(this, 0, sizeof(*this)); } }; // Backend data stored in io.BackendPlatformUserData to allow support for multiple Dear ImGui contexts diff --git a/libultraship/libultraship/Lib/ImGui/backends/imgui_impl_opengl3.cpp b/libultraship/libultraship/Lib/ImGui/backends/imgui_impl_opengl3.cpp index 9ff0e80c2..54adf5ad2 100644 --- a/libultraship/libultraship/Lib/ImGui/backends/imgui_impl_opengl3.cpp +++ b/libultraship/libultraship/Lib/ImGui/backends/imgui_impl_opengl3.cpp @@ -216,13 +216,11 @@ bool ImGui_ImplOpenGL3_Init(const char* glsl_version) IM_ASSERT(io.BackendRendererUserData == NULL && "Already initialized a renderer backend!"); // Initialize our loader -#if !defined(IMGUI_IMPL_OPENGL_ES2) && !defined(IMGUI_IMPL_OPENGL_ES3) && !defined(IMGUI_IMPL_OPENGL_LOADER_CUSTOM) || 0 +#if !defined(IMGUI_IMPL_OPENGL_ES2) && !defined(IMGUI_IMPL_OPENGL_ES3) && !defined(IMGUI_IMPL_OPENGL_LOADER_CUSTOM) if (imgl3wInit() != 0) { fprintf(stderr, "Failed to initialize OpenGL loader!\n"); -#ifndef __APPLE__ // this is ok due to shared library cache return false; -#endif } #endif diff --git a/libultraship/libultraship/Lib/ImGui/backends/imgui_impl_opengl3_loader.h b/libultraship/libultraship/Lib/ImGui/backends/imgui_impl_opengl3_loader.h index e24760df7..99e9435d4 100644 --- a/libultraship/libultraship/Lib/ImGui/backends/imgui_impl_opengl3_loader.h +++ b/libultraship/libultraship/Lib/ImGui/backends/imgui_impl_opengl3_loader.h @@ -652,8 +652,12 @@ static int parse_version(void) return GL3W_ERROR_INIT; glGetIntegerv(GL_MAJOR_VERSION, &version.major); glGetIntegerv(GL_MINOR_VERSION, &version.minor); + + #ifndef __APPLE__ if (version.major < 3) return GL3W_ERROR_OPENGL_VERSION; + #endif + return GL3W_OK; }