Advertisement
Benjamin_Loison

GuiGame.cpp

Aug 13th, 2017
355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.16 KB | None | 0 0
  1. #include "GuiGame.h"
  2. #include "../../Engine/engine.h"
  3. #include "../../../Main/main.h"
  4. #include "../../../Map/User/User.h"
  5. #include "../../../Map/map.h"
  6. #include "../../../../3D/Render/Engine/sdlglutils.h"
  7. #include "../../../../Logger/logger.h"
  8. #include "../Hud/Hud.h"
  9. #include <gl.h>
  10. #include <glu.h>
  11.  
  12. void GuiGame::initGui()
  13. {
  14.     SDL_GL_CreateContext(screen);
  15.     glBasics();
  16.     initializeMapRender();
  17.     addUser(username);
  18. }
  19.  
  20. void GuiGame::renderGui()
  21. {
  22.     glBasics();
  23.  
  24.     glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  25.     glMatrixMode(GL_MODELVIEW);
  26.     glLoadIdentity();
  27.  
  28.     camera->look();
  29.     renderUsers();
  30.     renderMap();
  31.     drawAxis();
  32.  
  33.     glPushMatrix();
  34.     glLoadIdentity();
  35.     glMatrixMode(GL_PROJECTION);
  36.  
  37.     prepare2D();
  38.     renderHud();
  39.     if(actualGuiInGame != "")
  40.         renderGuiInGame();
  41. }
  42.  
  43. void GuiGame::resizeGui()
  44. {
  45.     glViewport(0, 0, windowWidth, windowHeight);
  46.     glMatrixMode( GL_PROJECTION );
  47.     glLoadIdentity();
  48.     glOrtho( 0, windowWidth, windowHeight, 0, -1, 1 );
  49.     glMatrixMode( GL_MODELVIEW );
  50.     glLoadIdentity();
  51.  
  52.  
  53. }
  54.  
  55. bool GuiGame::isDynamic()
  56. {
  57.     return true;
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement