Odin icon indicating copy to clipboard operation
Odin copied to clipboard

vendor:sdl2 CreateTexture()' "format" argument declared as u32 (should be an enum)

Open greenya opened this issue 1 year ago • 0 comments

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)

greenya avatar Jan 30 '24 23:01 greenya