Hi C_Worm! Welcome to the Handmade Network forums.
So, you may need to brush up on how pointers work in C/C++. I recommend the K&R C book if you haven't read it yet.
is a variable that contains the address where the memory for the Pixels starts.
When you do
| uint8 *Row = (uint8 *)BitmapMemory;
|
You are setting Row to that same address. Row is a pointer to a uint8. Pointers are numbers that simply hold addresses to memory.
and
| uint32 *Pixel = (uint32 *)Row;
|
Is also passing the address to Pixel.
When you do something like
You are setting the memory that Pixel point to, to "something". The preceding asterisk is the dereference operator. The dereference means that we follow the pointer and operate on what it points to.
Arrays, and Pointers are functionally the same thing.
Look at this code:
| int numbers[10];
int* address_of_numbers = &numbers[0];
// These next two lines, have the exact same result:
numbers[4] = 44;
*(address_of_numbers + 4) = 44;
|
The only difference between the last two lines, is that we are using the pointer to get to the memory for numbers[44]. When we add 4 here, we are simply starting at the memory for numbers, then moving forward 4 values.