Current status of SDL.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
#include <SDL3/SDL.h>
|
||||
#include <hdk/sdl.hpp>
|
||||
/// @file Application.hpp
|
||||
/// For complete documentation, see src/Application.cpp
|
||||
namespace hdk::sdl {
|
||||
@@ -24,4 +24,25 @@ namespace hdk::sdl {
|
||||
// Default quit behavior is to do nothing, allowing the app to control its own lifetime.
|
||||
}
|
||||
};
|
||||
/** Defines basically everything except for Init */
|
||||
class ProtectedApp : public AppInterface {
|
||||
protected:
|
||||
SDL_AppResult AppStatus { SDL_APP_CONTINUE };
|
||||
const sdl::Log& AppLog { sdl::Log::Application };
|
||||
public:
|
||||
sdl::evt::AllTypes events;
|
||||
virtual SDL_AppResult Event(SDL_Event* event) override {
|
||||
events.Trigger(event);
|
||||
return AppStatus;
|
||||
}
|
||||
grid::eps::Conduit<> OnIterate;
|
||||
|
||||
virtual SDL_AppResult Iterate() override {
|
||||
OnIterate();
|
||||
return AppStatus;
|
||||
}
|
||||
virtual void Quit(SDL_AppResult code) override {
|
||||
AppLog.Debug("Quit called with code %d", code);
|
||||
}
|
||||
};
|
||||
} // namespace hdk::sdl
|
||||
Reference in New Issue
Block a user