本文整理汇总了C++中GLTexture::LoadBMP方法的典型用法代码示例。如果您正苦于以下问题:C++ GLTexture::LoadBMP方法的具体用法?C++ GLTexture::LoadBMP怎么用?C++ GLTexture::LoadBMP使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GLTexture
的用法示例。
在下文中一共展示了GLTexture::LoadBMP方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitGL
int InitGL(GLvoid) // All Setup For OpenGL Goes Here
{
glShadeModel(GL_SMOOTH); // Enable Smooth Shading
glClearColor(1.0f, 1.0f, 1.0f, 0.5f); // Full brightness with apha 50%
glClearDepth(1.0f); // Depth Buffer Setup
glEnable(GL_DEPTH_TEST); // Enables Depth Testing
glDepthFunc(GL_LEQUAL); // The Type Of Depth Testing To Do
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Really Nice Perspective Calculations
quadric = gluNewQuadric();
// Initialize camera
myCamera = new Camera(Vector3D(100, 300, 300), Vector3D(0, 0, -1));
#pragma region Fog
glFogi(GL_FOG_MODE, fogMode[fogfilter]); // Fog Mode
glFogfv(GL_FOG_COLOR, fogColor); // Set Fog Color
glFogf(GL_FOG_DENSITY, 0.35f); // How Dense Will The Fog Be
glHint(GL_FOG_HINT, GL_DONT_CARE); // Fog Hint Value
glFogf(GL_FOG_START, 1.0f); // Fog Start Depth
glFogf(GL_FOG_END, 1000.0f); // Fog End Depth
glEnable(GL_FOG); // Enable Fog
#pragma endregion
#pragma region Global Light
light = new Light(LightAmbient, LightSpecular, LightDiffuse, LightPosition, GL_LIGHT0);
light->setUpLight();
#pragma endregion
#pragma region Tank Lights
tank_Leftlight = new Light(tank_LightAmbient, tank_LightSpecular, tank_LightDiffuse,
tank_LightPosition, tank_LightDirection, 10, GL_LIGHT1);
tank_Rightlight = new Light(tank_LightAmbient,tank_LightSpecular,tank_LightDiffuse,
tank_LightPosition,tank_LightDirection,10,GL_LIGHT2);
#pragma endregion
#pragma region Terrain Load
// Terrain
terrain = new Terrain();
// Terrain Texture
terrain->LoadTexture("Data/terrain ground.bmp");
// Load Heightmap
terrain->LoadHeightMap("Data/terrain height.bmp");
// Draw Terrain
terrain->Draw(0, -71, 0);
#pragma endregion
#pragma region Load Tank Model & Texture
// Tank
tank = new Model_3DS();
// Load Model
tank->Load("Data/Models/FinalTank.3ds");
// Load Tank textures
body.LoadBMP("Data/tanktexture/teext.bmp");
MGunM.LoadBMP("Data/tanktexture/GunM.bmp");
MGun.LoadBMP("Data/tanktexture/MGun.bmp");
#pragma endregion
#pragma region Decors
Decor1 = new Model_3DS();
Decor2 = new Model_3DS();
Decor3 = new Model_3DS();
Decor4 = new Model_3DS();
Decor5 = new Model_3DS();
Decor6 = new Model_3DS();
Decor1->Load("Data/Models/Decor1.3DS");
Decor2->Load("Data/Models/Decor1.3DS");
Decor3->Load("Data/Models/Decor1.3DS");
Decor4->Load("Data/Models/Decor1.3DS");
Decor5->Load("Data/Models/Decor1.3DS");
Decor6->Load("Data/Models/Decor1.3DS");
Decor1->pos.x = 520;
Decor2->pos.x = 520;
Decor3->pos.x = 620;
Decor4->pos.x = 620;
Decor5->pos.x = 480;
Decor6->pos.x = 480;
Decor1->pos.y = -5;
Decor2->pos.y = -5;
Decor3->pos.y = -5;
Decor4->pos.y = -5;
Decor5->pos.y = -5;
Decor6->pos.y = -5;
Decor1->pos.z = 10;
Decor2->pos.z = 70;
Decor3->pos.z = 160;
Decor4->pos.z = 220;
Decor5->pos.z = 180;
Decor6->pos.z = 240;
Decor1->scale *= 0.8;
Decor2->scale *= 0.8;
Decor3->scale *= 0.8;
Decor4->scale *= 0.8;
Decor5->scale *= 0.8;
Decor6->scale *= 0.8;
Decor3->rot.y = 180;
Decor4->rot.y = 180;
Decor1texture.LoadBMP("Data/decorstextures/tank.bmp");
#pragma endregion
#pragma region Load Sky Box
//.........这里部分代码省略.........