小编jal*_*ghi的帖子

glTexImage2D与gluBuild2DMipmaps

非常基本的OpenGL纹理创建代码:

int width, height;
BYTE * data;
FILE * file;
// open texture data
file = fopen( filename, "rb" );
if ( file == NULL ) return 0;
// allocate buffer
width = 256;
height = 256;
data =(BYTE*) malloc( width * height * 3 );
// read texture data
fread( data, width * height * 3, 1, file );
fclose( file );
glGenTextures( 1, &texture );
glBindTexture( GL_TEXTURE_2D, texture );
//gluBuild2DMipmaps( GL_TEXTURE_2D, 3, width,   height, GL_RGB, GL_UNSIGNED_BYTE, data ); …
Run Code Online (Sandbox Code Playgroud)

opengl texturing glteximage2d mipmaps glu

3
推荐指数
1
解决办法
5049
查看次数

标签 统计

glteximage2d ×1

glu ×1

mipmaps ×1

opengl ×1

texturing ×1