Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion EclipseEngine/EclipseEditor/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void App::AddModule(Module* module, bool activate)

bool App::PreUpdate()
{
editorCamera->UpdateMatrix(0.1f, 200.0f);
editorCamera->UpdateMatrix(0.1f, 1000.0f);
for (std::list<Module*>::iterator it = modules.begin(); it != modules.end(); it++)
{
if ((*it)->active == false) continue;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions EclipseEngine/EclipseEditor/Grid.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class Grid
Shader* shader;
VAO vao;

const float gridSize = 50.0f; // Size of the grid
const int gridLines = 30; // Number of lines in each direction
const float gridSize = 500.0f; // Size of the grid
const int gridLines = 100; // Number of lines in each direction
const float lineSpacing = gridSize / gridLines;
};

Expand Down
9 changes: 8 additions & 1 deletion EclipseEngine/EclipseEditor/MenuPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,20 @@ void MenuPanel::Render() {
m_PanelHandler.TogglePanel("Hierarchy Panel");
}

// Toggle for the Hierarchy panel
// Toggle for the Console panel
bool isConsolePanelVisible = m_PanelHandler.GetPanelVisibility("Console Panel");
ImGui::MenuItem("Console Panel", nullptr, &isConsolePanelVisible);
if (ImGui::IsItemClicked()) {
m_PanelHandler.TogglePanel("Console Panel");
}

// Toggle node editor
bool isNodePanelVisible = m_PanelHandler.GetPanelVisibility("Node Editor Panel");
ImGui::MenuItem("Node Editor Panel", nullptr, &isNodePanelVisible);
if (ImGui::IsItemClicked()) {
m_PanelHandler.TogglePanel("Node Editor Panel");
}

ImGui::EndMenu();
}

Expand Down
7 changes: 7 additions & 0 deletions EclipseEngine/EclipseEditor/MenuPanel.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef MENU_PANEL_H
#define MENU_PANEL_H

#include "EclipseEngine/Texture.h"

#include "Panel.h"
#include "PanelHandler.h" // PanelHandler for toggling panels
#include "HierarchyPanel.h"
Expand All @@ -22,6 +24,11 @@ class MenuPanel : public Panel

PanelHandler& m_PanelHandler; // Reference to PanelHandler
SystemState m_SystemState = SystemState::Stopped;

private:
std::unique_ptr<Texture> play;
std::unique_ptr<Texture> pause;
std::unique_ptr<Texture> stop;
};

#endif // MENU_PANEL_H
24 changes: 12 additions & 12 deletions EclipseEngine/EclipseEditor/ViewportPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ ViewportPanel::ViewportPanel(const std::string& name, Framebuffer* framebuffer,
m_Rot = std::make_unique<Texture>("EditorResources/rot.png", "icon", 0, GL_RGBA, GL_UNSIGNED_BYTE);
m_Sca = std::make_unique<Texture>("EditorResources/sca.png", "icon", 0, GL_RGBA, GL_UNSIGNED_BYTE);
m_Skybox = std::make_unique<Texture>("EditorResources/skybox.png", "icon", 0, GL_RGBA, GL_UNSIGNED_BYTE);
m_Grid = std::make_unique<Texture>("EditorResources/grid.png", "icon", 0, GL_RGBA, GL_UNSIGNED_BYTE);
}

