-
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.
Improved: Rendering API & Added: FontBatchRenderer
- Loading branch information
1 parent
17b3cf5
commit bf98ea1
Showing
26 changed files
with
925 additions
and
258 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
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,53 @@ | ||
#pragma once | ||
|
||
#include "Config.hpp" | ||
#include <string_view> | ||
#include <tuple> | ||
#include <vector> | ||
|
||
namespace Core { | ||
class DebugOpRecorder | ||
{ | ||
public: | ||
static inline auto instance() -> DebugOpRecorder& { | ||
static DebugOpRecorder dor {}; | ||
return dor; | ||
} | ||
|
||
inline void clear() { | ||
if constexpr (Config::DEBUG_LEVEL == Config::DebugInfo::all) { | ||
_ops.clear(); | ||
} | ||
} | ||
|
||
inline void push(std::string_view type [[maybe_unused]], std::string_view details [[maybe_unused]]) { | ||
if constexpr (Config::DEBUG_LEVEL == Config::DebugInfo::all) { | ||
try { | ||
_ops.emplace_back(type, details); | ||
} catch (const std::exception& e) { | ||
std::cerr << e.what() << '\n'; | ||
} | ||
} | ||
} | ||
|
||
inline auto get_formatted_ops() { | ||
std::string res {}; | ||
if constexpr (Config::DEBUG_LEVEL == Config::DebugInfo::all) { | ||
for (auto [core_type, details] : _ops) { | ||
res += " - "; | ||
res += core_type; | ||
res += ": \t"; | ||
res += details; | ||
res += "\n"; | ||
} | ||
} | ||
return res; | ||
} | ||
|
||
private: | ||
using Ops = std::vector<std::tuple<std::string_view, std::string_view>>; | ||
|
||
Ops _ops; | ||
DebugOpRecorder() = default; | ||
}; | ||
} |
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 |
---|---|---|
|
@@ -7,6 +7,9 @@ | |
|
||
#include <Utily/Utily.hpp> | ||
|
||
#include "Core/DebugOpRecorder.hpp" | ||
|
||
|
||
namespace Core { | ||
class OpenglContext | ||
{ | ||
|
This file was deleted.
Oops, something went wrong.
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.