// ccube.c
// OpenGL SuperBible
// Demonstrates primative RGB Color Cube
// Program by Richard S. Wright Jr.
#include "../../Common/OpenGLSB.h" // System and OpenGL Stuff
/* 颜色立方体 */
//旋转角度
static GLfloat xRot = 0.0f;
static GLfloat yRot = 0.0f;
//渲染回调函数
void RenderScene(void)
{
//清除缓冲区
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
//保存矩阵
glPushMatrix();
//旋转
glRotatef(xRot, 1.0f, 0.0f, 0.0f);
glRotatef(yRot, 0.0f, 1.0f, 0.0f);
//画六个面
gl......
阅读全文