本文整理汇总了C++中CImage::DisposeData方法的典型用法代码示例。如果您正苦于以下问题:C++ CImage::DisposeData方法的具体用法?C++ CImage::DisposeData怎么用?C++ CImage::DisposeData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CImage
的用法示例。
在下文中一共展示了CImage::DisposeData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadMipmapTexture
int CTexture::LoadMipmapTexture (const char *filename, bool repeatable) {
CImage texImage;
GLuint texid;
if (texImage.LoadPng (filename, true) == false) return 0;
glGenTextures (1, &texid);
glBindTexture (GL_TEXTURE_2D, texid);
glPixelStorei (GL_UNPACK_ALIGNMENT, 4);
if (repeatable) {
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
} else {
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
}
GLenum format;
if (texImage.depth == 3) format = GL_RGB;
else format = GL_RGBA;
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
gluBuild2DMipmaps
(GL_TEXTURE_2D, texImage.depth, texImage.nx,
texImage.ny, format, GL_UNSIGNED_BYTE, texImage.data);
texImage.DisposeData();
return texid;
}
示例2: ScreenshotN
void ScreenshotN () {
CImage image;
string path = param.screenshot_dir;
path += SEP;
path += Course.CourseList[g_game.course_id].dir;
path += "_";
path += GetTimeString1 ();
int type = SCREENSHOT_PROC;
switch (type) {
case 0:
path += ".ppm";
image.ReadFrameBuffer_PPM ();
image.WritePPM (path.c_str());
image.DisposeData ();
break;
case 1:
path += ".tga";
image.ReadFrameBuffer_TGA ();
image.WriteTGA (path.c_str());
image.DisposeData ();
break;
case 2:
path += ".tga";
image.ReadFrameBuffer_TGA ();
image.WriteTGA_H (path.c_str());
image.DisposeData ();
break;
case 3:
path += ".bmp";
image.ReadFrameBuffer_BMP ();
image.WriteBMP (path.c_str());
image.DisposeData ();
break;
}
}