コード例 #1
0
ファイル: App_Test.cpp プロジェクト: kiniou/libgoengine
void App_Test::load_Texture()
{
    loadPCX((u8*)heavy_pcx, &this->pcx);
    image8to16trans(&this->pcx,0);
    glGenTextures(1, &this->textureID[0]);
    glBindTexture(0, this->textureID[0]);
    glTexImage2D(0, 0, GL_RGB, TEXTURE_SIZE_128 , TEXTURE_SIZE_128, 0, TEXGEN_TEXCOORD, this->pcx.image.data8);
    imageDestroy(&this->pcx);

//    loadPCX((u8*)start_button_1_pcx, &this->pcx);
//    image8to16trans(&this->pcx,0);
//    glGenTextures(1, &this->textureID[0]);
//    glBindTexture(0, this->textureID[0]);
//    glTexImage2D(0, 0, GL_RGBA, TEXTURE_SIZE_128 , TEXTURE_SIZE_32, 0, TEXGEN_TEXCOORD | GL_TEXTURE_COLOR0_TRANSPARENT, this->pcx.image.data8);
//    imageDestroy(&this->pcx);
//
//    loadPCX((u8*)hex_pcx, &this->pcx);
//    image8to16trans(&this->pcx,0);
//    glGenTextures(1, &this->textureID[1]);
//    glBindTexture(0, this->textureID[1]);
//    glTexImage2D(0, 0, GL_RGBA, TEXTURE_SIZE_16 , TEXTURE_SIZE_16, 0, TEXGEN_TEXCOORD | GL_TEXTURE_COLOR0_TRANSPARENT, this->pcx.image.data8);
//    imageDestroy(&this->pcx);
//
//    loadPCX((u8*)GO_base_pcx, &this->pcx);
//    image8to16trans(&this->pcx,0);
//    glGenTextures(1, &this->textureID[3]);
//    glBindTexture(0, this->textureID[3]);
//    glTexImage2D(0, 0, GL_RGBA, TEXTURE_SIZE_8 , TEXTURE_SIZE_8, 0, TEXGEN_TEXCOORD | GL_TEXTURE_COLOR0_TRANSPARENT , this->pcx.image.data8);
//    imageDestroy(&this->pcx);
//


}
コード例 #2
0
// Load PCX files And Convert To Textures
int LoadGLTextures() {
	sImage pcx;			// (NEW) and different from nehe.

	//load our texture
	loadPCX((u8*)Star_pcx, &pcx);
	image8to16trans(&pcx, 0);

	//DS supports no filtering of anykind so no need for more than one texture
	glGenTextures(1, &texture[0]);
	glBindTexture(0, texture[0]);
	glTexImage2D(0, 0, GL_RGBA, TEXTURE_SIZE_128 , TEXTURE_SIZE_128, 0, TEXGEN_TEXCOORD, pcx.image.data8);

	imageDestroy(&pcx);

	return TRUE;
}