Skip to content

Commit

Permalink
added option to run compile time options as command line args to enab…
Browse files Browse the repository at this point in the history
…le/disable in runtime
  • Loading branch information
Mormert committed Feb 16, 2024
1 parent d7d3141 commit f2ae613
Show file tree
Hide file tree
Showing 151 changed files with 1,508 additions and 867 deletions.
28 changes: 18 additions & 10 deletions engine/3rdparty/ImGui/imgui_impl_opengl3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,14 @@

#include "imgui.h"
#include "imgui_impl_opengl3.h"

#include "jleBuildConfig.h"

#include <stdio.h>
#if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier
#include <stddef.h> // intptr_t
#else
#include <stdint.h> // intptr_t
#include <stdint.h> // intptr_t
#endif
#if defined(__APPLE__)
#include <TargetConditionals.h>
Expand Down Expand Up @@ -371,9 +374,10 @@ static void ImGui_ImplOpenGL3_SetupRenderState(ImDrawData* draw_data, int fb_wid
if (bd->GlVersion >= 310)
glDisable(GL_PRIMITIVE_RESTART);
#endif
#ifdef IMGUI_IMPL_HAS_POLYGON_MODE
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
#endif
JLE_EXEC_IF_NOT(JLE_BUILD_OPENGLES30)
{
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
}

// Support for GL 4.5 rarely used glClipControl(GL_UPPER_LEFT)
#if defined(GL_CLIP_ORIGIN)
Expand Down Expand Up @@ -460,9 +464,12 @@ void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data)
#ifdef IMGUI_IMPL_OPENGL_USE_VERTEX_ARRAY
GLuint last_vertex_array_object; glGetIntegerv(GL_VERTEX_ARRAY_BINDING, (GLint*)&last_vertex_array_object);
#endif
#ifdef IMGUI_IMPL_HAS_POLYGON_MODE
GLint last_polygon_mode[2]; glGetIntegerv(GL_POLYGON_MODE, last_polygon_mode);
#endif

GLint last_polygon_mode[2];
JLE_EXEC_IF_NOT(JLE_BUILD_OPENGLES30)
{
glGetIntegerv(GL_POLYGON_MODE, last_polygon_mode);
}
GLint last_viewport[4]; glGetIntegerv(GL_VIEWPORT, last_viewport);
GLint last_scissor_box[4]; glGetIntegerv(GL_SCISSOR_BOX, last_scissor_box);
GLenum last_blend_src_rgb; glGetIntegerv(GL_BLEND_SRC_RGB, (GLint*)&last_blend_src_rgb);
Expand Down Expand Up @@ -594,9 +601,10 @@ void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data)
if (bd->GlVersion >= 310) { if (last_enable_primitive_restart) glEnable(GL_PRIMITIVE_RESTART); else glDisable(GL_PRIMITIVE_RESTART); }
#endif

#ifdef IMGUI_IMPL_HAS_POLYGON_MODE
glPolygonMode(GL_FRONT_AND_BACK, (GLenum)last_polygon_mode[0]);
#endif
JLE_EXEC_IF_NOT(JLE_BUILD_OPENGLES30)
{
glPolygonMode(GL_FRONT_AND_BACK, (GLenum)last_polygon_mode[0]);
}
glViewport(last_viewport[0], last_viewport[1], (GLsizei)last_viewport[2], (GLsizei)last_viewport[3]);
glScissor(last_scissor_box[0], last_scissor_box[1], (GLsizei)last_scissor_box[2], (GLsizei)last_scissor_box[3]);
(void)bd; // Not all compilation paths use this
Expand Down
2 changes: 1 addition & 1 deletion engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ add_library(engine STATIC
"jleFullscreenRendering.cpp"
"jleDynamicLogAppender.cpp"
"jleShader.cpp"
"jleCommandArguments.cpp"
"jleTexture.cpp"
"jleWindow.cpp"
"jleTransform.cpp"
Expand Down Expand Up @@ -160,7 +161,6 @@ if (JLE_BUILD_EDITOR)
add_definitions(-DRMLUI_ENABLE_PROFILING)
add_subdirectory(3rdparty/git_submodules/tracy)
target_link_libraries(engine PUBLIC Tracy::TracyClient)

endif ()

# TODO: Move Assimp to be editor only
Expand Down
Loading

0 comments on commit f2ae613

Please sign in to comment.