// mainglwin.cpp -- OpenGL window for the main workspace // // 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: mainglwin.cpp,v 1.12 2005/05/09 07:02:06 fredb Exp $ #ifdef _MSC_VER #pragma warning( disable : 4786 4503 ) #endif #include #include #include #include #include #include #include #include #include "mainglwin.hpp" #include "mainwin.hpp" FGSD_MainGLWindow::FGSD_MainGLWindow(int x, int y, int w, int h, FGSD_MainWindow *__parent ) : Fl_Gl_Window( x, y, w, h ) , _parent( __parent ) { mode( FL_RGB|FL_DOUBLE ); } FGSD_MainGLWindow::~FGSD_MainGLWindow() { } void FGSD_MainGLWindow::resize( int x,int y,int w,int h ) { _parent->layout_(); Fl_Gl_Window::resize(x,y,w,h); } int FGSD_MainGLWindow::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_LEAVE: _parent->mouseLeave(); return 1; case FL_PUSH: _parent->mouseClick( Fl::event_x(), Fl::event_y(), Fl::event_state() ); return 1; case FL_RELEASE: _parent->mouseRelease( Fl::event_x(), Fl::event_y(), Fl::event_state() ); return 1; default: return Fl_Gl_Window::handle( __evt ); } } void FGSD_MainGLWindow::draw() { _parent->drawGL(); }