A 2D tile-based sandbox game.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

util.h 770B

12345678910111213141516171819202122232425262728293031323334
  1. #pragma once
  2. #include <stdexcept>
  3. #include <stdint.h>
  4. #include "swan-common/Matrix3.h"
  5. namespace Cygnet {
  6. // I don't want every use of Cygnet to drag in OpenGL headers.
  7. using GLint = int32_t;
  8. using GLuint = uint32_t;
  9. using GLsizei = int32_t;
  10. using GLenum = uint32_t;
  11. using GLfloat = float;
  12. using Mat3gf = SwanCommon::Matrix3<GLfloat>;
  13. struct SDLError: public std::exception {
  14. SDLError(std::string msg): message(std::move(msg)) {}
  15. const char *what() const noexcept override { return message.c_str(); }
  16. std::string message;
  17. };
  18. struct GlError: public std::exception {
  19. GlError(std::string msg): message(std::move(msg)) {}
  20. const char *what() const noexcept override { return message.c_str(); }
  21. std::string message;
  22. };
  23. void sdlCheck(bool ok);
  24. void glCheck();
  25. }