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

GlWindowXWin.h

Go to the documentation of this file.
00001 /*************** <auto-copyright.pl BEGIN do not edit this line> **************
00002  *
00003  * VR Juggler is (C) Copyright 1998-2003 by Iowa State University
00004  *
00005  * Original Authors:
00006  *   Allen Bierbaum, Christopher Just,
00007  *   Patrick Hartling, Kevin Meinert,
00008  *   Carolina Cruz-Neira, Albert Baker
00009  *
00010  * This library is free software; you can redistribute it and/or
00011  * modify it under the terms of the GNU Library General Public
00012  * License as published by the Free Software Foundation; either
00013  * version 2 of the License, or (at your option) any later version.
00014  *
00015  * This library is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  * Library General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU Library General Public
00021  * License along with this library; if not, write to the
00022  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00023  * Boston, MA 02111-1307, USA.
00024  *
00025  * -----------------------------------------------------------------
00026  * File:          $RCSfile: GlWindowXWin.h,v $
00027  * Date modified: $Date: 2003/12/31 23:25:42 $
00028  * Version:       $Revision: 1.41 $
00029  * -----------------------------------------------------------------
00030  *
00031  *************** <auto-copyright.pl END do not edit this line> ***************/
00032 
00033 #ifndef _VRJ_GLX_WIN_H
00034 #define _VRJ_GLX_WIN_H
00035 //#pragma once
00036 
00037 #include <vrj/vrjConfig.h>
00038 #include <vector>
00039 
00040 #include <X11/Xlib.h>
00041 #include <X11/Xutil.h>
00042 #include <GL/glx.h>
00043 
00044 #include <vrj/Draw/OGL/GlWindow.h>
00045 #include <gadget/Devices/EventWindow/EventWindowXWin.h>
00046 
00047 
00048 namespace vrj
00049 {
00050 
00051 class Display;
00052 
00054 typedef struct
00055 {
00056 #define MWM_HINTS_DECORATIONS 2
00057    long flags;
00058    long functions;
00059    long decorations;
00060    long input_mode;
00061 } 
00062 MotifWmHints;
00063 
00064 
00069 class GlWindowXWin: public vrj::GlWindow, public gadget::EventWindowXWin
00070 {
00071 public:
00072    GlWindowXWin();
00073    virtual ~GlWindowXWin();
00074 
00075    void swapBuffers();
00076    int open();
00077    int close();
00078    bool makeCurrent();
00079 
00083    virtual void checkEvents();
00084 
00085    void configWindow(vrj::Display* disp);
00086 
00087 public:
00088    virtual bool createHardwareSwapGroup(std::vector<vrj::GlWindow*> wins);
00089 
00090 protected:
00091    /* private member functions.  these get profoundly painful */
00092    ::XVisualInfo* getGlxVisInfo(::Display* display, int screen);
00093 
00100    static int EventIsMapNotify(::Display* display, ::XEvent* e, ::XPointer window);
00101 
00106    virtual void processEvent(XEvent event);
00107 
00108 private:
00109    ::Display*     mXDisplay;
00110    ::XVisualInfo* mVisualInfo;
00111    ::GLXContext   mGlxContext;
00112    ::Window       mXWindow;
00113    std::string    mWindowName;
00114    int            mPipe;
00115    std::string    mXDisplayName;       
00116 };
00117 
00118 
00119 } // end namespace
00120 #endif

Generated on Sun May 2 15:10:17 2004 for VR Juggler by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002