ImGui::Begin call moved to the Panel class

Adds PreBegin in case code needs to be run just before ImGui::Begin is called
gui_api_redesign
Joey Pollack 4 years ago
parent 09953c0e7d
commit 578bd98b40

@ -15,7 +15,8 @@
namespace lunarium namespace lunarium
{ {
CoreConsole::CoreConsole() CoreConsole::CoreConsole()
: Console("Core Console"), mDockIsInit(false) : Console("Core Console", ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoTitleBar
| ImGuiWindowFlags_NoCollapse), mDockIsInit(false)
{ {
} }
@ -24,14 +25,10 @@ namespace lunarium
{ {
} }
bool CoreConsole::DoFrame() void CoreConsole::PreBegin()
{ {
InitDock(); InitDock();
if (!mIsOpen)
return false;
ImGuiViewport* pView = ImGui::GetMainViewport(); ImGuiViewport* pView = ImGui::GetMainViewport();
float myHeight = pView->WorkSize.y / 3.0f; float myHeight = pView->WorkSize.y / 3.0f;
@ -41,18 +38,11 @@ namespace lunarium
ImGui::SetNextWindowPos(ImVec2(pView->WorkPos.x, y), ImGuiCond_Always); ImGui::SetNextWindowPos(ImVec2(pView->WorkPos.x, y), ImGuiCond_Always);
ImGui::SetNextWindowSize(ImVec2(pView->WorkSize.x, myHeight), ImGuiCond_Always); ImGui::SetNextWindowSize(ImVec2(pView->WorkSize.x, myHeight), ImGuiCond_Always);
ImGui::SetNextWindowBgAlpha(alpha); ImGui::SetNextWindowBgAlpha(alpha);
if (!ImGui::Begin(GetName(), &mIsOpen, ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoTitleBar
| ImGuiWindowFlags_NoCollapse))
{
ImGui::End();
return mIsOpen;
} }
void CoreConsole::DoFrame()
{
Console::DoFrame(); Console::DoFrame();
ImGui::End();
return mIsOpen;
} }
void CoreConsole::InitDock() void CoreConsole::InitDock()

@ -18,7 +18,8 @@ namespace lunarium
public: public:
CoreConsole(); CoreConsole();
virtual ~CoreConsole(); virtual ~CoreConsole();
bool DoFrame() override; void DoFrame() override;
void PreBegin();
private: private:
void InitDock(); void InitDock();

@ -43,8 +43,8 @@ namespace lunarium
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// CONSOLE // CONSOLE
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Console::Console(const char* name) Console::Console(const char* name, int window_flags)
: Panel(name, PanelDockZone::DDZ_NONE, false), : Panel(name, PanelDockZone::DDZ_NONE, false, window_flags),
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)
{ {
@ -67,20 +67,14 @@ namespace lunarium
void Console::Update(float dt) void Console::Update(float dt)
{ {
}
bool Console::DoFrame()
{
if (Core::Input().IsKeyDown(KeyCode::ESCAPE, true)) if (Core::Input().IsKeyDown(KeyCode::ESCAPE, true))
{ {
mRecalledCommand = -1; mRecalledCommand = -1;
} }
}
void Console::DoFrame()
{
float history_height = ImGui::GetWindowSize().y - 45; float history_height = ImGui::GetWindowSize().y - 45;
ImGui::BeginChild("history", ImVec2(0, history_height), false, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_NoMove); ImGui::BeginChild("history", ImVec2(0, history_height), false, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_NoMove);
mIsFocused = ImGui::IsWindowFocused(ImGuiFocusedFlags_RootAndChildWindows); mIsFocused = ImGui::IsWindowFocused(ImGuiFocusedFlags_RootAndChildWindows);
@ -156,8 +150,6 @@ namespace lunarium
ImGui::EndChild(); ImGui::EndChild();
//mAlpha = mIsFocused ? 0.75f : 0.5f; //mAlpha = mIsFocused ? 0.75f : 0.5f;
return mIsOpen;
} }
const std::vector<std::string>* Console::GetCommandHistory() const const std::vector<std::string>* Console::GetCommandHistory() const

@ -32,10 +32,10 @@ namespace lunarium
class Console : public Panel class Console : public Panel
{ {
public: public:
Console(const char* name); Console(const char* name, int window_flags);
virtual ~Console(); virtual ~Console();
virtual void Update(float dt); virtual void Update(float dt);
virtual bool DoFrame(); virtual void DoFrame();
bool IsFocused() const; bool IsFocused() const;

@ -12,8 +12,8 @@
namespace lunarium namespace lunarium
{ {
Panel::Panel(std::string name, PanelDockZone dock_zone, bool isOpen) Panel::Panel(std::string name, PanelDockZone dock_zone, bool isOpen, int window_flags)
: mIsOpen(isOpen), mPanelName(name), mDockZone(dock_zone) : mIsOpen(isOpen), mPanelName(name), mDockZone(dock_zone), mWindowFlags(window_flags)
{ {
} }
@ -33,6 +33,12 @@ namespace lunarium
return mDockZone; return mDockZone;
} }
void Panel::SetWindowFlags(int flags)
{
mWindowFlags = flags;
}
void Panel::SetOpen(bool isOpen) void Panel::SetOpen(bool isOpen)
{ {
mIsOpen = isOpen; mIsOpen = isOpen;
@ -43,7 +49,6 @@ namespace lunarium
return mIsOpen; return mIsOpen;
} }
void Panel::GetPosition(int& x, int& y) const void Panel::GetPosition(int& x, int& y) const
{ {
x = mX; x = mX;
@ -56,11 +61,74 @@ namespace lunarium
h = mHeight; h = mHeight;
} }
void Panel::SetNumPushedStyles(int num)
{
mNumPushedStyles = num;
}
void Panel::Update(float dt) void Panel::Update(float dt)
{ {
} }
void Panel::PreBegin()
{
}
bool Panel::OnUIRender()
{
if (!mIsOpen)
return false;
PreBegin();
if (!ImGui::Begin(GetName(), &mIsOpen, (ImGuiWindowFlags) mWindowFlags))
{
ImGui::PopStyleVar(mNumPushedStyles);
ImGui::End();
return false;
}
ImGui::PopStyleVar(mNumPushedStyles);
UpdateMetaInfo();
DoFrame();
RunPopups();
ImGui::End();
return true;
}
OpRes Panel::AddPopup(int id, std::string name, std::function<bool(Panel*)> func)
{
auto iter = mPopups.find(id);
if (iter != mPopups.end())
{
return OpRes::Fail("A popup with id: %d alread exists. Existing name: %s, New Name: %s",
iter->first, iter->second->Name.c_str(), name.c_str());
}
mPopups[id] = new Popup { func, false, name };
return OpRes::OK();
}
void Panel::RunPopups()
{
for (auto iter = mPopups.begin(); iter != mPopups.end(); iter++)
{
Popup* ppu = iter->second;
if (ppu->IsOpen)
{
ppu->IsOpen = ppu->PopupFunc(this);
ImGui::OpenPopup(ppu->Name.c_str());
}
}
}
void Panel::UpdateMetaInfo() void Panel::UpdateMetaInfo()
{ {
ImVec2 p = ImGui::GetWindowPos(); ImVec2 p = ImGui::GetWindowPos();

@ -11,8 +11,11 @@
#include "panel_defs.h" #include "panel_defs.h"
#include "panel_manager.h" #include "panel_manager.h"
#include <utils/op_res.h>
#include <string> #include <string>
#include <map>
#include <functional>
struct ImGuiInputTextCallbackData; struct ImGuiInputTextCallbackData;
@ -21,30 +24,57 @@ namespace lunarium
class Panel class Panel
{ {
public: public:
Panel(std::string name, PanelDockZone dock_zone, bool isOpen = false);
struct Popup
{
std::function<bool(Panel*)> PopupFunc;
bool IsOpen;
std::string Name;
};
public:
Panel(std::string name, PanelDockZone dock_zone, bool isOpen = false, int window_flags = 0);
virtual ~Panel(); virtual ~Panel();
const char* GetName() const; const char* GetName() const;
virtual void Update(float dt); virtual void Update(float dt);
virtual bool DoFrame() = 0; bool OnUIRender();
void SetWindowFlags(int flags);
void SetOpen(bool isOpen); void SetOpen(bool isOpen);
bool IsOpen(); bool IsOpen();
void GetPosition(int& x, int& y) const; void GetPosition(int& x, int& y) const;
void GetSize(int& w, int& h) const; void GetSize(int& w, int& h) const;
PanelDockZone GetDockZone() const; PanelDockZone GetDockZone() const;
protected: OpRes AddPopup(int id, std::string name, std::function<bool(Panel*)>);
private:
std::string mPanelName; std::string mPanelName;
bool mIsOpen; bool mIsOpen;
PanelDockZone mDockZone; PanelDockZone mDockZone;
int mWindowFlags;
// TODO: Not sure I like this solution...
int mNumPushedStyles;
// Popups
std::map<int, Popup*> mPopups;
int mX; int mX;
int mY; int mY;
int mWidth; int mWidth;
int mHeight; int mHeight;
protected: private: // Helpers
void UpdateMetaInfo(); void UpdateMetaInfo();
void RunPopups();
protected:
virtual void PreBegin();
virtual void DoFrame() = 0;
void SetNumPushedStyles(int num);
void OpenPopup(int id);
private: private:
friend class PanelManager; friend class PanelManager;

@ -134,7 +134,7 @@ namespace lunarium
if ((*iter)->IsOpen()) if ((*iter)->IsOpen())
{ {
ImGui::SetNextWindowClass(&mWindowClass); ImGui::SetNextWindowClass(&mWindowClass);
(*iter)->DoFrame(); (*iter)->OnUIRender();
} }
} }
} }

@ -16,27 +16,18 @@ namespace lunarium
namespace editor namespace editor
{ {
AboutPanel::AboutPanel() AboutPanel::AboutPanel()
: Panel("About", PanelDockZone::DDZ_NONE) : Panel("About", PanelDockZone::DDZ_NONE, false, (int)ImGuiWindowFlags_NoCollapse)
{ {
} }
void AboutPanel::PreBegin()
bool AboutPanel::DoFrame()
{ {
if (!mIsOpen)
return false;
ImGui::SetNextWindowSize(ImVec2(300, ImGui::GetFrameHeight() * 20)); ImGui::SetNextWindowSize(ImVec2(300, ImGui::GetFrameHeight() * 20));
if (!ImGui::Begin(GetName(), &mIsOpen, ImGuiWindowFlags_NoCollapse ))
{
ImGui::End();
return false;
} }
void AboutPanel::DoFrame()
{
ImGui::TextWrapped("Lunarium Editor Version %s - Written by Joey Pollack", Version::GetVersion().ToString().c_str()); ImGui::TextWrapped("Lunarium Editor Version %s - Written by Joey Pollack", Version::GetVersion().ToString().c_str());
ImGui::End();
return true;
} }
} }
} }

@ -22,7 +22,8 @@ namespace editor
AboutPanel(); AboutPanel();
// Returns false if the window is closed // Returns false if the window is closed
bool DoFrame(); void PreBegin();
void DoFrame();
}; };
} }
} }

