Generating Texture Data#
This function generates a checkered texture on the fly.
This is used on the triangle that will be rendered and rotated on screen.
Generates a checkered texture and stores it in _image
.
for (int x = 0; x < imageWidth; x++)
{
for (int y = 0; y < imageHeight; y++)
{
int c = 0;
if (x % 128 < 64 && y % 128 < 64)
{
c = 255;
}
if (x % 128 >= 64 && y % 128 >= 64)
{
c = 255;
}
_image[x][y][0] = c;
_image[x][y][1] = c;
_image[x][y][2] = c;
_image[x][y][3] = 255;
}
}