#include <iostream>
using namespace std;
#include <GL/glut.h>
#include <stdlib.h>
#include <stdio.h>
#define checkImageWidth 64 //图片宽度
#define checkImageHeight 64 //图片高度
static GLubyte checkImage[checkImageWidth][checkImageHeight][4];//定义图片,RBGA
//生成黑白相间的图片
void makeCheckImage(void)
{
int i, j, c;
for (i = 0; i < checkImageHeight; i++) {
for (j = 0; j < checkImageWidth; j++) {
c = ((((i&0x8)==0)^((j&0x8))==0))*255;
checkImage[i][j][0] = (GLubyte) c;
checkImage[i][j][1] = (GLubyte) c;
checkImage[i][j][2] = (GLubyte) c;
checkImage[i][j][3] = (GLubyte) 255;
}
}
}
void init(void)
{
//清空用黑色
glClearColor(0.0, 0.0, 0.0, 0.0
OpenGL入门系列- 编程指南例子解析 opengl_wrap
于 2014-06-26 13:49:02 首次发布