bool TESObjectREFR::Update3D() { if (this == *g_thePlayer) { //#ifdef _DEBUG // // TESModel* model = DYNAMIC_CAST(baseForm, TESForm, TESModel); // // if (model && (*g_thePlayer)->SetSkeletonPath(model->GetModelPath())) // { // // Update face/head/hair // RaceSexMenu* g_raceSexMenu = NULL; // InterfaceManager* pIM = InterfaceManager::GetSingleton(); // if (pIM) { // g_raceSexMenu = (RaceSexMenu*)pIM->GetMenuByType(kMenuType_RaceSex); // if (!g_raceSexMenu) { // g_raceSexMenu = (RaceSexMenu*)pIM->TempMenuByType(kMenuType_RaceSex); // if (g_raceSexMenu) { // g_raceSexMenu->UpdatePlayerHead(); // FormHeap_Free(g_raceSexMenu); // } // return true; // } // } // if (g_raceSexMenu) // g_raceSexMenu->UpdatePlayerHead(); // return true; // } // //else // // return false; //#endif return true; } Set3D(NULL, true); ModelLoader::GetSingleton()->QueueReference(this, 1, 0); return true; }
void vsScene::SetCamera3D( vsCamera3D *camera, bool reference ) { Set3D(true); if ( camera ) m_camera3D = camera; else m_camera3D = m_defaultCamera3D; m_cameraIsReference = reference; }
void Game::RenderHUD(){ Set2D(0, m_width, m_height, 0); // Change to 2D view and use 1:1 pixel resolution with [0,0] origin being at the top-left corner. glDisable(GL_DEPTH_TEST); // Disable depth testing so the HUD will not be hidden by the 3D graphics glDisable(GL_LIGHTING); glEnable(GL_BLEND); // Semi-transparent background glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glColor4f(0.0f, 0.0f, 0.9f, 0.5f); glBegin(GL_QUADS); glVertex2f(0,0); //top of screen glVertex2f(0,20); glVertex2f(m_width, 20); glVertex2f(m_width, 0); glEnd(); glDisable(GL_BLEND); strcpy_s(text, "Ball Dropper - Project Portfolio"); font1->printString(4, 15, text); font1->setColor(1.0f, 1.0f, 0.0f); if(GAMESTATE == MAINSTATESCREEN){ sprintf(text, "Ball Density: %i", (int)sphereDensity); font1->printString(400, 50, text); } if(GAMESTATE == PLAYSTATESCREEN){ sprintf(text, "Avg FPS: %.1f Score: %i Lives: %i", (float)fCount / cft, (int)score, (int)lives); font1->printString(400, 15, text); loadFileof.open("loadText.txt"); char words[225]; string textScore = "Score: "; string result; sprintf(words, "%i ", (int)score); result = textScore + words; loadFileof << result; //sprintf(text, "Level type: %s Score: %i",); } if(GAMESTATE == ENDSTATESCREEN){ getline(loadFileif,line); char s[255]; strcpy(s, line.c_str()); sprintf(text, "%s", s); font1->printString(400, 50, text); } if(gameState == 0){ } Set3D(VIEW_ANGLE, NEAR_CLIPPING, FAR_CLIPPING); // Set back to 3D glEnable(GL_LIGHTING); }
void Game::Render2D(){ // Change to 2D view and use 1:1 pixel resolution with // [0,0] origin being at the top-left corner. Set2D(0, m_width, m_height, 0); // Disable depth testing so the HUD will not be hidden // by the 3D graphics glDisable(GL_DEPTH_TEST); glDisable(GL_LIGHTING); //##################################### GUIHandle->Render(); //##################################### // Set back to 3D Set3D(); }
void Game::RenderHUD(){ Set2D(0, m_width, m_height, 0); // Change to 2D view and use 1:1 pixel resolution with [0,0] origin being at the top-left corner. glDisable(GL_DEPTH_TEST); // Disable depth testing so the HUD will not be hidden by the 3D graphics glEnable(GL_BLEND); // Semi-transparent background glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glColor4f(0.0f, 0.0f, 0.9f, 0.5f); glBegin(GL_QUADS); glVertex2f(0,0); //top of screen glVertex2f(0,20); glVertex2f(m_width, 20); glVertex2f(m_width, 0); glEnd(); glDisable(GL_BLEND); font1->setColor(1.0f, 1.0f, 0.0f); strcpy_s(text, "Applied Physics - Platform"); font1->printString(4, 15, text); sprintf(text, "Avg FPS: %.1f", (float)fCount / cft); font1->printString(350, 15, text); sprintf(text, "Walls: %i/%i", (int)wallNumber, (int)ARRAY_WALL_NUMBER); font1->printString(500, 15, text); Set3D(VIEW_ANGLE, NEAR_CLIPPING, FAR_CLIPPING); // Set back to 3D }