Main Page   Namespace List   Class Hierarchy   Compound List   File List   Header Files   Namespace Members   Compound Members   File Members   Related Pages  

/msg/src/other/window.h

This is the verbatim text of the window.h include file.
/* -*- C++ -*-
 * window.h
 * $Id: window.h,v 1.1.1.1 2000/07/20 20:54:14 ghali Exp $
 */

#ifndef WINDOW_H
#define WINDOW_H

#include "../geom/camera.h"
#include "../nodes/group.h"

namespace MSG {

  class Window {
  protected:
    Camera camera;
    Group  *root;

    int mouseX, mouseY;
    int dragX, dragY;
    bool dragging;
    // int lastXvec, lastYvec;

  public:
    Window(int argc, char **argv,
           Group* _root,
           const Camera& _camera,
           char* windowTitle = "MSG");

    void display(void);
    void handleKeys(unsigned char c, int x, int y);

    void handleMouse(int button, int state, int x, int y);
    void handleMotion(int x, int y);
    void handleVisibility(int state);

    void idle(void);

    void mainLoop();
  };

  // Variables and methods in global scope to interface with glut
  // (it is not possible to register member functions as callbacks with glut)
  extern int windowNum;
  extern Window* window;
  extern unsigned char k;
  extern int x, y;
  void displayCallback(void) {
    window->display();
  }
  void keyboardCallback(unsigned char k,int x,int y) {
    window->handleKeys(k,x,y);
  }
  void mouseCallback(int button, int state, int x, int y) {
    window->handleMouse(button, state, x, y);
  }
  void motionCallback(int x, int y) {
    window->handleMotion(x, y);
  }
  void visibilityCallback(int state) {
    window->handleVisibility(state);
  }
  void idleCallback(void) {
    window->idle();
  }
}
#endif

Generated at Sat Jul 22 00:32:17 2000 for MSG by doxygen 1.0.0 written by Dimitri van Heesch, © 1997-1999