-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v0.2: Add ui::Element, graphics::NineSlice, graphics::RoundedQuad (#76)
* Refactor ui::View into that + ui::Element. Move build version into generated header. * Add ui::Element::m_active * Add Engine::min_frame_time. Improve engine stats. * Make Primitive movable. Fix dangling access in `Resources::store()`. Add some consts in lit.frag. * Set window and framebuffer extents on startup. * Add graphics::Circle. * Move RenderLayer to dedicated header. * Move PolygonMode out of PipelineState into Renderer. * Add graphics::NineSlice * RoundedQuad, NineSlice. - Fix sector UVs and verts. * Add FDuration<PeriodT>. * Linearize all vertex colours.
- Loading branch information
Showing
47 changed files
with
589 additions
and
140 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
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,4 +1,5 @@ | ||
#pragma once | ||
#include <le/build_version.hpp> | ||
|
||
namespace le { | ||
constexpr bool debug_v = | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,34 @@ | ||
#pragma once | ||
#include <glm/vec3.hpp> | ||
#include <le/core/time.hpp> | ||
#include <le/core/wrap.hpp> | ||
#include <le/imcpp/common.hpp> | ||
#include <vector> | ||
|
||
namespace le::imcpp { | ||
class EngineStats { | ||
public: | ||
static constexpr std::size_t frame_time_count_v{200}; | ||
struct FpsRgb { | ||
std::uint32_t lower_bound{}; | ||
glm::vec3 rgb{}; | ||
}; | ||
|
||
static constexpr int frame_time_count_v{200}; | ||
|
||
auto draw_to(OpenWindow w) -> void; | ||
|
||
auto set_frame_time_count(std::size_t count) -> void; | ||
|
||
int frame_samples{frame_time_count_v}; | ||
std::vector<FpsRgb> fps_rgb{ | ||
FpsRgb{.lower_bound = 30, .rgb = {1.0f, 0.0f, 0.0f}}, | ||
FpsRgb{.lower_bound = 45, .rgb = {1.0f, 1.0f, 0.0f}}, | ||
FpsRgb{.lower_bound = 60, .rgb = {0.25f, 1.0f, 0.0f}}, | ||
}; | ||
|
||
private: | ||
auto push_frame_time(Duration dt) -> void; | ||
|
||
Wrap<std::vector<float>> m_frame_times{std::vector<float>(frame_time_count_v)}; | ||
Wrap<std::vector<float>> m_frame_times{}; | ||
}; | ||
} // namespace le::imcpp |
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,10 @@ | ||
#pragma once | ||
#include <le/core/version.hpp> | ||
|
||
namespace le { | ||
constexpr Version build_version_v{ | ||
.major = @PROJECT_VERSION_MAJOR@, | ||
.minor = @PROJECT_VERSION_MINOR@, | ||
.patch = @PROJECT_VERSION_PATCH@, | ||
}; | ||
} |
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.