Skip to content
Discussion options

You must be logged in to vote

The w and h arguments of SDL_GetTextureSize function are ctypes float pointers so you need to use ctypes.byref instead of ctypes.c_float and you need to create new variables to pass as pointers because the w and h members of SDL_FRect struct are python floats.

width, height = ctypes.c_float(), ctypes.c_float()
sdl3.SDL_GetTextureSize(textTexture, ctypes.byref(width), ctypes.byref(height))
rect = sdl3.SDL_FRect(20.0, 20.0, width.value, height.value)
sdl3.SDL_RenderTexture(renderer, textTexture, None, rect)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@8Observer8
Comment options

Answer selected by 8Observer8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants