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

GlWindowWin32.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: GlWindowWin32.h,v $
00027  * Date modified: $Date: 2003/05/22 21:19:26 $
00028  * Version:       $Revision: 1.19 $
00029  * -----------------------------------------------------------------
00030  *
00031  *************** <auto-copyright.pl END do not edit this line> ***************/
00032 
00033 #ifndef _VRJ_GL_WINDOW_WIN32_H_
00034 #define _VRJ_GL_WINDOW_WIN32_H_
00035 
00036 #include <vrj/vrjConfig.h>
00037 
00038 #pragma warning(disable:4786)  // identifier truncated to 255 characters in the debug information
00039 
00040 #include <GL/gl.h>
00041 
00042 #include <gadget/Devices/EventWindow/EventWindowWin32.h>
00043 
00044 #include <vrj/Draw/OGL/GlWindow.h>
00045 
00046 namespace vrj
00047 {
00048 
00049 class VJ_CLASS_API GlWindowWin32 : public GlWindow, public gadget::EventWindowWin32
00050 {
00051 public:
00052    GlWindowWin32();
00053    virtual ~GlWindowWin32();
00054 
00055 public:
00056 
00065    virtual int open();
00066 
00073    virtual int close();
00074 
00079    virtual bool makeCurrent();
00080 
00082    virtual void swapBuffers();
00083 
00088    virtual void checkEvents();
00089 
00090    void configWindow( vrj::Display* disp );
00091 
00092 protected:
00093    // WindowProcedure to deal with the events generated.
00094    // Called only for the window that we are controlling
00095    LRESULT handleEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
00096 
00101    bool setPixelFormat(HDC hDC);
00102 
00103    void sizeChanged(long width, long height);
00104 
00105 protected:
00106    // Register the window class with windows
00107    static bool registerWindowClass();
00108    static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam,
00109                                    LPARAM lParam);
00110 
00111    static WNDCLASS mWinClass;            
00112    static bool     mWinRegisteredClass;  
00114 protected:
00115    // Keep a map of window handles to ogl windows
00116    // This can be used by the message handler to call a class specific
00117    // message handler for each window
00118 
00120    static void addWindow(HWND handle, GlWindowWin32* glWin);
00121 
00123    static void removeWindow(HWND handle);
00124 
00126    static GlWindowWin32* getGlWin(HWND handle);
00127 
00128    static std::map<HWND, GlWindowWin32*> mGlWinMap;
00129 
00134    virtual void processEvent( UINT message, UINT wParam, LONG lParam );
00135 
00139    void becomeEventWindowDevice();
00140 
00144    void removeEventWindowDevice();
00145 
00146 public:
00147     HWND  mWinHandle;      
00148     HGLRC mRenderContext;  
00149     HDC   mDeviceContext;  
00151     std::string    window_name;
00152     int            mPipe;
00153     std::string    mXDisplayName;       
00155     PIXELFORMATDESCRIPTOR* mMatch;    
00156 };
00157 
00158 } // End of vrj namespace
00159 
00160 
00161 #endif

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