-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
689 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#pragma once | ||
|
||
#define GLFW_INCLUDE_NONE | ||
#include <GLFW/glfw3.h> | ||
#include <glad/glad.h> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
#pragma once | ||
|
||
#include "jenjin/gameobject.h" | ||
|
||
namespace Jenjin::Editor::Widgets { | ||
bool transformWidget( | ||
Jenjin::GameObject::Transform | ||
*transform); // Returns true if the transform was changed | ||
*transform); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#pragma once | ||
|
||
#include <sol/forward.hpp> | ||
#include <sol/sol.hpp> | ||
#include <unordered_map> | ||
|
||
namespace Jenjin { | ||
class LuaManager { | ||
public: | ||
LuaManager(); | ||
|
||
// Used to manage loading and executing Lua scripts | ||
// from files and directories | ||
void LoadDirectory(const std::string &directory); | ||
void LoadFile(const std::string &file); | ||
void ReloadScripts(const std::string &directory); | ||
|
||
// One-shot Lua script execution | ||
void Execute(const std::string &script); | ||
void ExecuteFile(const std::string &file); | ||
|
||
// Utilities for calling Lua functions collected from files | ||
// NOTE: This is not related to one-shot `Execute`/`ExecuteFile` | ||
// calls. This is for `LoadFile`, `LoadDirectory`, etc. | ||
void Ready(); | ||
void Update(); | ||
|
||
// Getters | ||
sol::state *GetLuaState() { return &lua; } | ||
|
||
private: | ||
sol::state lua; | ||
|
||
std::unordered_map<std::string, | ||
std::pair<sol::safe_function, sol::safe_function>> | ||
functions = {}; | ||
}; | ||
} // namespace Jenjin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.