@ -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", PanelDockZone::DDZ_BOTTOM, true), : Panel("Asset Browser", PanelDockZone::DDZ_BOTTOM, true, (ImGuiWindowFlags)ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollbar),
mAssetDirectory(dir), mpEditor(pEditor), mNewFolder(false), mSyncTree(false) mAssetDirectory(dir), mpEditor(pEditor), mNewFolder(false), mSyncTree(false)
{ {
} }
@ -39,18 +39,8 @@ namespace editor
return mSelectedDir; return mSelectedDir;
} }
bool AssetBrowser::DoFrame() void AssetBrowser::DoFrame()
{ {
if (!mIsOpen)
return false;
if (!ImGui::Begin(GetName(), &mIsOpen, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollbar))
{
ImGui::End();
return false;
}
//DoNewFolder();
// Directory tree // Directory tree
// TODO: Figure out a better way to size stuff other // TODO: Figure out a better way to size stuff other
@ -74,9 +64,6 @@ namespace editor
DoContentArea(wind_size); DoContentArea(wind_size);
HandlePopupActions(); HandlePopupActions();
ImGui::End();
return true;
} }
void AssetBrowser::DoDirTree(std::filesystem::path dir) void AssetBrowser::DoDirTree(std::filesystem::path dir)
@ -233,6 +220,11 @@ namespace editor
} }
void AssetBrowser::DefinePopups()
{
}
void AssetBrowser::DoNewFolder() void AssetBrowser::DoNewFolder()
{ {
if (ImGui::BeginPopupContextItem("New Folder Name")) if (ImGui::BeginPopupContextItem("New Folder Name"))

@ -26,7 +26,7 @@ namespace editor
void SetAssetDirectory(std::filesystem::path dir); void SetAssetDirectory(std::filesystem::path dir);
bool DoFrame(); void DoFrame();
std::filesystem::path GetSelectedDirectory(); std::filesystem::path GetSelectedDirectory();
@ -46,6 +46,8 @@ namespace editor
bool mSyncTree; bool mSyncTree;
private: private:
void DefinePopups();
void HandlePopupActions(); void HandlePopupActions();
void HandleAssetDrop(std::filesystem::path dir); void HandleAssetDrop(std::filesystem::path dir);

@ -17,22 +17,14 @@
namespace lunarium { namespace editor namespace lunarium { namespace editor
{ {
PropertiesView::PropertiesView() PropertiesView::PropertiesView()
: Panel("Properties", PanelDockZone::DDZ_RIGHT, true), mpSelectedAsset(nullptr), mpSelectedEntity(nullptr) : Panel("Properties", PanelDockZone::DDZ_RIGHT, true, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollbar),
mpSelectedAsset(nullptr), mpSelectedEntity(nullptr)
{ {
} }
bool PropertiesView::DoFrame() void PropertiesView::DoFrame()
{ {
if (!mIsOpen)
return false;
if (!ImGui::Begin(GetName(), &mIsOpen, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollbar))
{
ImGui::End();
return false;
}
if (mpSelectedEntity) if (mpSelectedEntity)
{ {
// TODO: iterate through components // TODO: iterate through components
@ -42,8 +34,6 @@ namespace lunarium { namespace editor
} }
} }
ImGui::End();
return true;
} }
void PropertiesView::SetSelection(Entity* pEntity) void PropertiesView::SetSelection(Entity* pEntity)

@ -29,7 +29,7 @@ namespace editor
void SetSelection(Entity* pEntity); void SetSelection(Entity* pEntity);
void SetSelection(EditorAsset* pAsset); void SetSelection(EditorAsset* pAsset);
bool DoFrame(); void DoFrame();
private: private:
std::vector<CustromProperty*> mCustomProps; std::vector<CustromProperty*> mCustomProps;

@ -20,7 +20,8 @@ namespace lunarium
namespace editor namespace editor
{ {
WorldTree::WorldTree() WorldTree::WorldTree()
: Panel("World Tree", PanelDockZone::DDZ_LEFT, true), mpWorld(new lunarium::World), mDoNewEntity(false) : Panel("World Tree", PanelDockZone::DDZ_LEFT, true, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollbar),
mpWorld(new lunarium::World), mDoNewEntity(false)
{ {
} }
@ -35,17 +36,8 @@ namespace editor
return mpWorld; return mpWorld;
} }
bool WorldTree::DoFrame() void WorldTree::DoFrame()
{ {
if (!mIsOpen)
return false;
if (!ImGui::Begin(GetName(), &mIsOpen, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollbar))
{
ImGui::End();
return false;
}
if (ImGui::TreeNode("World Root") && mpWorld) if (ImGui::TreeNode("World Root") && mpWorld)
{ {
// List all world entities // List all world entities
@ -74,8 +66,6 @@ namespace editor
DoContextMenu(); DoContextMenu();
HandlePopupEvents(); HandlePopupEvents();
ImGui::End();
return true;
} }
void WorldTree::DoContextMenu() void WorldTree::DoContextMenu()

@ -25,7 +25,7 @@ namespace editor
void SetWorld(lunarium::World* pWorld); void SetWorld(lunarium::World* pWorld);
lunarium::World* GetWorld(); lunarium::World* GetWorld();
bool DoFrame(); void DoFrame();
private: private:
lunarium::World* mpWorld; lunarium::World* mpWorld;

@ -13,29 +13,16 @@
#include <editor/editor.h> #include <editor/editor.h>
#include <gui/panel_manager.h> #include <gui/panel_manager.h>
namespace lunarium namespace lunarium { namespace editor
{
namespace editor
{ {
WorldView::WorldView() WorldView::WorldView()
: Panel("World View", PanelDockZone::DDZ_CENTER ,true), mpWorld(nullptr) : Panel("World View", PanelDockZone::DDZ_CENTER, true, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollbar), mpWorld(nullptr)
{ {
} }
bool WorldView::DoFrame() void WorldView::DoFrame()
{
if (!mIsOpen)
return false;
if (!ImGui::Begin(GetName(), &mIsOpen, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollbar))
{ {
ImGui::End();
return false;
}
ImGui::End();
return true;
}
}
} }
}}

@ -23,7 +23,7 @@ namespace editor
{ {
public: public:
WorldView(); WorldView();
bool DoFrame(); void DoFrame();
void SetWorld(World* pWorld); void SetWorld(World* pWorld);
World* GetWorld(); World* GetWorld();

@ -21,7 +21,7 @@
namespace lunarium { namespace editor namespace lunarium { namespace editor
{ {
MapCanvas::MapCanvas(MapEditor* editor) MapCanvas::MapCanvas(MapEditor* editor)
: Panel("Map Canvas", PanelDockZone::DDZ_CENTER, true), : Panel("Map Canvas", PanelDockZone::DDZ_CENTER, true, ImGuiWindowFlags_NoScrollbar),
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("")
{ {
@ -129,23 +129,17 @@ namespace lunarium { namespace editor
} }
} }
bool MapCanvas::DoFrame()
{
if (!mIsOpen)
return false;
void MapCanvas::PreBegin()
{
ImGui::PushStyleVar( ImGuiStyleVar_WindowRounding, 0.0f ); ImGui::PushStyleVar( ImGuiStyleVar_WindowRounding, 0.0f );
ImGui::PushStyleVar( ImGuiStyleVar_WindowBorderSize, 0.0f ); ImGui::PushStyleVar( ImGuiStyleVar_WindowBorderSize, 0.0f );
ImGui::PushStyleVar( ImGuiStyleVar_WindowPadding, ImVec2( 0.0f, 0.0f ) ); ImGui::PushStyleVar( ImGuiStyleVar_WindowPadding, ImVec2( 0.0f, 0.0f ) );
if (!ImGui::Begin(GetName(), &mIsOpen, ImGuiWindowFlags_NoScrollbar)) SetNumPushedStyles(3);
{
ImGui::PopStyleVar(3);
ImGui::End();
return false;
} }
ImGui::PopStyleVar(3); void MapCanvas::DoFrame()
{
ImVec2 pos = ImGui::GetWindowPos(); ImVec2 pos = ImGui::GetWindowPos();
ImVec2 size = ImGui::GetWindowSize(); ImVec2 size = ImGui::GetWindowSize();
@ -189,8 +183,6 @@ namespace lunarium { namespace editor
} }
ImGui::EndChild(); ImGui::EndChild();
ImGui::End();
return mIsOpen;
} }
void MapCanvas::SetTileMap(TileMap* pMap) void MapCanvas::SetTileMap(TileMap* pMap)

@ -25,7 +25,8 @@ namespace lunarium { namespace editor
public: public:
MapCanvas(MapEditor* editor); MapCanvas(MapEditor* editor);
void Update(float delta); void Update(float delta);
bool DoFrame(); void PreBegin();
void DoFrame();
void SetTileMap(TileMap* pMap); void SetTileMap(TileMap* pMap);

@ -20,7 +20,7 @@
namespace lunarium { namespace editor namespace lunarium { namespace editor
{ {
TileSetView::TileSetView(MapEditor* editor) TileSetView::TileSetView(MapEditor* editor)
: Panel("Tile Set View", PanelDockZone::DDZ_RIGHT, true), : Panel("Tile Set View", PanelDockZone::DDZ_RIGHT, true, ImGuiWindowFlags_HorizontalScrollbar),
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)
{ {
@ -97,22 +97,16 @@ namespace lunarium { namespace editor
} }
} }
bool TileSetView::DoFrame() void TileSetView::PreBegin()
{ {
if (!mIsOpen)
return false;
ImGui::PushStyleVar( ImGuiStyleVar_WindowRounding, 0.0f ); ImGui::PushStyleVar( ImGuiStyleVar_WindowRounding, 0.0f );
ImGui::PushStyleVar( ImGuiStyleVar_WindowBorderSize, 0.0f ); ImGui::PushStyleVar( ImGuiStyleVar_WindowBorderSize, 0.0f );
ImGui::PushStyleVar( ImGuiStyleVar_WindowPadding, ImVec2( 0.0f, 0.0f ) ); ImGui::PushStyleVar( ImGuiStyleVar_WindowPadding, ImVec2( 0.0f, 0.0f ) );
if (!ImGui::Begin(GetName(), &mIsOpen, ImGuiWindowFlags_HorizontalScrollbar)) SetNumPushedStyles(3);
{
ImGui::PopStyleVar(3);
ImGui::End();
return false;
} }
ImGui::PopStyleVar(3);
void TileSetView::DoFrame()
{
ImVec2 window_size = ImGui::GetWindowSize(); ImVec2 window_size = ImGui::GetWindowSize();
float child_height = ImGui::GetFrameHeight() * 2; float child_height = ImGui::GetFrameHeight() * 2;
@ -159,9 +153,6 @@ namespace lunarium { namespace editor
ImGui::Image((ImTextureID)mpViewImage->GetGLTextureID64(), ImGui::Image((ImTextureID)mpViewImage->GetGLTextureID64(),
ImVec2(mpViewImage->GetWidth(), mpViewImage->GetHeight()), ImVec2(0, 1), ImVec2(1, 0)); // the last 2 params are flipping the image on the y ImVec2(mpViewImage->GetWidth(), mpViewImage->GetHeight()), ImVec2(0, 1), ImVec2(1, 0)); // the last 2 params are flipping the image on the y
} }
ImGui::End();
return mIsOpen;
} }
void TileSetView::ClearTileSets() void TileSetView::ClearTileSets()

@ -26,7 +26,8 @@ namespace lunarium { namespace editor
TileSetView(MapEditor* editor); TileSetView(MapEditor* editor);
void Update(float delta); void Update(float delta);
bool DoFrame(); void DoFrame();
void PreBegin();
void ClearTileSets(); void ClearTileSets();
void AddTileSet(TileSet* set); void AddTileSet(TileSet* set);

Loading…
Cancel
Save