home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / oct93 / graphics / graphtal.lha / Graphtal / BaseWindow.h < prev    next >
C/C++ Source or Header  |  1992-11-17  |  2KB  |  75 lines

  1. /*
  2.  * BaseWindow.h  - class definition of abstract base class 
  3.  *                 for window support.
  4.  *
  5.  * Copyright (C) 1992, Christoph Streit (streit@iam.unibe.ch)
  6.  *                     University of Berne, Switzerland
  7.  * All rights reserved.
  8.  *
  9.  * This software may be freely copied, modified, and redistributed
  10.  * provided that this copyright notice is preserved on all copies.
  11.  *
  12.  * You may not distribute this software, in whole or in part, as part of
  13.  * any commercial product without the express consent of the authors.
  14.  *
  15.  * There is no warranty or other guarantee of fitness of this software
  16.  * for any purpose.  It is provided solely "as is".
  17.  *
  18.  */
  19.  
  20. #ifndef BaseWindow_H
  21. # define BaseWindow_H
  22.  
  23. #include "Vector.h"
  24. #include "ViewTransform.h"
  25. #include "Polygon.h"
  26.  
  27. //___________________________________________________________ BaseWindow
  28.  
  29. class LineList;
  30.  
  31. class BaseWindow
  32. {
  33. public:
  34.   BaseWindow();
  35.   virtual ~BaseWindow();
  36.  
  37.   virtual void open(int resX, int resY, const rcString& windowName);
  38.   virtual void close();
  39.   virtual void clear();
  40.   virtual char waitForKey()=0;
  41.   virtual void writeText(const rcString&, int, int)=0;
  42.   virtual void line(const Vector&, const Vector&); // draw line
  43.   virtual void polygon(Polygon*);                  // draw polygon
  44.   virtual void flush();                            // flush buffer
  45.  
  46.   virtual void disableBuffering();
  47.   virtual void enableBuffering();
  48.  
  49.   virtual void setView(const Vector& eye, const Vector& lookat, 
  50.                const Vector& up, real fov);
  51.   virtual void setView(const BoundingBox& bbox, 
  52.                const Vector& up, real fov);
  53.  
  54. protected:
  55.   ViewTransform* view; // view to apply
  56.   int resX, resY;      // window resolution
  57.   rcString name;       // name of the window
  58.   int windowIsOpen;    // is the window already open?
  59.  
  60. protected:
  61.   // drawLine is used by member functions line and poly to
  62.   // actually draw a line on the screen.
  63.   virtual void drawLine(int, int, int, int)=0;
  64.  
  65. private:
  66.   int buffering;       // buffering enabled?
  67.   LineList*    lines;  // buffered lines
  68.   PolygonList* polys;  // buffered polys
  69.  
  70. private:
  71.   void clearBuffer(); 
  72. };
  73.  
  74. #endif // BaseWindow_H
  75.