[nostaliga,turbine] Move rest of ImGui init to Turbine
This commit is contained in:
parent
37f6c388fc
commit
6593d429fe
@ -2,8 +2,6 @@
|
|||||||
* Copyright 2016 - 2023 Gary Talent (gary@drinkingtea.net). All rights reserved.
|
* Copyright 2016 - 2023 Gary Talent (gary@drinkingtea.net). All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <imgui_impl_opengl3.h>
|
|
||||||
|
|
||||||
#include <ox/std/array.hpp>
|
#include <ox/std/array.hpp>
|
||||||
#include <ox/std/fmt.hpp>
|
#include <ox/std/fmt.hpp>
|
||||||
#include <ox/std/vec.hpp>
|
#include <ox/std/vec.hpp>
|
||||||
@ -324,7 +322,6 @@ ox::Error initGfx(Context *ctx, const InitParams &initParams) noexcept {
|
|||||||
turbine::gl::addDrawer(*ctx->turbineCtx, &gctx->drawer);
|
turbine::gl::addDrawer(*ctx->turbineCtx, &gctx->drawer);
|
||||||
initSpritesBufferset(ctx, gctx->spriteShader, &gctx->spriteBlocks);
|
initSpritesBufferset(ctx, gctx->spriteShader, &gctx->spriteBlocks);
|
||||||
}
|
}
|
||||||
ImGui_ImplOpenGL3_Init(glutils::GlslVersion);
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
add_library(
|
add_library(
|
||||||
NostalgiaCore-Studio OBJECT
|
NostalgiaCore-Studio OBJECT
|
||||||
#import_tilesheet_wizard.cpp
|
|
||||||
module.cpp
|
module.cpp
|
||||||
#new_tilesheet_wizard.cpp
|
|
||||||
#newpalettewizard.cpp
|
|
||||||
paletteeditor.cpp
|
paletteeditor.cpp
|
||||||
paletteeditor-imgui.cpp
|
paletteeditor-imgui.cpp
|
||||||
tilesheeteditor-imgui.cpp
|
tilesheeteditor-imgui.cpp
|
||||||
@ -19,7 +16,7 @@ endif()
|
|||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
NostalgiaCore-Studio PUBLIC
|
NostalgiaCore-Studio PUBLIC
|
||||||
NostalgiaStudio
|
Studio
|
||||||
NostalgiaCore
|
NostalgiaCore
|
||||||
lodepng
|
lodepng
|
||||||
)
|
)
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include <glad/glad.h>
|
#include <glad/glad.h>
|
||||||
#include <GLFW/glfw3.h>
|
#include <GLFW/glfw3.h>
|
||||||
#include <imgui_impl_glfw.h>
|
#include <imgui_impl_glfw.h>
|
||||||
|
#include <imgui_impl_opengl3.h>
|
||||||
|
|
||||||
#include <ox/std/defines.hpp>
|
#include <ox/std/defines.hpp>
|
||||||
|
|
||||||
@ -228,6 +229,7 @@ ox::Error initGfx(Context &ctx) noexcept {
|
|||||||
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
|
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
|
||||||
//io.MouseDrawCursor = true;
|
//io.MouseDrawCursor = true;
|
||||||
ImGui_ImplGlfw_InitForOpenGL(gctx.window, true);
|
ImGui_ImplGlfw_InitForOpenGL(gctx.window, true);
|
||||||
|
ImGui_ImplOpenGL3_Init();
|
||||||
themeImgui();
|
themeImgui();
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
|
@ -84,6 +84,8 @@ ox::Error run(Context &ctx) noexcept {
|
|||||||
void shutdown(Context &ctx) noexcept {
|
void shutdown(Context &ctx) noexcept {
|
||||||
auto &gctx = static_cast<GlfwContext&>(ctx);
|
auto &gctx = static_cast<GlfwContext&>(ctx);
|
||||||
if (gctx.window) {
|
if (gctx.window) {
|
||||||
|
ImGui_ImplOpenGL3_Shutdown();
|
||||||
|
ImGui_ImplGlfw_Shutdown();
|
||||||
glfwDestroyWindow(gctx.window);
|
glfwDestroyWindow(gctx.window);
|
||||||
gctx.window = nullptr;
|
gctx.window = nullptr;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user