Pixels, Surfaces, Renderer, oh my...

This commit is contained in:
BadQuanta
2026-05-11 10:28:21 +00:00
parent 97c8847eb0
commit 28e9c4ba18
35 changed files with 4578 additions and 1210 deletions
+27
View File
@@ -0,0 +1,27 @@
#pragma once
#include <SDL3/SDL.h>
/// @file Application.hpp
/// For complete documentation, see src/Application.cpp
namespace hdk::sdl {
/** SDL Requires this interface to be implemented by the application class. */
class AppInterface {
public:
virtual SDL_AppResult Event(SDL_Event* event) = 0;
virtual SDL_AppResult Init(int argc, char* argv[]) = 0;
virtual SDL_AppResult Iterate() = 0;
virtual void Quit(SDL_AppResult code) = 0;
};
/** I'm calling it a public application because the AppStatus member is publicly accessible and so can be
* modified directly by the rest of application logic that has access to this application instance via this subclass.
*/
class PublicApp : public AppInterface {
public:
SDL_AppResult AppStatus { SDL_APP_CONTINUE };
virtual SDL_AppResult Event(SDL_Event* event) override { return AppStatus; }
virtual SDL_AppResult Init(int argc, char* argv[]) override { return AppStatus; }
virtual SDL_AppResult Iterate() override { return AppStatus; }
virtual void Quit(SDL_AppResult code) override {
// Default quit behavior is to do nothing, allowing the app to control its own lifetime.
}
};
} // namespace hdk::sdl