42 lines
1.1 KiB
C++
42 lines
1.1 KiB
C++
|
|
#ifndef GLWIDGET_H
|
|
#define GLWIDGET_H
|
|
|
|
#include <gtkmm/gl/drawingarea.h>
|
|
|
|
#include "Vector.h"
|
|
|
|
class SierpinskiDA : public Gtk::GL::DrawingArea
|
|
{
|
|
public:
|
|
SierpinskiDA(const Glib::RefPtr<const Gdk::GL::Config> & config,
|
|
Gtk::Entry & n_points_entry);
|
|
void regenerate(int npts);
|
|
void regenerate_clicked();
|
|
|
|
protected:
|
|
bool m_dragging;
|
|
Vector m_dragBegin;
|
|
float m_drag_matrix[16];
|
|
int m_dl;
|
|
Gtk::Entry & m_n_points_entry;
|
|
|
|
virtual bool draw();
|
|
virtual void on_realize();
|
|
virtual bool on_configure_event(GdkEventConfigure * event);
|
|
virtual bool on_expose_event(GdkEventExpose * event);
|
|
bool gl_begin();
|
|
void gl_end();
|
|
|
|
Vector ptrToDragVector();
|
|
|
|
/* signal handlers */
|
|
virtual bool on_motion_notify_event(GdkEventMotion * event);
|
|
virtual bool on_button_press_event(GdkEventButton * event);
|
|
virtual bool on_button_release_event(GdkEventButton * event);
|
|
virtual bool on_scroll_event(GdkEventScroll * event);
|
|
};
|
|
|
|
#endif
|
|
|