💿🐜 Antkeeper source code https://antkeeper.com
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.

76 lines
2.1 KiB

  1. /*
  2. * Copyright (C) 2023 Christopher J. Howard
  3. *
  4. * This file is part of Antkeeper source code.
  5. *
  6. * Antkeeper source code is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * Antkeeper source code is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with Antkeeper source code. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef ANTKEEPER_APP_SDL_WINDOW_HPP
  20. #define ANTKEEPER_APP_SDL_WINDOW_HPP
  21. #include "app/window.hpp"
  22. #include <SDL2/SDL.h>
  23. namespace app {
  24. /**
  25. *
  26. */
  27. class sdl_window: public window
  28. {
  29. public:
  30. virtual ~sdl_window();
  31. virtual void set_title(const std::string& title);
  32. virtual void set_position(const math::vector<int, 2>& position);
  33. virtual void set_size(const math::vector<int, 2>& size);
  34. virtual void set_minimum_size(const math::vector<int, 2>& size);
  35. virtual void set_maximum_size(const math::vector<int, 2>& size);
  36. virtual void set_maximized(bool maximized);
  37. virtual void set_fullscreen(bool fullscreen);
  38. virtual void set_v_sync(bool v_sync);
  39. virtual void make_current();
  40. virtual void swap_buffers();
  41. [[nodiscard]] inline virtual gl::rasterizer* get_rasterizer() noexcept
  42. {
  43. return rasterizer;
  44. }
  45. private:
  46. friend class sdl_window_manager;
  47. sdl_window
  48. (
  49. const std::string& title,
  50. const math::vector<int, 2>& windowed_position,
  51. const math::vector<int, 2>& windowed_size,
  52. bool maximized,
  53. bool fullscreen,
  54. bool v_sync
  55. );
  56. sdl_window(const sdl_window&) = delete;
  57. sdl_window(sdl_window&&) = delete;
  58. sdl_window& operator=(const sdl_window&) = delete;
  59. sdl_window& operator=(sdl_window&&) = delete;
  60. SDL_Window* internal_window;
  61. SDL_GLContext internal_context;
  62. gl::rasterizer* rasterizer;
  63. };
  64. } // namespace app
  65. #endif // ANTKEEPER_APP_SDL_WINDOW_HPP