[Renderers/SDL3] Add image rendering and scissor support to SDL3 renderer (#246)

This commit is contained in:
tomat 2025-02-12 21:02:06 +00:00 committed by GitHub
parent eeb4520f48
commit bc2548e3ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 46 additions and 6 deletions

View file

@ -23,6 +23,8 @@ typedef struct app_state {
ClayVideoDemo_Data demoData;
} AppState;
SDL_Surface *sample_image;
static inline Clay_Dimensions SDL_MeasureText(Clay_StringSlice text, Clay_TextElementConfig *config, void *userData)
{
TTF_Font **fonts = userData;
@ -81,6 +83,8 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
state->rendererData.fonts[FONT_ID] = font;
sample_image = IMG_Load("resources/sample.png");
/* Initialize Clay */
uint64_t totalMemorySize = Clay_MinMemorySize();
Clay_Arena clayMemory = (Clay_Arena) {