void ViewportPanel::Render()
{
if (IsVisible())
{
ImGuiWindowFlags windowFlags = ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse/* | ImGuiWindowFlags_NoMove*/;
ImGuiWindowFlags windowFlags = ImGuiWindowFlags_NoScrollbar/* | ImGuiWindowFlags_NoScrollWithMouse | ImGuiWindowFlags_NoMove*/;
ImGui::Begin("Viewport", nullptr, windowFlags);

bool isViewportHovered = ImGui::IsWindowHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup);
Expand Down Expand Up @@ -124,23 +125,22 @@ void ViewportPanel::Render()
// Toggle buttons
ImGui::SetCursorScreenPos(ImVec2(viewportPosition.x + 600, viewportPosition.y + 15));

//if (ImGui::ImageButton(reinterpret_cast<void*>(static_cast<intptr_t>(m_Framebuffer->GetTextureID())), ImVec2(15, 15)))
//{
// showGrid = !showGrid;
//}
//ImGui::SameLine();
if (ImGui::ImageButton(reinterpret_cast<void*>(static_cast<intptr_t>(m_Grid->textureID)), ImVec2(15, 15)))
{
showGrid = !showGrid;
}
ImGui::SameLine();

if (ImGui::ImageButton(reinterpret_cast<void*>(static_cast<intptr_t>(m_Skybox->textureID)), ImVec2(20, 20)))
if (ImGui::ImageButton(reinterpret_cast<void*>(static_cast<intptr_t>(m_Skybox->textureID)), ImVec2(15, 15)))
{
showSkybox = !showSkybox;
}
ImGui::SameLine();

//if (ImGui::ImageButton(reinterpret_cast<void*>(static_cast<intptr_t>(m_Framebuffer->GetTextureID())), ImVec2(15, 15)))
//{
// showGizmo = !showGizmo;
//}

if (ImGui::ImageButton(reinterpret_cast<void*>(static_cast<intptr_t>(m_Framebuffer->GetTextureID())), ImVec2(15, 15)))
{
showGizmo = !showGizmo;
}

// Function to set button colors based on the active state
auto setActiveButtonColor = [](bool isActive) {
Expand Down
1 change: 1 addition & 0 deletions EclipseEngine/EclipseEditor/ViewportPanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class ViewportPanel : public Panel
std::unique_ptr<Texture> m_Rot;
std::unique_ptr<Texture> m_Sca;
std::unique_ptr<Texture> m_Skybox;
std::unique_ptr<Texture> m_Grid;

const float iconSize = 25.0f;
const float iconSpacing = 5.0f; //spacing between icons
Expand Down
62 changes: 31 additions & 31 deletions EclipseEngine/EclipseEditor/imgui.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,72 +9,72 @@ Size=400,400
Collapsed=0

[Window][Console Panel]
Pos=1200,674
Size=295,165
Pos=1167,598
Size=328,241
Collapsed=0
DockId=0x0000000A,0

[Window][Hierarchy Panel]
Pos=1200,29
Size=295,182
Pos=1167,29
Size=328,232
Collapsed=0
DockId=0x00000003,0

[Window][Inspector Panel]
Pos=1200,213
Size=295,459
Pos=1167,263
Size=328,333
Collapsed=0
DockId=0x00000009,0

[Window][Game]
Pos=853,29
Size=345,230
Pos=863,29
Size=302,301
Collapsed=0
DockId=0x0000000B,0

[Window][Viewport]
Pos=5,29
Size=846,590
Size=856,567
Collapsed=0
DockId=0x0000000E,0

[Window][Assets Panel]
Pos=5,621
Size=1193,218
Pos=5,598
Size=1160,241
Collapsed=0
DockId=0x00000007,0

[Window][FPS Panel]
Pos=1258,788
Size=360,224
Pos=1257,803
Size=361,209
Collapsed=0
DockId=0x00000008,0

[Window][Delete Confirmation]
Pos=568,254
Size=334,77
Size=283,77
Collapsed=0

[Window][Node Editor Panel]
Pos=853,261
Size=345,358
Pos=863,332
Size=302,264
Collapsed=0
DockId=0x0000000D,0

[Docking][Data]
DockSpace ID=0x3FC20BEE Window=0x9A404470 Pos=39,86 Size=1490,810 Split=X
DockNode ID=0x00000005 Parent=0x3FC20BEE SizeRef=1613,810 Split=Y
DockNode ID=0x00000001 Parent=0x00000005 SizeRef=1490,763 Split=X Selected=0x13926F0B
DockNode ID=0x0000000E Parent=0x00000001 SizeRef=846,229 Selected=0x13926F0B
DockNode ID=0x0000000F Parent=0x00000001 SizeRef=345,229 Split=Y Selected=0x26816F31
DockNode ID=0x0000000B Parent=0x0000000F SizeRef=395,403 CentralNode=1 Selected=0x26816F31
DockNode ID=0x0000000D Parent=0x0000000F SizeRef=395,358 Selected=0xF45274E3
DockNode ID=0x00000002 Parent=0x00000005 SizeRef=1490,218 Split=X Selected=0xE86CE49B
DockNode ID=0x00000007 Parent=0x00000002 SizeRef=925,246 Selected=0xE86CE49B
DockNode ID=0x00000008 Parent=0x00000002 SizeRef=266,246 Selected=0x9985E007
DockNode ID=0x00000006 Parent=0x3FC20BEE SizeRef=295,810 Split=Y Selected=0xE096E5AE
DockNode ID=0x00000003 Parent=0x00000006 SizeRef=204,221 Selected=0xE096E5AE
DockNode ID=0x00000004 Parent=0x00000006 SizeRef=204,760 Split=Y Selected=0x0E9312B4
DockNode ID=0x00000009 Parent=0x00000004 SizeRef=299,558 Selected=0x0E9312B4
DockNode ID=0x0000000A Parent=0x00000004 SizeRef=299,200 Selected=0x3A3DF33A
DockSpace ID=0x3FC20BEE Window=0x9A404470 Pos=233,135 Size=1490,810 Split=X
DockNode ID=0x00000005 Parent=0x3FC20BEE SizeRef=1160,810 Split=Y
DockNode ID=0x00000001 Parent=0x00000005 SizeRef=1490,567 Split=X Selected=0x13926F0B
DockNode ID=0x0000000E Parent=0x00000001 SizeRef=856,229 Selected=0x13926F0B
DockNode ID=0x0000000F Parent=0x00000001 SizeRef=302,229 Split=Y Selected=0x26816F31
DockNode ID=0x0000000B Parent=0x0000000F SizeRef=395,301 CentralNode=1 Selected=0x26816F31
DockNode ID=0x0000000D Parent=0x0000000F SizeRef=395,264 Selected=0xF45274E3
DockNode ID=0x00000002 Parent=0x00000005 SizeRef=1490,241 Split=X Selected=0xE86CE49B
DockNode ID=0x00000007 Parent=0x00000002 SizeRef=1250,246 Selected=0xE86CE49B
DockNode ID=0x00000008 Parent=0x00000002 SizeRef=361,246 Selected=0x9985E007
DockNode ID=0x00000006 Parent=0x3FC20BEE SizeRef=328,810 Split=Y Selected=0xE096E5AE
DockNode ID=0x00000003 Parent=0x00000006 SizeRef=204,232 Selected=0xE096E5AE
DockNode ID=0x00000004 Parent=0x00000006 SizeRef=204,576 Split=Y Selected=0x0E9312B4
DockNode ID=0x00000009 Parent=0x00000004 SizeRef=298,333 Selected=0x0E9312B4
DockNode ID=0x0000000A Parent=0x00000004 SizeRef=298,241 Selected=0x3A3DF33A

8 changes: 8 additions & 0 deletions EclipseEngine/EclipseEngine/Logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ void Logger::Log(const std::string& message, const std::string& item)
if (m_Callback) { m_Callback(message + item); }
}

void Logger::Log(const std::string& message, int item)
{
if (m_LogStream.is_open()) { m_LogStream << message << std::endl; }
std::cout << message << item << std::endl;

if (m_Callback) { m_Callback(message + std::to_string(item)); }
}

void Logger::SetCallback(LogCallback callback)
{
m_Callback = callback; // Set callback for external logging
Expand Down
1 change: 1 addition & 0 deletions EclipseEngine/EclipseEngine/Logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class Logger
static void Init(const std::string& filename = "log.txt");
static void Log(const std::string& message);
static void Log(const std::string& message, const std::string& item);
static void Log(const std::string& message, int item);
static void SetCallback(LogCallback callback); // callback
static void Close();

Expand Down
Binary file added Images/v0.9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.