I have a framebuffer which takes this format of data in hex - 0xFFFFFFFF. (framebuffer is an int and then I cast it to a char) Each of these components is a value in the ARGB format (I believe it is actually XRGB). I have three variables with R, G and B values. They can be from 0 to 1 and from 0 to 255. How should I put the values inside the array without hard-coding them? This is the code for filling the array if anyone wants to see it:
for(i = 0; i < width * height; i++){
// X,R,G,B
framebuffer[i] = 0xFFFFFFFF;
}
I still have a suspicion I am not filling the buffer properly. The color isn't right, as right now it should appear white, but it is cyan.
Edit: I found out that having framebuffer as a float wasn't going to work and switching to an int works fine. The color is fine now.