Relative Content

Tag Archive for rustsdl-2

Set correct pixel color when manipulating texture buffers sdl2 rust

I am trying to make a somewhat efficient function to render a circle. I tried drawing pixel per pixel with the midpoint algorithm, but that’s too slow. So after some research i opted for creating a texture, locking it and manipulating its pixels. The problem is that i cannot seem to get the right colors. Here is what I came up: