MEMBUAT PAPAN CATUR DENGAN CODE BLOCK
#include <windows.h> #include <iostream> #include <stdlib.h> //Needed for "exit" function #include <GL/glut.h> void myinit() { glClearColor(0.0, 0.0, 0.0, 1.0); glColor3f(0.0, 0.0, 1.0); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(0.0, 90.0, 0.0, 90.0); glMatrixMode(GL_MODELVIEW); } void display() { glClear(GL_COLOR_BUFFER_BIT); int k = 0; for(int i=0;i<9;i++) { for(int j=0;j<9;j++) { if ((i+j)%2==0) glColor3f(1.0, 0.6, 0.6); else glColor3f(1.0, 1.0, 1.0); glRecti((i*10),(j*10),(i*10)+10,(j*10)+10); glColor3f(1.0, 1.0, 0.0); if (k % 4 == 0) { glColor3f(0.0, 0.0, 0.0); for(int l=0;l<7;l+=4) { for(int m=0;m<7;m+=4) { glLineWidth(2); glBegin(GL_LINE_LOOP);