summaryrefslogtreecommitdiff
path: root/display.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-01-17 18:54:26 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-01-17 18:54:26 +0000
commit43a87590f45aa6e55724d30d0c2d0d34b407a57e (patch)
tree21ce8e8886f8aa58b159419b7d885f57d9a37580 /display.h
parentInitial commit (diff)
downloadilt-43a87590f45aa6e55724d30d0c2d0d34b407a57e.tar.bz2
ilt-43a87590f45aa6e55724d30d0c2d0d34b407a57e.tar.xz
ilt-43a87590f45aa6e55724d30d0c2d0d34b407a57e.zip
First cut modernizing and sanitizing
Diffstat (limited to 'display.h')
-rw-r--r--display.h20
1 files changed, 9 insertions, 11 deletions
diff --git a/display.h b/display.h
index 2573130..e5fcc73 100644
--- a/display.h
+++ b/display.h
@@ -1,28 +1,26 @@
#ifndef DISPLAY_INCLUDED_H
#define DISPLAY_INCLUDED_H
+#include "ptr.hpp"
#include <SDL2/SDL.h>
#include <string>
+#include <type_traits>
class Display {
public:
Display(int width, int height, const std::string & title);
- void Clear(float r, float g, float b, float a);
- void SwapBuffers();
+ Display(const Display &) = delete;
+ void operator=(const Display &) = delete;
virtual ~Display();
-protected:
-private:
- void
- operator=(const Display & display)
- {
- }
- Display(const Display & display) { }
+ void Clear(float r, float g, float b, float a) const;
+ void SwapBuffers() const;
- SDL_Window * m_window;
- SDL_GLContext m_glContext;
+private:
+ wrapped_ptr<SDL_Window> m_window;
+ wrapped_ptr<std::remove_pointer_t<SDL_GLContext>> m_glContext;
};
#endif