//   Base mini-glut class
//   Copyright (C) 1999,2000  Mark R. Stevens
//
//   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.                 //


//   CS4731: The goal is to derive a class from this base class and
//   implement different components throughout the course.

#ifndef MGLUT
#define MGLUT

// forward declaration
class minigl;
class cs4731app;
 
// Miniglut class definition
class miniglut {                    

public:
  
  // Constructor
  miniglut(minigl *mgl, cs4731app *app, int argc, char *argv[]);
  
  // the enumerated types
# include "mglutenum.h"
  
  // swaps the buffer to the screen and force a display update
  void mglutSwapBuffers();
  
  // obtain the elapsed time since the last call
  int mglutGet(MGLUTenum type);

  // add a redraw event to update the display
  void mglutPostRedisplay();

  // interface for callable functions
  static void draw   (void);
  static void reshape(int width, int height);
  static void key    (unsigned char k, int x, int y);
  static void mouse (int button, int state, int x, int y);
  static void special(int k, int x, int y);

  // loop
  void mglutMainLoop();


protected:

  // the minigl reference
  static minigl    *mgl;
  
  // the application to call
  static cs4731app *app;

  // to cope with the static application
  static miniglut *mglut;

};

#endif



