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.

window.h 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * =====================================================================================
  3. *
  4. * Filename: window.h
  5. *
  6. * Description: SDL window wrapper
  7. *
  8. * Version: 1.0
  9. * Created: 03/24/2014 11:14:49 PM
  10. * Revision: none
  11. * Compiler: gcc
  12. *
  13. * Author: YOUR NAME (),
  14. * Organization:
  15. *
  16. * =====================================================================================
  17. */
  18. #pragma once
  19. #include <string>
  20. #include <SDL2/SDL.h>
  21. #include <utility>
  22. #include <glm/glm.hpp>
  23. #include "graphics/rendertarget.h"
  24. namespace vtk {
  25. class Window : public RenderTarget {
  26. public:
  27. void activate();
  28. bool create();
  29. void setTitle(const std::string& title);
  30. void setResolution(const int& x, const int& y);
  31. std::pair<int, int> getResolution();
  32. void setFOV(const float& angle);
  33. glm::mat4 getProjectionMatrix();
  34. SDL_Window* getWindow();
  35. protected:
  36. float fov;
  37. std::string title;
  38. SDL_Window* window;
  39. SDL_GLContext context;
  40. };
  41. }