Let’s use OpenGL 3 again

This commit is contained in:
David Chavez 2022-05-30 20:23:06 +02:00
commit 8ab2a0d073
3 changed files with 2 additions and 20 deletions

View file

@ -56,7 +56,6 @@ CXX_FILES := \
$(shell find libultraship/Lib/Fast3D -name *.cpp) \ $(shell find libultraship/Lib/Fast3D -name *.cpp) \
$(shell find libultraship -maxdepth 1 -name *.cpp) \ $(shell find libultraship -maxdepth 1 -name *.cpp) \
$(shell find libultraship/Lib/ImGui -maxdepth 1 -name *.cpp) \ $(shell find libultraship/Lib/ImGui -maxdepth 1 -name *.cpp) \
libultraship/Lib/ImGui/backends/imgui_impl_opengl2.cpp \
libultraship/Lib/ImGui/backends/imgui_impl_opengl3.cpp \ libultraship/Lib/ImGui/backends/imgui_impl_opengl3.cpp \
libultraship/Lib/ImGui/backends/imgui_impl_sdl.cpp \ libultraship/Lib/ImGui/backends/imgui_impl_sdl.cpp \
libultraship/Lib/StrHash64.cpp \ libultraship/Lib/StrHash64.cpp \

View file

@ -220,9 +220,9 @@ bool ImGui_ImplOpenGL3_Init(const char* glsl_version)
if (imgl3wInit() != 0) if (imgl3wInit() != 0)
{ {
fprintf(stderr, "Failed to initialize OpenGL loader!\n"); fprintf(stderr, "Failed to initialize OpenGL loader!\n");
//#ifndef __APPLE__ // this is ok due to shared library cache #ifndef __APPLE__ // this is ok due to shared library cache
return false; return false;
//#endif #endif
} }
#endif #endif

View file

@ -27,13 +27,8 @@
#include "Utils/StringHelper.h" #include "Utils/StringHelper.h"
#ifdef ENABLE_OPENGL #ifdef ENABLE_OPENGL
#ifdef __APPLE__
#include "Lib/ImGui/backends/imgui_impl_opengl2.h"
#include "Lib/ImGui/backends/imgui_impl_sdl.h"
#else
#include "Lib/ImGui/backends/imgui_impl_opengl3.h" #include "Lib/ImGui/backends/imgui_impl_opengl3.h"
#include "Lib/ImGui/backends/imgui_impl_sdl.h" #include "Lib/ImGui/backends/imgui_impl_sdl.h"
#endif
#endif #endif
@ -158,11 +153,7 @@ namespace SohImGui {
void ImGuiBackendInit() { void ImGuiBackendInit() {
switch (impl.backend) { switch (impl.backend) {
case Backend::SDL: case Backend::SDL:
#ifdef __APPLE__
ImGui_ImplOpenGL2_Init();
#else
ImGui_ImplOpenGL3_Init("#version 120"); ImGui_ImplOpenGL3_Init("#version 120");
#endif
break; break;
#if defined(ENABLE_DX11) || defined(ENABLE_DX12) #if defined(ENABLE_DX11) || defined(ENABLE_DX12)
@ -208,11 +199,7 @@ namespace SohImGui {
void ImGuiBackendNewFrame() { void ImGuiBackendNewFrame() {
switch (impl.backend) { switch (impl.backend) {
case Backend::SDL: case Backend::SDL:
#ifdef __APPLE__
ImGui_ImplOpenGL2_NewFrame();
#else
ImGui_ImplOpenGL3_NewFrame(); ImGui_ImplOpenGL3_NewFrame();
#endif
break; break;
#if defined(ENABLE_DX11) || defined(ENABLE_DX12) #if defined(ENABLE_DX11) || defined(ENABLE_DX12)
case Backend::DX11: case Backend::DX11:
@ -227,11 +214,7 @@ namespace SohImGui {
void ImGuiRenderDrawData(ImDrawData* data) { void ImGuiRenderDrawData(ImDrawData* data) {
switch (impl.backend) { switch (impl.backend) {
case Backend::SDL: case Backend::SDL:
#ifdef __APPLE__
ImGui_ImplOpenGL2_RenderDrawData(data);
#else
ImGui_ImplOpenGL3_RenderDrawData(data); ImGui_ImplOpenGL3_RenderDrawData(data);
#endif
break; break;
#if defined(ENABLE_DX11) || defined(ENABLE_DX12) #if defined(ENABLE_DX11) || defined(ENABLE_DX12)
case Backend::DX11: case Backend::DX11: