Removed the gui namespace

Moved panel_manager out of editor and into the core
gui_api_redesign
Joey Pollack 4 years ago
parent 0fb6e94a2f
commit 09953c0e7d

@ -77,6 +77,7 @@ set(LUNARIUM_SRC
"src/graphics/opengl/glShader.cpp" "src/graphics/opengl/glShader.cpp"
"src/gui/gui.cpp" "src/gui/gui.cpp"
"src/gui/panel.cpp" "src/gui/panel.cpp"
"src/gui/panel_manager.cpp"
"src/gui/console.cpp" "src/gui/console.cpp"
"src/internal_data/data_manager.cpp" "src/internal_data/data_manager.cpp"
"src/assets/asset_manager.cpp" "src/assets/asset_manager.cpp"

@ -93,12 +93,14 @@ Core:
To support larger region sizes without needing single images that are like 1048576x1048576 or some nonsense.] To support larger region sizes without needing single images that are like 1048576x1048576 or some nonsense.]
GUI: GUI:
☐ Improve the GUI API!
☐ Implement a better way to handle popup windows and context menus
✔ Dear ImGui class with basic initialization @done (9/10/2021, 1:42:19 PM) ✔ Dear ImGui class with basic initialization @done (9/10/2021, 1:42:19 PM)
✔ Debug log window @done (9/10/2021, 4:44:48 PM) ✔ Debug log window @done (9/10/2021, 4:44:48 PM)
✔ Add key to show debug log window @done (9/13/2021, 6:47:44 PM) ✔ Add key to show debug log window @done (9/13/2021, 6:47:44 PM)
☐ Add checkboxes to disable log categories and levels ☐ Add checkboxes to disable log categories and levels
✔ Add LUA Console window @done (10/26/2021, 4:43:41 PM) ✔ Add LUA Console window @done (10/26/2021, 4:43:41 PM)
Improve the interfaces for the Lua Editor and Console (partial transparancy for one thing) @high Improve the interfaces for the Lua Editor and Console (partial transparancy for one thing) @high @done(22-06-23 15:54)
FileBrowser: FileBrowser:
✔ Allow opening of listed directories @done (11/8/2021, 3:16:26 PM) ✔ Allow opening of listed directories @done (11/8/2021, 3:16:26 PM)
✔ Add indication that an item is directory @done (11/8/2021, 6:19:20 PM) ✔ Add indication that an item is directory @done (11/8/2021, 6:19:20 PM)

@ -423,7 +423,7 @@ namespace lunarium
// HELPERS // HELPERS
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
uint32_t Core::AddPanel(gui::Panel* p) uint32_t Core::AddPanel(Panel* p)
{ {
mPanels.push_back(p); mPanels.push_back(p);
return mPanels.size() - 1; return mPanels.size() - 1;

@ -64,7 +64,7 @@ namespace lunarium
{ {
uint32_t CoreConsole; uint32_t CoreConsole;
} mPanelIDs; } mPanelIDs;
std::vector<gui::Panel*> mPanels; std::vector<Panel*> mPanels;
// Log Files // Log Files
std::ofstream mMasterLogFile; std::ofstream mMasterLogFile;
@ -85,7 +85,7 @@ namespace lunarium
static InputManager& Input(); static InputManager& Input();
private: // HELPERS private: // HELPERS
uint32_t AddPanel(gui::Panel* p); uint32_t AddPanel(Panel* p);
void FreePanel(uint32_t id); void FreePanel(uint32_t id);
private: // HIDDEN METHODS private: // HIDDEN METHODS

@ -13,7 +13,7 @@
namespace lunarium namespace lunarium
{ {
class CoreConsole : public gui::Console class CoreConsole : public Console
{ {
public: public:
CoreConsole(); CoreConsole();

@ -15,8 +15,6 @@
#include <sstream> #include <sstream>
#include <iostream> #include <iostream>
namespace lunarium namespace lunarium
{
namespace gui
{ {
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// GUI LOG LISTENER // GUI LOG LISTENER
@ -46,7 +44,7 @@ namespace lunarium
// CONSOLE // CONSOLE
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Console::Console(const char* name) Console::Console(const char* name)
: Panel(name, gui::PanelDockZone::DDZ_NONE, false), : Panel(name, PanelDockZone::DDZ_NONE, false),
mbNewCommand(false), mRecalledCommand(-1), mIsFocused(false), mListener(nullptr), mbNewCommand(false), mRecalledCommand(-1), mIsFocused(false), mListener(nullptr),
mbOglDebug(false), mbInfoVerbose(false), mpListener(nullptr) mbOglDebug(false), mbInfoVerbose(false), mpListener(nullptr)
{ {
@ -222,4 +220,4 @@ namespace lunarium
return 0; return 0;
} }
}} }

@ -15,8 +15,6 @@
#include <vector> #include <vector>
namespace lunarium namespace lunarium
{
namespace gui
{ {
class Console; class Console;
@ -69,7 +67,7 @@ namespace lunarium
void CheckFocus(); void CheckFocus();
}; };
}} }
#endif // CONSOLE_H_ #endif // CONSOLE_H_

@ -18,6 +18,7 @@
namespace lunarium namespace lunarium
{ {
uint32_t GUI::LogCat = 0;
GUI* GUI::mpInstance = nullptr; GUI* GUI::mpInstance = nullptr;
GUI::GUI() GUI::GUI()
: mbIsInit(false)//, mbShowDemo(false) : mbIsInit(false)//, mbShowDemo(false)
@ -48,6 +49,9 @@ namespace lunarium
return OpRes::Fail("GUI is already initialized!"); return OpRes::Fail("GUI is already initialized!");
} }
LogCat = Logger::RegisterCategory("GUI");
mNextWindowID = 0;
IMGUI_CHECKVERSION(); IMGUI_CHECKVERSION();
ImGui::CreateContext(); ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO(); (void)io; ImGuiIO& io = ImGui::GetIO(); (void)io;
@ -146,6 +150,12 @@ namespace lunarium
} }
u32 GUI::GetNextWindowID()
{
return mNextWindowID++;
}
void GUI::SetStyle(GuiStyle style) void GUI::SetStyle(GuiStyle style)
{ {
// Reset the style // Reset the style

@ -9,6 +9,7 @@
#ifndef GUI_H_ #ifndef GUI_H_
#define GUI_H_ #define GUI_H_
#include <core/common_defs.h>
#include <utils/op_res.h> #include <utils/op_res.h>
#include <map> #include <map>
@ -41,6 +42,7 @@ namespace lunarium
class GUI class GUI
{ {
public: public:
static uint32_t LogCat;
static GUI& GetInstance(); static GUI& GetInstance();
static void FreeInstance(); static void FreeInstance();
OpRes Initialize(GLFWwindow* pWindow); OpRes Initialize(GLFWwindow* pWindow);
@ -55,6 +57,8 @@ namespace lunarium
void SetStyle(GuiStyle style); void SetStyle(GuiStyle style);
ImFont* GetFont(GuiFont font); ImFont* GetFont(GuiFont font);
u32 GetNextWindowID();
private: private:
GUI(); GUI();
GUI(const GUI&) = delete; GUI(const GUI&) = delete;
@ -63,6 +67,7 @@ namespace lunarium
private: private:
static GUI* mpInstance; static GUI* mpInstance;
bool mbIsInit; bool mbIsInit;
u32 mNextWindowID;
ImGuiStyle* mpBaseStyle; ImGuiStyle* mpBaseStyle;
std::map<GuiFont, ImFont*> mFonts; std::map<GuiFont, ImFont*> mFonts;
//bool mbShowDemo; //bool mbShowDemo;

@ -11,8 +11,6 @@
#include "dearimgui/imgui.h" #include "dearimgui/imgui.h"
namespace lunarium namespace lunarium
{
namespace gui
{ {
Panel::Panel(std::string name, PanelDockZone dock_zone, bool isOpen) Panel::Panel(std::string name, PanelDockZone dock_zone, bool isOpen)
: mIsOpen(isOpen), mPanelName(name), mDockZone(dock_zone) : mIsOpen(isOpen), mPanelName(name), mDockZone(dock_zone)
@ -73,5 +71,5 @@ namespace gui
mWidth = s.x; mWidth = s.x;
mHeight = s.y; mHeight = s.y;
} }
}
} }

@ -1,5 +1,5 @@
/****************************************************************************** /******************************************************************************
* File - iPanel.h * File - panel.h
* Author - Joey Pollack * Author - Joey Pollack
* Date - 2021/11/01 (y/m/d) * Date - 2021/11/01 (y/m/d)
* Mod Date - 2021/11/01 (y/m/d) * Mod Date - 2021/11/01 (y/m/d)
@ -10,14 +10,13 @@
#define PANEL_H_ #define PANEL_H_
#include "panel_defs.h" #include "panel_defs.h"
#include "panel_manager.h"
#include <string> #include <string>
struct ImGuiInputTextCallbackData; struct ImGuiInputTextCallbackData;
namespace lunarium namespace lunarium
{
namespace gui
{ {
class Panel class Panel
{ {
@ -46,7 +45,10 @@ namespace gui
protected: protected:
void UpdateMetaInfo(); void UpdateMetaInfo();
private:
friend class PanelManager;
}; };
}} }
#endif // PANEL_H_ #endif // PANEL_H_

@ -9,7 +9,7 @@
#ifndef PANEL_DEFS_H_ #ifndef PANEL_DEFS_H_
#define PANEL_DEFS_H_ #define PANEL_DEFS_H_
namespace lunarium { namespace gui namespace lunarium
{ {
enum PanelDockZone enum PanelDockZone
{ {
@ -22,6 +22,6 @@ namespace lunarium { namespace gui
DDZ_NONE DDZ_NONE
}; };
}} }
#endif // PANEL_DEFS_H_ #endif // PANEL_DEFS_H_

@ -7,36 +7,30 @@
******************************************************************************/ ******************************************************************************/
#include "panel_manager.h" #include "panel_manager.h"
#include "editor.h" #include "gui.h"
#include <gui/panel.h>
#include <utils/logger.h> #include <utils/logger.h>
#include <dearimgui/imgui_internal.h> // To use the DockWindowXXX methods #include <dearimgui/imgui_internal.h> // To use the DockWindowXXX methods
#include <filesystem> #include <filesystem>
// Panels // Panels
#include "panels/about.h"
#include "panels/asset_browser.h"
#include "panels/world_tree.h"
#include "panels/world_view.h"
#include "panels/properties_view.h"
using namespace lunarium::gui;
namespace lunarium { namespace editor namespace lunarium
{ {
PanelManager::PanelManager() PanelManager::PanelManager()
: mpEditor(nullptr), mResetDockSpace(false), mDockSpaceID(0), mSplitBottom(false) : mResetDockSpace(false), mDockSpaceID(0), mSplitBottom(false)
{ {
} }
OpRes PanelManager::Initialize(Editor* editor, std::string name, bool split_bottom) OpRes PanelManager::Initialize(std::string name, bool split_bottom)
{ {
mpEditor = editor;
mName = name; mName = name;
mSplitBottom = split_bottom; mSplitBottom = split_bottom;
memset(&mWindowClass, 0, sizeof(ImGuiWindowClass)); memset(&mWindowClass, 0, sizeof(ImGuiWindowClass));
mWindowClass.ClassId = mpEditor->GetNextWindowID(); mWindowClass.ClassId = GUI::GetInstance().GetNextWindowID();
if (!std::filesystem::exists("imgui.ini")) if (!std::filesystem::exists("imgui.ini"))
{ {
@ -52,7 +46,7 @@ namespace lunarium { namespace editor
} }
OpRes PanelManager::AddPanel(gui::Panel* panel, uint32_t& id) OpRes PanelManager::AddPanel(Panel* panel, uint32_t& id)
{ {
if (mPanelsByName.find(panel->GetName()) != mPanelsByName.end()) if (mPanelsByName.find(panel->GetName()) != mPanelsByName.end())
{ {
@ -97,7 +91,7 @@ namespace lunarium { namespace editor
return mPanels[id]; return mPanels[id];
} }
Logger::Warn(mpEditor->GetLogCat(), "Requested panel not found: %d", id); Logger::Warn(GUI::LogCat, "Requested panel not found: %d", id);
return nullptr; return nullptr;
} }
@ -162,13 +156,13 @@ namespace lunarium { namespace editor
{ {
//ImGuiViewport* Viewport = ImGui::GetMainViewport(); //ImGuiViewport* Viewport = ImGui::GetMainViewport();
ImGuiViewport* Viewport = ImGui::GetWindowViewport(); ImGuiViewport* Viewport = ImGui::GetWindowViewport();
ImGuiID windowID = mpEditor->GetNextWindowID(); ImGuiID windowID = GUI::GetInstance().GetNextWindowID();
std::string dock_name = mName; std::string dock_name = mName;
dock_name += " DockSpace"; dock_name += " DockSpace";
mDockSpaceID = ImGui::DockSpace(ImGui::GetID(dock_name.c_str()), ImVec2(0, 0), 0, &mWindowClass); mDockSpaceID = ImGui::DockSpace(ImGui::GetID(dock_name.c_str()), ImVec2(0, 0), 0, &mWindowClass);
if (!ImGui::DockBuilderGetNode(mDockSpaceID) || mResetDockSpace) if (!ImGui::DockBuilderGetNode(mDockSpaceID) || mResetDockSpace)
{ {
Logger::Trace(mpEditor->GetLogCat(), "Resetting Dockspace: %s", dock_name.c_str()); Logger::Trace(GUI::LogCat, "Resetting Dockspace: %s", dock_name.c_str());
mResetDockSpace = false; mResetDockSpace = false;
ImGui::DockBuilderRemoveNode(mDockSpaceID); ImGui::DockBuilderRemoveNode(mDockSpaceID);
@ -215,4 +209,4 @@ namespace lunarium { namespace editor
} }
} }
}} }

@ -9,9 +9,9 @@
#ifndef PANEL_MANAGER_H_ #ifndef PANEL_MANAGER_H_
#define PANEL_MANAGER_H_ #define PANEL_MANAGER_H_
#include "panel_defs.h"
#include <utils/op_res.h> #include <utils/op_res.h>
#include <dearimgui/imgui.h> #include <dearimgui/imgui.h>
#include <gui/panel.h>
#include <map> #include <map>
#include <vector> #include <vector>
@ -19,23 +19,22 @@ struct ImGuiWindowClass;
namespace lunarium{ namespace lunarium{
class IGraphics; class IGraphics;
namespace editor class Panel;
{
class Editor;
class PanelManager class PanelManager
{ {
public: public:
PanelManager(); PanelManager();
OpRes Initialize(Editor* editor, std::string name, bool split_bottom = false); OpRes Initialize(std::string name, bool split_bottom = false);
void Shutdown(); void Shutdown();
// Panel interface // Panel interface
[[nodiscard]] OpRes AddPanel(gui::Panel* panel, uint32_t& id); [[nodiscard]] OpRes AddPanel(Panel* panel, uint32_t& id);
void OpenPanel(uint32_t id); void OpenPanel(uint32_t id);
void ClosePanel(uint32_t id); void ClosePanel(uint32_t id);
bool IsOpen(uint32_t id); bool IsOpen(uint32_t id);
gui::Panel* GetPanel(uint32_t id); Panel* GetPanel(uint32_t id);
const ImGuiWindowClass* GetWindowClass() const; const ImGuiWindowClass* GetWindowClass() const;
// Docking // Docking
@ -48,21 +47,20 @@ namespace editor
void RenderPanels(); void RenderPanels();
private: private:
Editor* mpEditor;
std::string mName; std::string mName;
bool mSplitBottom; // If true the bottom dock node will also be split into left/right bool mSplitBottom; // If true the bottom dock node will also be split into left/right
bool mResetDockSpace; bool mResetDockSpace;
std::vector<gui::Panel*> mPanels; std::vector<Panel*> mPanels;
std::map<const char*, gui::Panel*> mPanelsByName; std::map<const char*, Panel*> mPanelsByName;
unsigned int mDockSpaceID; unsigned int mDockSpaceID;
ImGuiWindowClass mWindowClass; ImGuiWindowClass mWindowClass;
std::map<gui::PanelDockZone, unsigned int> mDockZoneIDs; std::map<PanelDockZone, unsigned int> mDockZoneIDs;
private: private:
void DestoryPanels(); void DestoryPanels();
}; };
}} }
#endif // PANEL_MANAGER_H_ #endif // PANEL_MANAGER_H_

@ -3,7 +3,6 @@
set(EDITOR_SRC set(EDITOR_SRC
"editor.cpp" "editor.cpp"
"editor_helpers.cpp" "editor_helpers.cpp"
"panel_manager.cpp"
"project.cpp" "project.cpp"
"component_guis.cpp" "component_guis.cpp"
"panels/about.cpp" "panels/about.cpp"

@ -9,7 +9,7 @@
#include "editor.h" #include "editor.h"
#include <utils/helpers.h> #include <utils/helpers.h>
#include "panel_manager.h" #include <gui/panel_manager.h>
#include <core/core.h> #include <core/core.h>
#include <core/version.h> #include <core/version.h>
#include <utils/logger.h> #include <utils/logger.h>
@ -46,7 +46,7 @@ namespace editor
Editor::Editor() Editor::Editor()
: mDoNewProject(false), mDoOpenProject(false), : mDoNewProject(false), mDoOpenProject(false),
mDoSaveProject(false), mDoSaveAs(false), mNextWindowID(0), mpMapEditor(nullptr) mDoSaveProject(false), mDoSaveAs(false), mpMapEditor(nullptr)
{ {
} }
@ -62,7 +62,7 @@ namespace editor
// Init editor panels // Init editor panels
mAboutPanel.SetOpen(false); mAboutPanel.SetOpen(false);
OpRes res = mPanelManager.Initialize(this, "Lunarium editor", true).LogIfFailed(LogCat); OpRes res = mPanelManager.Initialize("Lunarium editor", true).LogIfFailed(LogCat);
if (Failed(res)) if (Failed(res))
{ {
return res; return res;
@ -124,12 +124,6 @@ namespace editor
return LogCat; return LogCat;
} }
unsigned int Editor::GetNextWindowID()
{
return ++mNextWindowID;
}
bool Editor::IsToolOpen(ToolType type) const bool Editor::IsToolOpen(ToolType type) const
{ {
switch (type) switch (type)

@ -11,10 +11,10 @@
#include <core/run_mode.h> #include <core/run_mode.h>
#include <core/common_defs.h> #include <core/common_defs.h>
#include <gui/panel_manager.h>
#include <utils/op_res.h> #include <utils/op_res.h>
#include "project.h" #include "project.h"
#include "panel_manager.h"
#include "panels/about.h" #include "panels/about.h"
#include <filesystem> #include <filesystem>
@ -49,7 +49,6 @@ namespace lunarium { namespace editor
uint32_t GetLogCat() const; uint32_t GetLogCat() const;
unsigned int GetNextWindowID();
bool IsToolOpen(ToolType type) const; bool IsToolOpen(ToolType type) const;
void ChangeWorld(lunarium::World* pWorld); void ChangeWorld(lunarium::World* pWorld);
@ -67,7 +66,6 @@ namespace lunarium { namespace editor
Project mProject; Project mProject;
// Tools // Tools
unsigned int mNextWindowID;
MapEditor* mpMapEditor; MapEditor* mpMapEditor;
// Panels // Panels

@ -16,7 +16,7 @@ namespace lunarium
namespace editor namespace editor
{ {
AboutPanel::AboutPanel() AboutPanel::AboutPanel()
: Panel("About", gui::PanelDockZone::DDZ_NONE) : Panel("About", PanelDockZone::DDZ_NONE)
{ {
} }

@ -16,7 +16,7 @@ namespace lunarium
namespace editor namespace editor
{ {
class Editor; class Editor;
class AboutPanel : public gui::Panel class AboutPanel : public Panel
{ {
public: public:
AboutPanel(); AboutPanel();

@ -23,7 +23,7 @@ namespace lunarium
namespace editor namespace editor
{ {
AssetBrowser::AssetBrowser(std::filesystem::path dir, Editor* pEditor) AssetBrowser::AssetBrowser(std::filesystem::path dir, Editor* pEditor)
: Panel("Asset Browser", gui::PanelDockZone::DDZ_BOTTOM, true), : Panel("Asset Browser", PanelDockZone::DDZ_BOTTOM, true),
mAssetDirectory(dir), mpEditor(pEditor), mNewFolder(false), mSyncTree(false) mAssetDirectory(dir), mpEditor(pEditor), mNewFolder(false), mSyncTree(false)
{ {
} }

@ -19,7 +19,7 @@ namespace lunarium
{ {
namespace editor namespace editor
{ {
class AssetBrowser : public gui::Panel class AssetBrowser : public Panel
{ {
public: public:
AssetBrowser(std::filesystem::path dir, Editor* pEditor); AssetBrowser(std::filesystem::path dir, Editor* pEditor);

@ -17,7 +17,7 @@
namespace lunarium { namespace editor namespace lunarium { namespace editor
{ {
PropertiesView::PropertiesView() PropertiesView::PropertiesView()
: Panel("Properties", gui::PanelDockZone::DDZ_RIGHT, true), mpSelectedAsset(nullptr), mpSelectedEntity(nullptr) : Panel("Properties", PanelDockZone::DDZ_RIGHT, true), mpSelectedAsset(nullptr), mpSelectedEntity(nullptr)
{ {
} }

@ -20,7 +20,7 @@ namespace editor
{ {
class CustromProperty; class CustromProperty;
class EditorAsset; class EditorAsset;
class PropertiesView : public gui::Panel class PropertiesView : public Panel
{ {
public: public:

@ -20,7 +20,7 @@ namespace lunarium
namespace editor namespace editor
{ {
WorldTree::WorldTree() WorldTree::WorldTree()
: Panel("World Tree", gui::PanelDockZone::DDZ_LEFT, true), mpWorld(new lunarium::World), mDoNewEntity(false) : Panel("World Tree", PanelDockZone::DDZ_LEFT, true), mpWorld(new lunarium::World), mDoNewEntity(false)
{ {
} }

@ -17,7 +17,7 @@ namespace lunarium
namespace editor namespace editor
{ {
class WorldTree : public gui::Panel class WorldTree : public Panel
{ {
public: public:
WorldTree(); WorldTree();

@ -11,14 +11,14 @@
#include <world/world.h> #include <world/world.h>
#include <dearimgui/imgui.h> #include <dearimgui/imgui.h>
#include <editor/editor.h> #include <editor/editor.h>
#include "../panel_manager.h" #include <gui/panel_manager.h>
namespace lunarium namespace lunarium
{ {
namespace editor namespace editor
{ {
WorldView::WorldView() WorldView::WorldView()
: Panel("World View", gui::PanelDockZone::DDZ_CENTER ,true), mpWorld(nullptr) : Panel("World View", PanelDockZone::DDZ_CENTER ,true), mpWorld(nullptr)
{ {
} }

@ -19,7 +19,7 @@ namespace lunarium
namespace editor namespace editor
{ {
class Editor; class Editor;
class WorldView : public gui::Panel class WorldView : public Panel
{ {
public: public:
WorldView(); WorldView();

@ -43,7 +43,7 @@ namespace lunarium { namespace editor
} }
mpEditor = editor; mpEditor = editor;
if (Failed(mPanelManager.Initialize(mpEditor, "Map Editor").LogIfFailed(mpEditor->GetLogCat(), "Map Editor - "))) if (Failed(mPanelManager.Initialize("Map Editor").LogIfFailed(mpEditor->GetLogCat(), "Map Editor - ")))
{ {
return OpRes::Fail("Could not initialize the panel manager!"); return OpRes::Fail("Could not initialize the panel manager!");
} }

@ -13,7 +13,7 @@
#include <map> #include <map>
#include <string> #include <string>
#include <utils/op_res.h> #include <utils/op_res.h>
#include "../../panel_manager.h" #include <gui/panel_manager.h>
#include <editor/contents/definitions.h> #include <editor/contents/definitions.h>
namespace lunarium { namespace lunarium {

@ -21,7 +21,7 @@
namespace lunarium { namespace editor namespace lunarium { namespace editor
{ {
MapCanvas::MapCanvas(MapEditor* editor) MapCanvas::MapCanvas(MapEditor* editor)
: Panel("Map Canvas", gui::PanelDockZone::DDZ_CENTER, true), : Panel("Map Canvas", PanelDockZone::DDZ_CENTER, true),
mpMapEditor(editor), mpCanvasImage(nullptr), mMap(nullptr), mSelectedTile({-1, -1}), mFrameBuffer(-1), mMapSizeChanged(false), mpMapEditor(editor), mpCanvasImage(nullptr), mMap(nullptr), mSelectedTile({-1, -1}), mFrameBuffer(-1), mMapSizeChanged(false),
mZoomFactor(1.0f), mScrollDragged(false), mCurrentRegion({0, 0}), mRegionString("") mZoomFactor(1.0f), mScrollDragged(false), mCurrentRegion({0, 0}), mRegionString("")
{ {

@ -20,7 +20,7 @@ namespace lunarium { namespace editor
class MapEditor; class MapEditor;
class TileMap; class TileMap;
class MapCanvas : public gui::Panel class MapCanvas : public Panel
{ {
public: public:
MapCanvas(MapEditor* editor); MapCanvas(MapEditor* editor);

@ -20,7 +20,7 @@
namespace lunarium { namespace editor namespace lunarium { namespace editor
{ {
TileSetView::TileSetView(MapEditor* editor) TileSetView::TileSetView(MapEditor* editor)
: Panel("Tile Set View", gui::PanelDockZone::DDZ_RIGHT, true), : Panel("Tile Set View", PanelDockZone::DDZ_RIGHT, true),
mpEditor(editor), mpSelectedTileSet(nullptr), mpViewImage(nullptr), mFrameBuffer(-1), mpEditor(editor), mpSelectedTileSet(nullptr), mpViewImage(nullptr), mFrameBuffer(-1),
mViewOffset({0, 0}), mViewZoom(1.0f), mMouseDown(false) mViewOffset({0, 0}), mViewZoom(1.0f), mMouseDown(false)
{ {

@ -20,7 +20,7 @@ namespace lunarium { namespace editor
{ {
class MapEditor; class MapEditor;
class TileSet; class TileSet;
class TileSetView : public gui::Panel class TileSetView : public Panel
{ {
public: public:
TileSetView(MapEditor* editor); TileSetView(MapEditor* editor);

@ -9,7 +9,7 @@ target_include_directories(testbed
PUBLIC ../../../external/glad/include PUBLIC ../../../external/glad/include
PUBLIC ../../../external/glfw/include PUBLIC ../../../external/glfw/include
PUBLIC ../../../external/box2d/include PUBLIC ../../../external/box2d/include
PUBLIC ../../../external/dearimgui PUBLIC ../../../external
) )
target_link_libraries(testbed box2d dearimgui) target_link_libraries(testbed box2d dearimgui)
Loading…
Cancel
Save