[ C++ ] glDrawPixels

struct RGBType {

float r;

float g;

float b;

};



RGBType *pixels = new RGBType[checkImageWidth*checkImageHeight];



for (int i=0; i< checkImageWidth*checkImageHeight; i++) {


if (i>=checkImageWidth*233 && i<=checkImageWidth*233+44) {
pixels[i].r=1;
pixels[i].g=1;
pixels[i].b=1;
}
else {
pixels[i].r=0;
pixels[i].g=0;
pixels[i].b=0;
}



}



glDrawPixels(checkImageWidth,checkImageHeight,GL_RGB,GL_FLOAT,pixels);

留言

熱門文章