SDL Utility
RenderWindow.hpp
Go to the documentation of this file.
1 
7 #pragma once
8 #include <string>
9 #include <chrono>
10 
11 #include "structures/Vector2.hpp"
12 #include "structures/Color.hpp"
13 #include "structures/Window.hpp"
15 
17 // TODO: Probably break up into sdlu::Window and sdlu::Renderer
18 // to avoid passing around the Renderer when only the Window is
19 // needed. (See Mouse::GetPosition for example)
20 
28 class RenderWindow : public Window, public RenderTarget
29 {
30 public:
35 
42  RenderWindow(Vector2u dimension, const std::string& title,
43  Uint32 windowFlags = Window::Flags::Shown);
44 
45  RenderWindow(const RenderWindow& other) = delete;
46  RenderWindow(const RenderWindow&& other) = delete;
47 
48  virtual ~RenderWindow();
49 
50 protected:
54  virtual void OnCreate();
55 
62  virtual bool OnResize();
63 
67  virtual void OnClose();
68 };
69 SDLU_END
Provides utility for creating and handling colors.
#define SDLU_BEGIN
Definition: Util.hpp:32
uint32_t Uint32
Definition: Util.hpp:23
Provides a structure for simple vector calculations.
Contains window related objects.
Acts as a wrapper for SDL_Renderer*. You can't (and shouldn't) instantiate this, but rather derive fr...
Definition: RenderTarget.hpp:22
A class that handles window related functionality.
Definition: RenderWindow.hpp:29
RenderWindow(const RenderWindow &&other)=delete
RenderWindow(Vector2u dimension, const std::string &title, Uint32 windowFlags=Window::Flags::Shown)
Creates a window and renderer with the given parameters.
virtual void OnCreate()
Function called after Window creation.
RenderWindow(const RenderWindow &other)=delete
virtual ~RenderWindow()
virtual bool OnResize()
Function called after resize event.
RenderWindow()
Default Constructor. No window or renderer is created.
virtual void OnClose()
Function called after closing the window.
Stores information about a window. You probably want RenderWindow.
Definition: Window.hpp:26
A struct to handle basic 2D vector operations.
Definition: Vector2.hpp:22