Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
I don't think it works. You defined framebuffer as a pointer to a 32-bit integer instead of an 8-bit integer, so you should see it plotting pixels at the wrong locations.
Caffeine wrote:Sorry, but I am a little confused as to how to do this. Again, sorry for the beginner questions.
To access the second byte of the pixel, add 1 to the index. Like this:
I don't think it works. You defined framebuffer as a pointer to a 32-bit integer instead of an 8-bit integer, so you should see it plotting pixels at the wrong locations.
Caffeine wrote:Sorry, but I am a little confused as to how to do this. Again, sorry for the beginner questions.
To access the second byte of the pixel, add 1 to the index. Like this:
framebuffer[mbi->framebuffer_pitch * y + 4 * x + 1]
Thanks! This worked! Sorry I didn't understand. When plotting more than 1 pixel there are these huge gaps between the pixels (See screenshot below). How do I fix this?
I already explained why the pixels are at the wrong locations.
Octocontrabass wrote:You defined framebuffer as a pointer to a 32-bit integer instead of an 8-bit integer, so you should see it plotting pixels at the wrong locations.
Octocontrabass wrote:I already explained why the pixels are at the wrong locations.
Octocontrabass wrote:You defined framebuffer as a pointer to a 32-bit integer instead of an 8-bit integer, so you should see it plotting pixels at the wrong locations.