mirror of
https://github.com/nicbarker/clay.git
synced 2026-02-06 12:48:49 +00:00
[Renderers/SDL3] Add image rendering and scissor support to SDL3 renderer (#246)
This commit is contained in:
parent
eeb4520f48
commit
bc2548e3ec
5 changed files with 46 additions and 6 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue