]> git.tdb.fi Git - libs/gui.git/blobdiff - source/graphics/simplewindow.h
Consistently label the graphics part as graphics
[libs/gui.git] / source / graphics / simplewindow.h
diff --git a/source/graphics/simplewindow.h b/source/graphics/simplewindow.h
new file mode 100644 (file)
index 0000000..f7bb0ce
--- /dev/null
@@ -0,0 +1,52 @@
+#ifndef MSP_GRAPHICS_SIMPLEWINDOW_H_
+#define MSP_GRAPHICS_SIMPLEWINDOW_H_
+
+#include "display.h"
+#include "glcontext.h"
+#include "window.h"
+
+namespace Msp {
+namespace Graphics {
+
+/**
+Helper class for SimpleWindow.
+*/
+class SimpleWindowBase
+{
+protected:
+       Display dpy;
+
+       SimpleWindowBase() { }
+};
+
+
+/**
+A simplified Window that encapsulates a Display.
+*/
+class SimpleWindow: public SimpleWindowBase, public Window
+{
+public:
+       SimpleWindow(unsigned, unsigned, bool =false);
+
+       void tick();
+};
+
+
+/**
+A SimpleWindow bundled with a GLContext.
+*/
+class SimpleGLWindow: public SimpleWindow
+{
+private:
+       GLContext gl_ctx;
+
+public:
+       SimpleGLWindow(unsigned, unsigned, bool =false);
+       GLContext &get_gl_context() { return gl_ctx; }
+       void swap_buffers();
+};
+
+} // namespace Graphics
+} // namespace Msp
+
+#endif