diff options
Diffstat (limited to 'src/Gui/RenderArea.h')
-rw-r--r-- | src/Gui/RenderArea.h | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/src/Gui/RenderArea.h b/src/Gui/RenderArea.h index 6695e09..d0b4ad3 100644 --- a/src/Gui/RenderArea.h +++ b/src/Gui/RenderArea.h @@ -11,12 +11,39 @@ namespace Gui { class RenderArea : public Gtk::DrawingArea { public: RenderArea(BaseObjectType *cobject, const Glib::RefPtr<Gnome::Glade::Xml> &xml); - virtual ~RenderArea(); - + private: static GdkGLConfig *glconfig; + float x, y; + + int zoomLevel; + float scale; + void onRealize(); + bool onConfigureEvent(GdkEventConfigure *event); + bool onExposeEvent(GdkEventExpose *event); + bool onScrollEvent(GdkEventScroll *event); + + void zoom(int zoom, float x = 0.5f, float y = 0.5f); + + void updateViewport(); + + void drawGrid(); + + bool gdkGLBegin() { + GtkWidget *widget = GTK_WIDGET(gobj()); + + return gdk_gl_drawable_gl_begin(gtk_widget_get_gl_drawable(widget), gtk_widget_get_gl_context(widget)); + } + + void gdkSwapBuffers() { + gdk_gl_drawable_swap_buffers(gtk_widget_get_gl_drawable(GTK_WIDGET(gobj()))); + } + + void gdkGLEnd() { + gdk_gl_drawable_gl_end(gtk_widget_get_gl_drawable(GTK_WIDGET(gobj()))); + } }; } |