本文整理汇总了C++中CTexture::BuildGLTexture方法的典型用法代码示例。如果您正苦于以下问题:C++ CTexture::BuildGLTexture方法的具体用法?C++ CTexture::BuildGLTexture怎么用?C++ CTexture::BuildGLTexture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTexture
的用法示例。
在下文中一共展示了CTexture::BuildGLTexture方法的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();
}
示例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);
}