Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dmon #417

Merged
merged 5 commits into from
Nov 8, 2023
Merged

Dmon #417

Show file tree
Hide file tree
Changes from 3 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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@
[submodule "Engine/Source/ThirdParty/imgui-node-editor"]
path = Engine/Source/ThirdParty/imgui-node-editor
url = https://github.com/thedmd/imgui-node-editor
[submodule "Engine/Source/ThirdParty/dmon"]
path = Engine/Source/ThirdParty/dmon
url = https://github.com/CatDogEngine/dmon
2 changes: 2 additions & 0 deletions Engine/Auto/Scripts/editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ project("Editor")
path.join(ThirdPartySourcePath, "imguizmo/*.cpp"),
path.join(ThirdPartySourcePath, "imgui-node-editor/*.h"),
path.join(ThirdPartySourcePath, "imgui-node-editor/*.cpp"),
path.join(ThirdPartySourcePath, "dmon/*.h"),
}

vpaths {
Expand Down Expand Up @@ -55,6 +56,7 @@ project("Editor")
path.join(ThirdPartySourcePath, "imgui"),
path.join(ThirdPartySourcePath, "imguizmo"),
path.join(ThirdPartySourcePath, "imgui-node-editor"),
path.join(ThirdPartySourcePath, "dmon"),
ThirdPartySourcePath,
}

Expand Down
38 changes: 34 additions & 4 deletions Engine/Source/Editor/EditorApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "Rendering/TerrainRenderer.h"
#include "Rendering/WorldRenderer.h"
#include "Rendering/ParticleRenderer.h"
#include "Resources/FileWatcher.h"
#include "Resources/FileWatcher.hpp"
#include "Resources/ResourceBuilder.h"
#include "Resources/ShaderBuilder.h"
#include "Scene/SceneDatabase.h"
Expand Down Expand Up @@ -113,9 +113,39 @@ void EditorApp::Init(engine::EngineInitArgs initArgs)
});
resourceThread.detach();

// TODO : Shader hot compile and load.
m_pFileWatcher = std::make_unique<FileWatcher>(CDENGINE_BUILTIN_SHADER_PATH);
m_pFileWatcher->EnableWatchSubTree();
#if 0
// Test code, will be removed in the next PR.
auto FileWatchCallback = [](
WatchID id, WatchAction action,
const char* rootDir, const char* filePath,
const char* oldFilePath, void* user)
{
switch (action)
{
case DMON_ACTION_CREATE:
CD_FATAL("Create");
break;

case DMON_ACTION_DELETE:
CD_FATAL("Delete");
break;

case DMON_ACTION_MODIFY:
CD_FATAL("Modify");
break;

case DMON_ACTION_MOVE:
CD_FATAL("Move");
break;

default:
CD_FATAL("Default");
}
};

m_pFileWatcher = std::make_unique<FileWatcher>();
m_pFileWatcher->Watch(CDENGINE_BUILTIN_SHADER_PATH, FileWatchCallback, DMON_WATCHFLAGS_RECURSIVE, nullptr);
#endif
}

void EditorApp::Shutdown()
Expand Down
228 changes: 0 additions & 228 deletions Engine/Source/Editor/Resources/FileWatcher.cpp

This file was deleted.

58 changes: 0 additions & 58 deletions Engine/Source/Editor/Resources/FileWatcher.h

This file was deleted.

Loading