Open Source Tomb Raider Engine
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

WindowGLUT.cpp 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*!
  2. * \file src/WindowGLUT.cpp
  3. * \brief GLUT windowing implementation
  4. *
  5. * \author xythobuz
  6. */
  7. #include <cstdio>
  8. #include <ctime>
  9. #include "global.h"
  10. #include "RunTime.h"
  11. #include "UI.h"
  12. #include "utils/strings.h"
  13. #include "WindowGLUT.h"
  14. WindowGLUT::WindowGLUT() {
  15. mInit = false;
  16. mWidth = DEFAULT_WIDTH;
  17. mHeight = DEFAULT_HEIGHT;
  18. mFullscreen = false;
  19. mMousegrab = false;
  20. mTextInput = false;
  21. }
  22. WindowGLUT::~WindowGLUT() {
  23. if (mInit) {
  24. }
  25. }
  26. void WindowGLUT::setSize(unsigned int width, unsigned int height) {
  27. assert(width > 0);
  28. assert(height > 0);
  29. mWidth = width;
  30. mHeight = height;
  31. if (mInit == true) {
  32. resizeGL();
  33. }
  34. }
  35. void WindowGLUT::setFullscreen(bool fullscreen) {
  36. mFullscreen = fullscreen;
  37. if (mInit == true) {
  38. }
  39. }
  40. void WindowGLUT::setMousegrab(bool grab) {
  41. mMousegrab = grab;
  42. if (mInit == true) {
  43. }
  44. }
  45. bool WindowGLUT::getMousegrab() {
  46. return mMousegrab;
  47. }
  48. int WindowGLUT::initialize() {
  49. assert(mInit == false);
  50. mInit = true;
  51. return 0;
  52. }
  53. void WindowGLUT::eventHandling() {
  54. assert(mInit == true);
  55. UI::eventsFinished();
  56. }
  57. void WindowGLUT::setTextInput(bool on) {
  58. assert(mInit == true);
  59. mTextInput = on;
  60. }
  61. bool WindowGLUT::getTextInput() {
  62. assert(mInit == true);
  63. return mTextInput;
  64. }
  65. void WindowGLUT::delay(unsigned int ms) {
  66. assert(mInit == true);
  67. }
  68. void WindowGLUT::swapBuffersGL() {
  69. assert(mInit == true);
  70. }