Clone of Bael'Zharon's Respite @ https://github.com/boardwalk/bzr

basic.h 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Bael'Zharon's Respite
  3. * Copyright (C) 2014 Daniel Skorupski
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along
  15. * with this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  17. */
  18. #ifndef BZR_BASIC_H
  19. #define BZR_BASIC_H
  20. #include <SDL.h>
  21. #ifndef HEADLESS
  22. #ifdef _MSC_VER
  23. #include <GL/glew.h>
  24. #else
  25. #define GL_GLEXT_PROTOTYPES
  26. #include <SDL_opengl.h>
  27. #endif
  28. #endif
  29. #define GLM_FORCE_RADIANS
  30. #ifdef _MSC_VER
  31. #pragma warning(push)
  32. #pragma warning(disable : 4201)
  33. #endif
  34. #include <glm/gtc/quaternion.hpp> // includes mat3, mat4, vec3, vec4
  35. #ifdef _MSC_VER
  36. #pragma warning(pop)
  37. #endif
  38. #include <cassert>
  39. #include <cstdint>
  40. #include <memory>
  41. #include <stdexcept>
  42. #include <string>
  43. #include <vector>
  44. #ifdef __GNUC__
  45. #define PACK(decl) decl __attribute__((__packed__))
  46. #elif _MSC_VER
  47. #define PACK(decl) __pragma(pack(push, 1)) decl __pragma(pack(pop))
  48. #else
  49. #error Implement PACK for this compiler.
  50. #endif
  51. #define UNUSED(x) ((void)x)
  52. using namespace std;
  53. typedef glm::float_t fp_t;
  54. inline fp_t pi() { return glm::pi<fp_t>(); }
  55. #endif