C++ opengl 纹理映射

#include  
#include  
#include  
#include  
#define stripeImageWidth 32

GLubyte stripeImage[4 * stripeImageWidth];

bool mouseLeftDown;
bool mouseRightDown;
float mouseX, mouseY;
float cameraAngleX;
float cameraAngleY;

void mouseCB(int button, int state, int x, int y);

void mouseMotionCB(int x, int y);
// create 2D texture
void makeStripeImage(void)
{
    int j;
    for (j = 0; j < stripeImageWidth; j++)
    {
        stripeImage[4 * j + 0] = (GLubyte)((j <= 4) ? 255 : 0);
        stripeImage[4 * j + 1] = (GLubyte)((j > 4) ? 255 : 0);
        stripeImage[4 * j + 2] = (GLubyte)0;
        stripeImage[4 * j + 3] = (GLubyte)255;
    }
}

static GLfloat xequalzero[] = { 1.0, 1.0, 1.0, 1.0 };
static GLfloat slanted[] = { 1.0, 1.0, 1.0, 1.0 };
static GLfloat* currentCoeff;
static GLenum currentPlane;
static GLint currentGenMode;
void in

你可能感兴趣的:(c++,opengl)