mirror of
https://github.com/nicbarker/clay.git
synced 2025-09-18 04:26:18 +00:00
Merge 69921e898a
into 0d6969c8c3
This commit is contained in:
commit
dd453b5a98
|
@ -4,10 +4,17 @@
|
|||
#include <SDL3_ttf/SDL_ttf.h>
|
||||
#include <SDL3_image/SDL_image.h>
|
||||
|
||||
typedef struct {
|
||||
struct Clay_SDL3RendererData;
|
||||
typedef void SDL_Clay_RenderCustomCommand(
|
||||
struct Clay_SDL3RendererData *rendererData,
|
||||
Clay_RenderCommand *rcommand,
|
||||
const SDL_FRect view);
|
||||
|
||||
typedef struct Clay_SDL3RendererData {
|
||||
SDL_Renderer *renderer;
|
||||
TTF_TextEngine *textEngine;
|
||||
TTF_Font **fonts;
|
||||
SDL_Clay_RenderCustomCommand *custom_handler;
|
||||
} Clay_SDL3RendererData;
|
||||
|
||||
/* Global for convenience. Even in 4K this is enough for smooth curves (low radius or rect size coupled with
|
||||
|
@ -257,6 +264,13 @@ static void SDL_Clay_RenderClayCommands(Clay_SDL3RendererData *rendererData, Cla
|
|||
SDL_RenderTexture(rendererData->renderer, texture, NULL, &dest);
|
||||
break;
|
||||
}
|
||||
case CLAY_RENDER_COMMAND_TYPE_CUSTOM: {
|
||||
rendererData->custom_handler(
|
||||
rendererData,
|
||||
rcmd,
|
||||
rect);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
SDL_Log("Unknown render command type: %d", rcmd->commandType);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue