A "port" of SDL3 in C++.
This basically wrap SDL3 naturally OO looking concepts into proper C++ classes and objects, trying to as straightforward as possible. It was inspired on SDL2pp, with the addition of flexible memory management and wrappers for string and callbacks.
#include <iostream>
#include <SDL3pp/SDL3pp.h>
#include <SDL3pp/SDL3pp_main.h>
using namespace std::chrono_literals;
int main(int argc, char** argv)
{
{128, 128});
bool running = true;
while (running) {
}
}
return 0;
}
bool PollEvent(Event *event)
Poll for currently pending events.
Definition SDL3pp_events.h:1091
const char * GetBasePath()
Get the directory where the application was run from.
Definition SDL3pp_filesystem.h:138
void Init(InitFlags flags)
Initialize the SDL library.
Definition SDL3pp_init.h:255
void RenderTexture(TextureRef texture, OptionalRef< const FRectRaw > srcrect, OptionalRef< const FRectRaw > dstrect)
Copy a portion of the texture to the current rendering target at subpixel precision.
Definition SDL3pp_render.h:7101
void RenderFillRect(OptionalRef< const FRectRaw > rect)
Fill a rectangle on the current rendering target with the drawing color at subpixel precision.
Definition SDL3pp_render.h:7044
void CreateWindowAndRenderer(StringParam title, const PointRaw &size, WindowFlags window_flags, Window *window, Renderer *renderer)
Create a window and default renderer.
Definition SDL3pp_render.h:3643
void RenderClear()
Clear the current rendering target with the drawing color.
Definition SDL3pp_render.h:6875
void Present()
Update the screen with any rendering performed since the previous call.
Definition SDL3pp_render.h:7674
void SetDrawColorFloat(const FColorRaw &c)
Set the color used for drawing operations (Rect, Line and Clear).
Definition SDL3pp_render.h:6615
void Delay(Uint32 ms)
Wait a specified number of milliseconds before returning.
Definition SDL3pp_timer.h:292
constexpr EventType EVENT_QUIT
User-requested quit.
Definition SDL3pp_events.h:57
constexpr InitFlags INIT_VIDEO
INIT_VIDEO implies INIT_EVENTS, should be initialized on the main thread
Definition SDL3pp_init.h:71
The structure that defines a point (using floating point values).
Definition SDL3pp_rect.h:422
A rectangle stored using floating point values.
Definition SDL3pp_rect.h:1351
The structure that defines a point (using integers).
Definition SDL3pp_rect.h:97
A structure representing rendering state.
Definition SDL3pp_render.h:2087
An efficient driver-specific representation of pixel data.
Definition SDL3pp_render.h:2993
The struct used as an opaque handle to a window.
Definition SDL3pp_video.h:2724