Open Source Tomb Raider Engine
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*!
  2. * \file include/global.h
  3. * \brief Global typedefs
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _GLOBAL_H_
  8. #define _GLOBAL_H_
  9. #include "config.h"
  10. // Visual C++ does not understand __attribute__
  11. #ifdef _MSC_VER
  12. #define __attribute__(x)
  13. #endif
  14. // Globally include OpenGL header
  15. #ifdef __APPLE__
  16. #include <OpenGL/gl.h>
  17. #else
  18. #ifdef WIN32
  19. #include <Windows.h>
  20. #endif
  21. #include <GL/gl.h>
  22. #endif
  23. #if defined(HAVE_EXECINFO_H) && defined(HAVE_BACKTRACE) && defined(HAVE_BACKTRACE_SYMBOLS)
  24. #ifndef NDEBUG
  25. [[noreturn]] void assertImplementation(const char *exp, const char *file, int line);
  26. #define assert(x) (void)((x) || (assertImplementation(#x, __FILE__, __LINE__),0))
  27. #else
  28. #define assert(x)
  29. #endif
  30. #else
  31. #include <cassert>
  32. #endif
  33. const float BLACK[] = { 0.0f, 0.0f, 0.0f, 1.0f };
  34. const float DIM_WHITE[] = { 0.5f, 0.5f, 0.5f, 1.0f };
  35. const float WHITE[] = { 1.0f, 1.0f, 1.0f, 1.0f };
  36. const float RED[] = { 1.0f, 0.0f, 0.0f, 1.0f };
  37. const float GREEN[] = { 0.0f, 1.0f, 0.0f, 1.0f };
  38. const float NEXT_PURPLE[] = { 0.3f, 0.3f, 0.5f, 1.0f };
  39. const float OR_BLUE[] = { 0.5f, 0.7f, 1.0f, 1.0f };
  40. const float PINK[] = { 1.0f, 0.0f, 1.0f, 1.0f };
  41. const float YELLOW[] = { 1.0f, 1.0f, 0.0f, 1.0f };
  42. const float CYAN[] = { 0.0f, 1.0f, 1.0f, 1.0f };
  43. typedef enum {
  44. menuAction = 0,
  45. consoleAction, // menu and console should always be the first two items
  46. forwardAction,
  47. backwardAction,
  48. leftAction,
  49. rightAction,
  50. jumpAction,
  51. crouchAction,
  52. useAction,
  53. holsterAction,
  54. ActionEventCount // Should always be at the end
  55. } ActionEvents;
  56. typedef enum {
  57. zeroKey = '0', oneKey = '1', twoKey = '2',
  58. threeKey = '3', fourKey = '4', fiveKey = '5',
  59. sixKey = '6', sevenKey = '7', eightKey = '8',
  60. nineKey = '9', aKey = 'a', bKey = 'b',
  61. cKey = 'c', dKey = 'd', eKey = 'e', fKey = 'f',
  62. gKey = 'g', hKey = 'h', iKey = 'i', jKey = 'j',
  63. kKey = 'k', lKey = 'l', mKey = 'm', nKey = 'n',
  64. oKey = 'o', pKey = 'p', qKey = 'q', rKey = 'r',
  65. sKey = 's', tKey = 't', uKey = 'u', vKey = 'v',
  66. wKey = 'w', xKey = 'x', yKey = 'y', zKey = 'z',
  67. quoteKey, backslashKey, backspaceKey, capslockKey,
  68. commaKey, delKey, upKey, downKey, leftKey, rightKey,
  69. endKey, equalsKey, escapeKey, f1Key, f2Key, f3Key, f4Key, f5Key,
  70. f6Key, f7Key, f8Key, f9Key, f10Key, f11Key, f12Key, backquoteKey,
  71. homeKey, insertKey, leftaltKey, leftctrlKey, leftbracketKey,
  72. leftguiKey, leftshiftKey, minusKey, numlockKey, pagedownKey,
  73. pageupKey, pauseKey, dotKey, rightaltKey, rightctrlKey, enterKey,
  74. rightguiKey, rightbracketKey, rightshiftKey, scrolllockKey,
  75. semicolonKey, slashKey, spaceKey, tabKey,
  76. leftmouseKey, middlemouseKey, rightmouseKey,
  77. unknownKey
  78. } KeyboardButton;
  79. #endif