diff options
author | neoraider <devnull@localhost> | 2008-04-15 03:04:02 +0200 |
---|---|---|
committer | neoraider <devnull@localhost> | 2008-04-15 03:04:02 +0200 |
commit | 85e58bd658d3b572ed598e0460965d7827f4e901 (patch) | |
tree | be287042825b16183ab41f51138a2f97e1df21da /src/Gui | |
parent | 7df8aa74c6d11458248c5f5f3dd28eb762a2b407 (diff) | |
download | zoomedit-85e58bd658d3b572ed598e0460965d7827f4e901.tar zoomedit-85e58bd658d3b572ed598e0460965d7827f4e901.zip |
zoomedit:
* Connected TopView to RenderArea
Diffstat (limited to 'src/Gui')
-rw-r--r-- | src/Gui/RenderArea.cpp | 8 | ||||
-rw-r--r-- | src/Gui/RenderArea.h | 13 | ||||
-rw-r--r-- | src/Gui/Window.h | 2 |
3 files changed, 20 insertions, 3 deletions
diff --git a/src/Gui/RenderArea.cpp b/src/Gui/RenderArea.cpp index 39e1e45..7aa2745 100644 --- a/src/Gui/RenderArea.cpp +++ b/src/Gui/RenderArea.cpp @@ -18,6 +18,7 @@ */ #include "RenderArea.h" +#include <View/View.h> #include <iostream> #include <cstdlib> #include <cmath> @@ -31,7 +32,7 @@ namespace Gui { GdkGLConfig *RenderArea::glconfig = 0; RenderArea::RenderArea(BaseObjectType *cobject, const Glib::RefPtr<Gnome::Glade::Xml> &xml) -: Gtk::DrawingArea(cobject), xCenter(0), yCenter(0), zoomLevel(0), scale(100) { +: Gtk::DrawingArea(cobject), view(0), xCenter(0), yCenter(0), zoomLevel(0), scale(100) { if(!glconfig) { glconfig = gdk_gl_config_new_by_mode((GdkGLConfigMode)(GDK_GL_MODE_RGB | GDK_GL_MODE_DOUBLE)); if(!glconfig) glconfig = gdk_gl_config_new_by_mode(GDK_GL_MODE_RGB); // Hmm, can't find double buffered config @@ -101,12 +102,13 @@ bool RenderArea::onExposeEvent(GdkEventExpose*) { glScalef(scale, scale, 1); glTranslatef(-xCenter, -yCenter, 0); - drawGrid(); + if(view) + view->render(); + glMatrixMode(GL_MODELVIEW); glPopMatrix(); - gdkSwapBuffers(); gdkGLEnd(); diff --git a/src/Gui/RenderArea.h b/src/Gui/RenderArea.h index 66a8924..123c50f 100644 --- a/src/Gui/RenderArea.h +++ b/src/Gui/RenderArea.h @@ -26,18 +26,31 @@ #include <gtk/gtkgl.h> namespace ZoomEdit { + +namespace View { +class View; +} + namespace Gui { class RenderArea : public Gtk::DrawingArea { public: RenderArea(BaseObjectType *cobject, const Glib::RefPtr<Gnome::Glade::Xml> &xml); + View::View* getView() const {return view;} + void setView(View::View *view0) { + view = view0; + queue_draw(); + } + private: static GdkGLConfig *glconfig; Gtk::HScrollbar *hScrollbar; Gtk::VScrollbar *vScrollbar; + View::View *view; + float xCenter, yCenter; int zoomLevel; diff --git a/src/Gui/Window.h b/src/Gui/Window.h index 92369ce..ae22d42 100644 --- a/src/Gui/Window.h +++ b/src/Gui/Window.h @@ -35,6 +35,8 @@ class Window : public Gtk::Window { public: Window(BaseObjectType *cobject, const Glib::RefPtr<Gnome::Glade::Xml> &xml); virtual ~Window(); + + RenderArea* getRenderArea() const {return renderArea;} }; } |