Odin
Odin copied to clipboard
vendor:sdl2 CreateTexture()' "format" argument declared as u32 (should be an enum)
Context
The type of format
argument in CreateTexture can be improved.
Expected Behavior
I think it should be defined following (note that PixelFormatEnum
is already defined):
CreateTexture :: proc(renderer: ^Renderer, format: PixelFormatEnum, access: TextureAccess, w, h: c.int) -> ^Texture
Current Behavior
It is defined like following:
CreateTexture :: proc(renderer: ^Renderer, format: u32, access: TextureAccess, w, h: c.int) -> ^Texture
Which makes it so it should be called with casting, like this:
app.texture = sdl.CreateTexture(app.renderer, u32(sdl.PixelFormatEnum.ARGB8888), .STREAMING, 640, 480)