Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

FltkOpenGLDisplayDevice.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *cr                                                                       
00003  *cr            (C) Copyright 1995-2008 The Board of Trustees of the           
00004  *cr                        University of Illinois                       
00005  *cr                         All Rights Reserved                        
00006  *cr                                                                   
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  * RCS INFORMATION:
00011  *
00012  *      $RCSfile: FltkOpenGLDisplayDevice.h,v $
00013  *      $Author: johns $        $Locker:  $             $State: Exp $
00014  *      $Revision: 1.16 $       $Date: 2008/03/27 19:36:39 $
00015  *
00016  ***************************************************************************
00017  * DESCRIPTION:
00018  *
00019  * Subclass of OpenGLRenderer, this object has routines used by all the
00020  * different display devices that are OpenGL-specific.  Will render drawing
00021  * commands into a single X window.
00022  *
00023  ***************************************************************************/
00024 #ifndef OPENGLDISPLAYDEVICE_H
00025 #define OPENGLDISPLAYDEVICE_H
00026 
00027 #include "OpenGLRenderer.h"
00028 
00029 class VMDApp;
00030 class Fl_Gl_Window;
00031 
00033 class FltkOpenGLDisplayDevice : public OpenGLRenderer {
00034 
00035 private:
00036   Fl_Gl_Window *window;
00037  
00038 public:
00039   // constructor/destructor
00040   // arguments: argc/argv from main, 
00041   // handle to VMDApp,
00042   // and the size and location for the window, if known
00043   FltkOpenGLDisplayDevice(int, char **, VMDApp *,int *size = NULL, int *loc = NULL);
00044   virtual ~FltkOpenGLDisplayDevice(void);
00045 
00046 
00047   //
00048   // get the current state of the device's pointer (i.e. cursor if it has one)
00049   //
00050   int lastevent;   // last FLTK event we processed
00051   int lastbtn;     // last mouse button pressed 
00052   int lastzdelta;  // last mouse wheel delta (windows parlance)
00053 
00054   virtual int x(void);          // abs pos of cursor from lower-left corner
00055   virtual int y(void);          // same, for y direction
00056   virtual int shift_state(void);// return the shift state (ORed of the
00057                                 // enum in DisplayDevice)
00058 
00059   // get the current state of the Spaceball if one is available
00060   // returns rx ry rz, tx ty tz, buttons
00061   virtual int spaceball(int *, int *, int *, int *, int *, int *, int *);
00062 
00063   // set the Nth cursor shape as the current one.  If no arg given, the
00064   // default shape (n=0) is used.
00065   virtual void set_cursor(int);
00066 
00067   virtual void do_resize_window(int, int);
00068 
00069   //
00070   // event handling routines
00071   //
00072 
00073   // read the next event ... returns an event type (one of the above ones),
00074   // and a value.  Returns success, and sets arguments.
00075   virtual int read_event(long &, long &);
00076  
00077   //
00078   // virtual routines for preparing to draw, drawing, and finishing drawing
00079   //
00080   virtual void update(int do_update = TRUE);    // finish up after drawing
00081   virtual void reshape(void);                   // refresh device after change
00082 
00083   // virtual routine for capturing the screen to a packed RGB array
00084   virtual unsigned char * readpixels(int &x, int &y);
00085 
00086   // Update xOrig and yOrig before computing screen position
00087   virtual void rel_screen_pos(float &x, float &y) {
00088     reshape();
00089     DisplayDevice::rel_screen_pos(x, y);
00090   }
00091 };
00092 
00093 #endif
00094 

Generated on Thu Sep 4 01:27:01 2008 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002