// inputglwin.cpp -- OpenGL window for map fragments // // Written by Frederic Bouvier, started October 2001. // // Copyright (C) 2001 Frederic Bouvier - fredb@users.sourceforge.net // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License as // published by the Free Software Foundation; either version 2 of the // License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // // $Id: inputglwin.cpp,v 1.8 2005/05/09 07:01:52 fredb Exp $ #include #include #include "inputglwin.hpp" #include "inputwin.hpp" FGSD_InputGLWindow::FGSD_InputGLWindow(int x, int y, int w, int h, FGSD_InputWindow *__parent ) : Fl_Gl_Window( x, y, w, h ) , _parent( __parent ) { } FGSD_InputGLWindow::~FGSD_InputGLWindow() { } void FGSD_InputGLWindow::resize( int x,int y,int w,int h ) { _parent->layout_(); Fl_Gl_Window::resize(x,y,w,h); } int FGSD_InputGLWindow::handle( int __evt ) { switch ( __evt ) { case FL_ENTER: case FL_MOVE: case FL_DRAG: _parent->mouseMove( Fl::event_x(), Fl::event_y(), __evt, Fl::event_state() ); return 1; case FL_PUSH: _parent->mouseClick( Fl::event_x(), Fl::event_y(), Fl::event_button() ); return 1; default: return Fl_Gl_Window::handle( __evt ); } } void FGSD_InputGLWindow::draw() { _parent->drawGL(); }