File tree Expand file tree Collapse file tree 12 files changed +45
-16
lines changed Expand file tree Collapse file tree 12 files changed +45
-16
lines changed Original file line number Diff line number Diff line change @@ -49,3 +49,4 @@ CheckOptions:
4949 - { key: readability-identifier-length.MinimumVariableNameLength, value: 2 }
5050 - { key: readability-identifier-length.MinimumParameterNameLength, value: 2 }
5151 - { key: cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors, value: '1' }
52+ - { key: misc-include-cleaner.IgnoreHeaders, value: "SDL2/SDL\.h" }
Original file line number Diff line number Diff line change 11#include " Application.hpp"
22
3- #include < SDL.h>
4- #include < SDL_error.h>
5- #include < SDL_events.h>
6- #include < SDL_filesystem.h>
7- #include < SDL_video.h>
3+ #include < SDL2/SDL.h>
84#include < backends/imgui_impl_opengl3.h>
95#include < backends/imgui_impl_sdl2.h>
106#include < glad/glad.h>
@@ -180,10 +176,14 @@ ExitStatus App::Application::run() {
180176}
181177
182178void App::Application::stop () {
179+ APP_PROFILE_FUNCTION ();
180+
183181 m_running = false ;
184182}
185183
186184void Application::on_event (const SDL_WindowEvent& event) {
185+ APP_PROFILE_FUNCTION ();
186+
187187 switch (event.event ) {
188188 case SDL_WINDOWEVENT_CLOSE:
189189 return on_close ();
@@ -198,14 +198,20 @@ void Application::on_event(const SDL_WindowEvent& event) {
198198}
199199
200200void Application::on_minimize () {
201+ APP_PROFILE_FUNCTION ();
202+
201203 m_minimized = true ;
202204}
203205
204206void Application::on_shown () {
207+ APP_PROFILE_FUNCTION ();
208+
205209 m_minimized = false ;
206210}
207211
208212void Application::on_close () {
213+ APP_PROFILE_FUNCTION ();
214+
209215 stop ();
210216}
211217
Original file line number Diff line number Diff line change 11#pragma once
22
3- #include < SDL.h>
3+ #include < SDL2/ SDL.h>
44
55#include < memory>
66#include < string>
1010
1111namespace App {
1212
13- enum class ExitStatus : int { SUCCESS = 0 , FAILURE = 1 };
13+ enum class ExitStatus : std:: uint8_t { SUCCESS = 0 , FAILURE = 1 };
1414
1515class Application {
1616 public:
Original file line number Diff line number Diff line change 11#pragma once
22
3- #include < SDL.h>
3+ #include < SDL2/ SDL.h>
44#include < imgui.h>
55
66#include " Core/Window.hpp"
Original file line number Diff line number Diff line change 11#include " Window.hpp"
22
3- #include < SDL_video .h>
3+ #include < SDL2/SDL .h>
44#include < glad/glad.h>
55
66#include " Core/DPIHandler.hpp"
@@ -49,10 +49,14 @@ Window::~Window() {
4949}
5050
5151SDL_Window* Window::get_native_window () const {
52+ APP_PROFILE_FUNCTION ();
53+
5254 return m_window;
5355}
5456
5557SDL_GLContext Window::get_native_context () const {
58+ APP_PROFILE_FUNCTION ();
59+
5660 return m_gl_context;
5761}
5862
Original file line number Diff line number Diff line change 11#pragma once
22
3- #include < SDL.h>
3+ #include < SDL2/ SDL.h>
44
55#include < string>
66
Original file line number Diff line number Diff line change 11#include " Core/DPIHandler.hpp"
22
3- #include < SDL_video .h>
3+ #include < SDL2/SDL .h>
44#include < imgui.h>
55
66#include " Core/Debug/Instrumentor.hpp"
Original file line number Diff line number Diff line change 11#include " Core/Resources.hpp"
22
3- #include < SDL_filesystem .h>
3+ #include < SDL2/SDL .h>
44
55#include < filesystem>
66#include < string>
77#include < string_view>
88
9+ #include " Core/Debug/Instrumentor.hpp"
10+
911namespace App {
1012
1113static const std::string BASE_PATH{SDL_GetBasePath ()};
1214
1315std::filesystem::path Resources::resource_path (const std::filesystem::path& file_path) {
16+ APP_PROFILE_FUNCTION ();
17+
1418 std::filesystem::path font_path{BASE_PATH};
1519 font_path /= " ../share" ;
1620 font_path /= " fonts" / file_path;
1721 return font_path;
1822}
1923
2024std::filesystem::path Resources::font_path (const std::string_view& font_file) {
25+ APP_PROFILE_FUNCTION ();
26+
2127 return resource_path (font_file);
2228}
2329
Original file line number Diff line number Diff line change 11#include " Core/DPIHandler.hpp"
22
3- #include < SDL_video .h>
3+ #include < SDL2/SDL .h>
44#include < imgui.h>
55
66#include < cmath>
Original file line number Diff line number Diff line change 11#include " Core/Resources.hpp"
22
3- #include < SDL_filesystem .h>
3+ #include < SDL2/SDL .h>
44
55#include < filesystem>
66#include < string>
77#include < string_view>
88
9+ #include " Core/Debug/Instrumentor.hpp"
10+
911namespace App {
1012
1113static const std::string BASE_PATH{SDL_GetBasePath ()};
1214
1315std::filesystem::path Resources::resource_path (const std::filesystem::path& file_path) {
16+ APP_PROFILE_FUNCTION ();
17+
1418 std::filesystem::path font_path{BASE_PATH};
1519 font_path /= file_path;
1620 return font_path;
1721}
1822
1923std::filesystem::path Resources::font_path (const std::string_view& font_file) {
24+ APP_PROFILE_FUNCTION ();
25+
2026 return resource_path (font_file);
2127}
2228
You can’t perform that action at this time.
0 commit comments