There’s not much code, it just displays a checkerboard bitmap. I can’t figure out what to change so that the size of the individual squares are larger or smaller.
Thanks in advance for your help.
#include<windows.h>
#include<math.h>
#include"Gl.h"
#include"glut.h"
const int screenWidth = 400; // width of screen window in pixels
const int screenHeight = 400; // height of screen window in pixels
int i,j;
GLubyte wb[2] = { 0x00, 0xff};
GLubyte check[512];
void myDisplay(void)
{
glClearColor(0.0, 0.0, 1.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT); // clear the screen
for(i = 0; i < 64; i++)
{
for(j = 0; j < 8; j++)
{
check[i*8+j] = wb[(i/8 + j)%2];
}
}
glBitmap(64, 64, 0.0, 0.0, 0.0, 0.0, check);
}
void main(int argc, char** argv)
{
glutInit(&argc, argv); // initialize the toolkit
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); // set display mode
glutInitWindowSize(screenWidth, screenHeight); // set window size
glutInitWindowPosition(300, 150); // set window position on screen
glutCreateWindow(“Checkerboard”); // open the screen window “Checkerboard”
glutDisplayFunc(myDisplay); // register redraw function
glutMainLoop(); // go into a perpetual loop
}