当前位置: 首页>>代码示例>>C++>>正文


C++ CTexture::LoadTGA方法代码示例

本文整理汇总了C++中CTexture::LoadTGA方法的典型用法代码示例。如果您正苦于以下问题:C++ CTexture::LoadTGA方法的具体用法?C++ CTexture::LoadTGA怎么用?C++ CTexture::LoadTGA使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CTexture的用法示例。


在下文中一共展示了CTexture::LoadTGA方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: InitGL

void InitGL ( void )     // Inicializamos parametros
{

    glShadeModel(GL_SMOOTH);							// Habilitamos Smooth Shading
    glClearColor(0.0f, 0.0f, 0.0f, 0.0f);				// Negro de fondo
    glClearDepth(1.0f);									// Configuramos Depth Buffer
    glEnable(GL_DEPTH_TEST);							// Habilitamos Depth Testing

    //Configuracion luz
    glLightfv(GL_LIGHT0, GL_POSITION, Position);
    glLightfv(GL_LIGHT0, GL_SPOT_DIRECTION, Position2);
    glEnable(GL_LIGHTING);
    glEnable(GL_LIGHT0);


    glDepthFunc(GL_LEQUAL);								// Tipo de Depth Testing a realizar
    glEnable ( GL_COLOR_MATERIAL );
    glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);

    glEnable(GL_TEXTURE_2D);
    /*****************************
    * DefiniciOn de texturas
    *****************************/
    pared.LoadTGA("pared.tga");
    pared.BuildGLTexture();
    pared.ReleaseImage();

    piso.LoadTGA("piso.tga");
    piso.BuildGLTexture();
    piso.ReleaseImage();

    ventana.LoadTGA("ventana.tga");
    ventana.BuildGLTexture();
    ventana.ReleaseImage();

    puerta.LoadTGA("puerta.tga");
    puerta.BuildGLTexture();
    puerta.ReleaseImage();
}
开发者ID:ger1564,项目名称:ProyectoCompuGrafica,代码行数:39,代码来源:main_habitacion.cpp

示例2: InitGL

void InitGL()     // Inicializamos parametros
{
	glClearColor(0.0f, 0.0f, 0.0f, 0.0f);				// Negro de fondo	

	glEnable(GL_TEXTURE_2D);

	glShadeModel(GL_SMOOTH);
	//Para construir la figura comentar esto
	glLightfv(GL_LIGHT1, GL_POSITION, Position);
	glLightfv(GL_LIGHT1, GL_DIFFUSE, Diffuse);
	//glLightfv(GL_LIGHT0, GL_SPOT_DIRECTION, Position2);
	glEnable(GL_LIGHTING);
	glEnable(GL_LIGHT0);
	//glEnable(GL_LIGHT1);

	glEnable(GL_COLOR_MATERIAL);					//Habilitar GlColor3f
	//glEnable(GL_CULL_FACE);
	//glCullFace(GL_BACK);
	//glPolygonMode(GL_BACK, GL_LINE);

	glClearDepth(1.0f);									// Configuramos Depth Buffer
	glEnable(GL_DEPTH_TEST);							// Habilitamos Depth Testing
	glDepthFunc(GL_LEQUAL);								// Tipo de Depth Testing a realizar
	glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);

	glEnable(GL_AUTO_NORMAL);
	glEnable(GL_NORMALIZE);

	/* setup blending */
	//glBlendFunc(GL_SRC_ALPHA,GL_ONE);			// Set The Blending Function For Translucency
	//glColor4f(1.0f, 1.0f, 1.0f, 0.5); 

	rectoria._3dsLoad("rectoria/rectoria.3ds");
	rectoria.LoadTextureImages();
	rectoria.GLIniTextures();
	rectoria.ReleaseTextureImages();

	biblioteca._3dsLoad("biblioteca/biblioteca.3ds");
	biblioteca.LoadTextureImages();
	biblioteca.GLIniTextures();
	biblioteca.ReleaseTextureImages();

	//islas._3dsLoad("islas/islas.3ds");
	//islas.LoadTextureImages();
	//islas.GLIniTextures();
	//islas.ReleaseTextureImages();

	texturaPasto.LoadTGA("city/pasto01.tga");
	texturaPasto.BuildGLTexture();
	texturaPasto.ReleaseImage();

	facultadD._3dsLoad("derecho3DS/derecho.3ds");
	facultadD.LoadTextureImages();
	facultadD.GLIniTextures();
	facultadD.ReleaseTextureImages();

	t_placasRectoria.LoadTGA("city/pasto01.tga");
	t_placasRectoria.BuildGLTexture();
	t_placasRectoria.ReleaseImage();

	t_escalerasIslas.LoadTGA("cuadrosrectoria/texturaEsc.tga");
	t_escalerasIslas.BuildGLTexture();
	t_escalerasIslas.ReleaseImage();

	quadratic = gluNewQuadric();			// Create A Pointer To The Quadric Object ( NEW )
	gluQuadricNormals(quadratic, GLU_SMOOTH);	// Create Smooth Normals ( NEW )
	gluQuadricTexture(quadratic, GL_TRUE);		// Create Texture Coords ( NEW )


	objCamera.Position_Camera(0, 2.5f, 3, 0, 2.5f, 0, 0, 1, 0);



}
开发者ID:RickS1,项目名称:valencia,代码行数:74,代码来源:mainProy.cpp


注:本文中的CTexture::LoadTGA方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。