本文整理汇总了C++中Background::DrawNewGameIntroBackground方法的典型用法代码示例。如果您正苦于以下问题:C++ Background::DrawNewGameIntroBackground方法的具体用法?C++ Background::DrawNewGameIntroBackground怎么用?C++ Background::DrawNewGameIntroBackground使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Background
的用法示例。
在下文中一共展示了Background::DrawNewGameIntroBackground方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: render
/********************************************************
render() called in main as: glutDisplayFunc(render);
The render function is used to draw objects
to the screen.
********************************************************/
void render() {
switch (Current_Game_Scene_Enum)
{
case _scene_start_menu:
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //Clear the screen of previous drawn data
//if player hits ENTER_KEY, change CURRENT_GAME_SCENE_ENUM == _scene_new_game_intro
//glutTimerFunc(ms, startMenuKeypress, 0);
glLoadIdentity();
//camara
gluLookAt(0, -1, 5, 0, 0, 0, 0, 1, 0);
//draw BKGRND glQuad to the screen
background.DrawStartMenuBackground();
loadTitle();
//swap buffers to clear and redraw
glutSwapBuffers();
break;
case _scene_new_game_intro:
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //Clear the screen of previous drawn data
glutTimerFunc(ms, timeTick, 0); //update at 60 frames per second
glLoadIdentity();
gluLookAt(0.0, 30.0, 90.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
renderIntroText();
background.DrawNewGameIntroBackground();
if (fadeStarted && !(gameActive)) {
decrementCount = sceneTransition.FadeOut(decrementCount);
//check shrinking count for fadeout finished = 0
if (decrementCount <= 0) {
//change scene for render scene switch
Current_Game_Scene_Enum = _scene_level_one;
//reset some variables
customScrollingCount = 0;
decrementCount = 0;
//firstPassTimer = true;
fadeStarted = false;
gameActive = true;
level++;
}
}
glutSwapBuffers();
break;
case _scene_level_one:
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //Clear the screen of previous drawn data
glutTimerFunc(ms, update, 0); //update at 60 frames per second
glLoadIdentity();
displayLevelTitle();
//Camera
gluLookAt(0, -1, 5, 0, 0, 0, 0, 1, 0);
displayLevelTitle();
displayLevelText();
loadPlayerTitle();
lifeTitle();
lifeCountNumber();
background.Draw();
//Draw player
player[0]->setColor(1.0f, 0.0f, 0.0f);
player[0]->Draw();
//Draw the enemies
for (unsigned int i = 0; i < enemies.size(); i++) {
enemies[i]->Draw();
enemyModel.Position(enemies[i]->getX(), enemies[i]->getY() - 0.5f, enemies[i]->getZ());
enemyModel.drawObject();
}
enemySpawn();
//after update checks for correct kill count, being fadeOut
if (fadeStarted) {
cleanUp();
//init and update the decrement-count
if (firstPassTimerL1) {
decrementCount = sceneTransition.FadeOut(70.0f);
//.........这里部分代码省略.........