Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Called once per frame, containing the time since the last frame, or delta time.
- void GraphicsTestScreen3D::Render(float delta)
- {
- //Handle the controls.
- CheckControls();
- //Render everything.
- C3D_FrameBegin(C3D_FRAME_SYNCDRAW);
- //Clear the screen.
- C3D_RenderTargetClear(topRenderTarget, C3D_CLEAR_ALL, CLEAR_COLOR, 0);
- //Set the target for drawing on.
- C3D_FrameDrawOn(topRenderTarget);
- //Update the camera.
- perspectiveCamera.Update();
- //Draw All of the 3D elements.
- _yuModel.Render(delta, &perspectiveCamera);
- //Draw armature, if possible.
- _yuModel.RenderArmature(&perspectiveCamera);
- //Update the camera.
- orthographicCamera.Update();
- //Draw all of the 2D elements.
- _spriteBatch.Begin();
- if (_enableUI){
- //Update the strings of some text.
- _fpsLabel._labelText = "FPS: " + std::to_string(_displayManager->_frameRate);
- _fpsLabel.GenerateSprites();
- if (_yuModel._animationManager._enabled){
- _animationFrameLabel._labelText = "Frame: " + std::to_string(_yuModel._animationManager._animations.at(_yuModel._animationManager._currentAnimationIndex).currentFrame);
- _animationFrameLabel.GenerateSprites();
- }
- //Draw all of the sprites.
- _fpsLabel.AddToBatch(&_spriteBatch);
- _vertexCountLabel.AddToBatch(&_spriteBatch);
- _faceCountLabel.AddToBatch(&_spriteBatch);
- _materialCountLabel.AddToBatch(&_spriteBatch);
- _boneCountLabel.AddToBatch(&_spriteBatch);
- _selectedAnimationLabel.AddToBatch(&_spriteBatch);
- _cameraMovementLabel.AddToBatch(&_spriteBatch);
- _animationChangeLabel.AddToBatch(&_spriteBatch);
- _animationFrameLabel.AddToBatch(&_spriteBatch);
- _uiDisableLabel.AddToBatch(&_spriteBatch);
- _exitLabel.AddToBatch(&_spriteBatch);
- }
- _spriteBatch.End();
- C3D_FrameEnd(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement