mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-01 17:37:39 +00:00
Add SDL_RenderDebugTextF & SDL_RenderDebugTextV
This should make it easier to quickly put important numbers and such on the screen without having to format them into a string manually.
This commit is contained in:
parent
5608bf5866
commit
1d0e28a5b3
8 changed files with 126 additions and 2 deletions
|
@ -149,6 +149,16 @@ static void SDL_InitDynamicAPI(void);
|
|||
va_end(ap); \
|
||||
return result; \
|
||||
} \
|
||||
_static bool SDLCALL SDL_RenderDebugTextF##name(SDL_Renderer *renderer, float x, float y, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) \
|
||||
{ \
|
||||
bool result; \
|
||||
va_list ap; \
|
||||
initcall; \
|
||||
va_start(ap, fmt); \
|
||||
result = jump_table.SDL_RenderDebugTextV(renderer, x, y, fmt, ap); \
|
||||
va_end(ap); \
|
||||
return result; \
|
||||
} \
|
||||
_static void SDLCALL SDL_Log##name(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) \
|
||||
{ \
|
||||
va_list ap; \
|
||||
|
|
|
@ -1207,6 +1207,8 @@ SDL3_0.0.0 {
|
|||
SDL_SetGPUAllowedFramesInFlight;
|
||||
SDL_RenderTextureAffine;
|
||||
SDL_WaitAndAcquireGPUSwapchainTexture;
|
||||
SDL_RenderDebugTextF;
|
||||
SDL_RenderDebugTextV;
|
||||
# extra symbols go here (don't modify this line)
|
||||
local: *;
|
||||
};
|
||||
|
|
|
@ -1232,3 +1232,5 @@
|
|||
#define SDL_SetGPUAllowedFramesInFlight SDL_SetGPUAllowedFramesInFlight_REAL
|
||||
#define SDL_RenderTextureAffine SDL_RenderTextureAffine_REAL
|
||||
#define SDL_WaitAndAcquireGPUSwapchainTexture SDL_WaitAndAcquireGPUSwapchainTexture_REAL
|
||||
#define SDL_RenderDebugTextF SDL_RenderDebugTextF_REAL
|
||||
#define SDL_RenderDebugTextV SDL_RenderDebugTextV_REAL
|
||||
|
|
|
@ -1238,3 +1238,7 @@ SDL_DYNAPI_PROC(bool,SDL_RunOnMainThread,(SDL_MainThreadCallback a,void *b,bool
|
|||
SDL_DYNAPI_PROC(bool,SDL_SetGPUAllowedFramesInFlight,(SDL_GPUDevice *a,Uint32 b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(bool,SDL_RenderTextureAffine,(SDL_Renderer *a,SDL_Texture *b,const SDL_FRect *c,const SDL_FPoint *d,const SDL_FPoint *e,const SDL_FPoint *f),(a,b,c,d,e,f),return)
|
||||
SDL_DYNAPI_PROC(bool,SDL_WaitAndAcquireGPUSwapchainTexture,(SDL_GPUCommandBuffer *a,SDL_Window *b,SDL_GPUTexture **c,Uint32 *d,Uint32 *e),(a,b,c,d,e),return)
|
||||
#ifndef SDL_DYNAPI_PROC_NO_VARARGS
|
||||
SDL_DYNAPI_PROC(bool,SDL_RenderDebugTextF,(SDL_Renderer *a,float b,float c,SDL_PRINTF_FORMAT_STRING const char *d,...),(a,b,c,d),return)
|
||||
#endif
|
||||
SDL_DYNAPI_PROC(bool,SDL_RenderDebugTextV,(SDL_Renderer *a,float b,float c,SDL_PRINTF_FORMAT_STRING const char *d,va_list e),(a,b,c,d,e),return)
|
||||
|
|
|
@ -168,9 +168,11 @@ def parse_header(header_path: Path) -> list[SdlProcedure]:
|
|||
func = func.replace(" SDL_PRINTF_VARARG_FUNC(1)", "")
|
||||
func = func.replace(" SDL_PRINTF_VARARG_FUNC(2)", "")
|
||||
func = func.replace(" SDL_PRINTF_VARARG_FUNC(3)", "")
|
||||
func = func.replace(" SDL_PRINTF_VARARG_FUNC(4)", "")
|
||||
func = func.replace(" SDL_PRINTF_VARARG_FUNCV(1)", "")
|
||||
func = func.replace(" SDL_PRINTF_VARARG_FUNCV(2)", "")
|
||||
func = func.replace(" SDL_PRINTF_VARARG_FUNCV(3)", "")
|
||||
func = func.replace(" SDL_PRINTF_VARARG_FUNCV(4)", "")
|
||||
func = func.replace(" SDL_WPRINTF_VARARG_FUNC(3)", "")
|
||||
func = func.replace(" SDL_WPRINTF_VARARG_FUNCV(3)", "")
|
||||
func = func.replace(" SDL_SCANF_VARARG_FUNC(2)", "")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue