mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-22 22:33:43 -07:00
Use OpenGL2 on MacOS instead of OpenGL3
This commit is contained in:
parent
a87a5b92d5
commit
91da461caa
3 changed files with 21 additions and 2 deletions
|
@ -56,6 +56,7 @@ CXX_FILES := \
|
|||
$(shell find libultraship/Lib/Fast3D -name *.cpp) \
|
||||
$(shell find libultraship -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_sdl.cpp \
|
||||
libultraship/Lib/StrHash64.cpp \
|
||||
|
@ -80,6 +81,7 @@ INC_DIRS := $(addprefix -I, \
|
|||
libultraship/Lib/Fast3D/U64 \
|
||||
libultraship/Lib/spdlog \
|
||||
libultraship/Lib/spdlog/include \
|
||||
libultraship/Lib/ImGui \
|
||||
libultraship \
|
||||
)
|
||||
|
||||
|
|
|
@ -220,9 +220,9 @@ bool ImGui_ImplOpenGL3_Init(const char* glsl_version)
|
|||
if (imgl3wInit() != 0)
|
||||
{
|
||||
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;
|
||||
#endif
|
||||
//#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -27,8 +27,13 @@
|
|||
#include "Utils/StringHelper.h"
|
||||
|
||||
#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_sdl.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -153,7 +158,11 @@ namespace SohImGui {
|
|||
void ImGuiBackendInit() {
|
||||
switch (impl.backend) {
|
||||
case Backend::SDL:
|
||||
#ifdef __APPLE__
|
||||
ImGui_ImplOpenGL2_Init();
|
||||
#else
|
||||
ImGui_ImplOpenGL3_Init("#version 120");
|
||||
#endif
|
||||
break;
|
||||
|
||||
#if defined(ENABLE_DX11) || defined(ENABLE_DX12)
|
||||
|
@ -199,7 +208,11 @@ namespace SohImGui {
|
|||
void ImGuiBackendNewFrame() {
|
||||
switch (impl.backend) {
|
||||
case Backend::SDL:
|
||||
#ifdef __APPLE__
|
||||
ImGui_ImplOpenGL2_NewFrame();
|
||||
#else
|
||||
ImGui_ImplOpenGL3_NewFrame();
|
||||
#endif
|
||||
break;
|
||||
#if defined(ENABLE_DX11) || defined(ENABLE_DX12)
|
||||
case Backend::DX11:
|
||||
|
@ -214,7 +227,11 @@ namespace SohImGui {
|
|||
void ImGuiRenderDrawData(ImDrawData* data) {
|
||||
switch (impl.backend) {
|
||||
case Backend::SDL:
|
||||
#ifdef __APPLE__
|
||||
ImGui_ImplOpenGL2_RenderDrawData(data);
|
||||
#else
|
||||
ImGui_ImplOpenGL3_RenderDrawData(data);
|
||||
#endif
|
||||
break;
|
||||
#if defined(ENABLE_DX11) || defined(ENABLE_DX12)
|
||||
case Backend::DX11:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue