From 0ce0d1f6b76c0e3e5c7b2a615050244b6a3658ce Mon Sep 17 00:00:00 2001 From: Morten Nobel-Joergensen Date: Fri, 27 Jul 2018 16:06:27 +0200 Subject: [PATCH 1/9] Version tick --- include/sre/Renderer.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sre/Renderer.hpp b/include/sre/Renderer.hpp index b98420d3..ad0c0e38 100755 --- a/include/sre/Renderer.hpp +++ b/include/sre/Renderer.hpp @@ -71,7 +71,7 @@ namespace sre { ~Renderer(); static constexpr int sre_version_major = 1; static constexpr int sre_version_minor = 1; - static constexpr int sre_version_point = 3; + static constexpr int sre_version_point = 4; glm::ivec2 getWindowSize(); // Return the current size of the window From 87620da39dc253edf3b01db60f0e1e8b01679af4 Mon Sep 17 00:00:00 2001 From: Morten Nobel-Joergensen Date: Fri, 21 Sep 2018 17:00:44 +0200 Subject: [PATCH 2/9] Let pivot be optional --- include/sre/SpriteAtlas.hpp | 3 +-- src/sre/SpriteAtlas.cpp | 9 +++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/sre/SpriteAtlas.hpp b/include/sre/SpriteAtlas.hpp index 8ea94a54..dd921023 100644 --- a/include/sre/SpriteAtlas.hpp +++ b/include/sre/SpriteAtlas.hpp @@ -21,7 +21,6 @@ // Data Format: JSON (Array) // Layout - Size constraints: POT (Power of 2) // Allow rotation: false -// Include pivot information (double click on a single sprite and check 'enable pivot points' // // The json layout is as follows // {"frames": [ // sprites must be defined as an array with the name frames @@ -32,7 +31,7 @@ // "trimmed": false, // trimmed must be true or false // "spriteSourceSize": {"x":0,"y":0,"w":100,"h":100}, // not used // "sourceSize": {"w":100,"h":100}, // not used -// "pivot": {"x":0.5,"y":0.5} // pivot point relative to frame. (Normalized values [0.0,1.0]) +// "pivot": {"x":0.5,"y":0.5} // pivot point relative to frame. (Normalized values [0.0,1.0]) (optional - default {0.5,0.5}) // }, // { // add as many sprites as needed // "filename": "berry.png", diff --git a/src/sre/SpriteAtlas.cpp b/src/sre/SpriteAtlas.cpp index dd8474c9..46c81695 100644 --- a/src/sre/SpriteAtlas.cpp +++ b/src/sre/SpriteAtlas.cpp @@ -87,8 +87,13 @@ std::shared_ptr SpriteAtlas::create(std::string jsonFile, std::shar sourceSize = size; } pos.y = texture->getHeight()-pos.y-size.y; - pivot.x = (float)spriteElement.get("pivot").get("x").get(); - pivot.y = (float)spriteElement.get("pivot").get("y").get(); + if (spriteElement.contains("pivot")){ + pivot.x = (float)spriteElement.get("pivot").get("x").get(); + pivot.y = (float)spriteElement.get("pivot").get("y").get(); + } else { + pivot.x = 0.5f; + pivot.y = 0.5f; + } if (flipAnchorY){ pivot.y = 1.0f - pivot.y; } From 211f1509f6d69d1e0d8eb7fe762a24aa6fa42fec Mon Sep 17 00:00:00 2001 From: Morten Nobel-Joergensen Date: Fri, 21 Sep 2018 22:35:35 +0200 Subject: [PATCH 3/9] Update ImGui to v1.65 Update ImGuiColorTextEdit --- submodules/CMakeLists.txt | 1 + submodules/ImGuiColorTextEdit | 2 +- submodules/imgui | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/submodules/CMakeLists.txt b/submodules/CMakeLists.txt index ccec1611..34166d09 100644 --- a/submodules/CMakeLists.txt +++ b/submodules/CMakeLists.txt @@ -4,6 +4,7 @@ file(GLOB EXTRA_SOURCE_FILES_ "ImGuiColorTextEdit/TextEditor.cpp" "imgui/imgui.cpp" "imgui/imgui_draw.cpp" + "imgui/imgui_widgets.cpp" ) if (NOT EXTRA_SOURCE_FILES_) diff --git a/submodules/ImGuiColorTextEdit b/submodules/ImGuiColorTextEdit index 3211b175..0ef8c9f4 160000 --- a/submodules/ImGuiColorTextEdit +++ b/submodules/ImGuiColorTextEdit @@ -1 +1 @@ -Subproject commit 3211b1756a942064bab5a340f1d6b59bae0812b5 +Subproject commit 0ef8c9f4b8b9dd0949ccf1a793abd8a054cd4c69 diff --git a/submodules/imgui b/submodules/imgui index 00418d13..e0cab566 160000 --- a/submodules/imgui +++ b/submodules/imgui @@ -1 +1 @@ -Subproject commit 00418d13e369bf53cc4b8f817eb10b8ce65f0904 +Subproject commit e0cab5664adf02c030f9cf2a05d2c334638a85f8 From 90524de45edb8aa3008e6e977bdae2c3f5a657f6 Mon Sep 17 00:00:00 2001 From: Morten Nobel-Joergensen Date: Sat, 22 Sep 2018 11:15:34 +0200 Subject: [PATCH 4/9] Update version history --- version-history.md | 1 + 1 file changed, 1 insertion(+) diff --git a/version-history.md b/version-history.md index 81c8f7b2..1cd66fbe 100644 --- a/version-history.md +++ b/version-history.md @@ -1,5 +1,6 @@ ## Version history + * 1.1.4 ImGUI 1.65. Sprite atlas. Make pivot point optional in JSON. * 1.1.3 Fix sprite atlas bug (Windows). * 1.1.2 Maintain uniforms on shader recompile. Add ImGui_RenderTexture(). Add SDLRenderer::setWindowIcon(). More strict resource management for shader code. * 1.1.1 Libraries as submodules. Mesh::MeshBuilder::recomputeNormals(). Mesh::MeshBuilder::recomputeTangents(). From c53eca3aa9ee6401f2727e7cb358b01f3b89d305 Mon Sep 17 00:00:00 2001 From: Morten Nobel-Joergensen Date: Sun, 23 Sep 2018 21:35:15 +0200 Subject: [PATCH 5/9] Improve CMake (better error message about uninitialized recursive submodules) --- submodules/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/CMakeLists.txt b/submodules/CMakeLists.txt index 34166d09..41a14a51 100644 --- a/submodules/CMakeLists.txt +++ b/submodules/CMakeLists.txt @@ -8,7 +8,7 @@ file(GLOB EXTRA_SOURCE_FILES_ ) if (NOT EXTRA_SOURCE_FILES_) - message( FATAL_ERROR "Cannot find submodules used in SimpleRenderEngine. Run 'git submodule update --init' or checkout full project using 'git clone --recurse-submodules '") + message( FATAL_ERROR "Cannot find submodules used in SimpleRenderEngine. Run 'git submodule update --init --recursive' or checkout full project using 'git clone --recurse-submodules '") endif() set(EXTRA_SOURCE_FILES ${EXTRA_SOURCE_FILES_} CACHE PATH "" FORCE) \ No newline at end of file From aeba0caf6a8ceb82ff23cfaacc9e7d5ece36da6b Mon Sep 17 00:00:00 2001 From: Morten Nobel-Joergensen Date: Tue, 25 Sep 2018 10:30:23 +0200 Subject: [PATCH 6/9] Fix GUI issue in VR example --- examples/14_spinning-primitives-openvr.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/14_spinning-primitives-openvr.cpp b/examples/14_spinning-primitives-openvr.cpp index bd00bbb4..e9389303 100644 --- a/examples/14_spinning-primitives-openvr.cpp +++ b/examples/14_spinning-primitives-openvr.cpp @@ -65,6 +65,7 @@ class SpinningPrimitivesOpenVRExample { } } } + }; r.frameRender = [&](){ render(); @@ -80,6 +81,7 @@ class SpinningPrimitivesOpenVRExample { .withFramebuffer(fb) .withCamera(cam) .withSkybox(skybox) + .withGUI(false) .build(); render(renderPass); }; From 2f6bdb5f72f63b881c6690aaec3f30fbba32c3b7 Mon Sep 17 00:00:00 2001 From: Morten Nobel-Joergensen Date: Wed, 26 Sep 2018 12:52:51 +0200 Subject: [PATCH 7/9] Add GL_SILENCE_DEPRECATION on macOs --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 668ad500..dce63ef3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,7 @@ set(SRE_INCLUDE_DIRS ${SDL2_INCLUDE_DIR}) # FIND OPENGL ######################################################### IF(APPLE) + add_definitions(-DGL_SILENCE_DEPRECATION) list(APPEND SRE_INCLUDE_DIRS /System/Library/Frameworks) FIND_LIBRARY(OpenGL_LIBRARY OpenGL ) MARK_AS_ADVANCED (OpenGL_LIBRARY) From 058d6b4f8cbfaf42c8812a57066996e9f7ba503f Mon Sep 17 00:00:00 2001 From: Morten Nobel-Joergensen Date: Wed, 26 Sep 2018 12:58:40 +0200 Subject: [PATCH 8/9] Fix Mojave issues --- src/sre/Renderer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/sre/Renderer.cpp b/src/sre/Renderer.cpp index 68804b95..7ae59b65 100755 --- a/src/sre/Renderer.cpp +++ b/src/sre/Renderer.cpp @@ -14,6 +14,7 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; } #endif +#include #include "sre/Log.hpp" #include "sre/VR.hpp" @@ -46,6 +47,11 @@ namespace sre { instance = this; glcontext = SDL_GL_CreateContext(window); +#if __APPLE__ + SDL_PumpEvents(); + auto winSize = getWindowSize(); + SDL_SetWindowSize(window, winSize.x, winSize.y); +#endif if (!glcontext) { int major, minor; bool supported = getMaximumOpenGLSupport(&major, &minor); From b5435c8791fcef3ccc636d67dfe1adba3fd73dbc Mon Sep 17 00:00:00 2001 From: Morten Nobel-Joergensen Date: Wed, 26 Sep 2018 13:00:04 +0200 Subject: [PATCH 9/9] Fix Mojave issues --- version-history.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version-history.md b/version-history.md index 1cd66fbe..0ac8f067 100644 --- a/version-history.md +++ b/version-history.md @@ -1,6 +1,6 @@ ## Version history - * 1.1.4 ImGUI 1.65. Sprite atlas. Make pivot point optional in JSON. + * 1.1.4 ImGUI 1.65. Sprite atlas. Make pivot point optional in JSON. Fix Mojave black screen issue (OpenGL) * 1.1.3 Fix sprite atlas bug (Windows). * 1.1.2 Maintain uniforms on shader recompile. Add ImGui_RenderTexture(). Add SDLRenderer::setWindowIcon(). More strict resource management for shader code. * 1.1.1 Libraries as submodules. Mesh::MeshBuilder::recomputeNormals(). Mesh::MeshBuilder::recomputeTangents().