Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

vtkWin32OpenGLRenderWindow.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkWin32OpenGLRenderWindow.h,v $
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00029 #ifndef __vtkWin32OpenGLRenderWindow_h
00030 #define __vtkWin32OpenGLRenderWindow_h
00031 
00032 #include "vtkOpenGLRenderWindow.h"
00033 
00034 class vtkIdList;
00035 
00036 class VTK_RENDERING_EXPORT vtkWin32OpenGLRenderWindow : public vtkOpenGLRenderWindow
00037 {
00038 public:
00039   static vtkWin32OpenGLRenderWindow *New();
00040   vtkTypeRevisionMacro(vtkWin32OpenGLRenderWindow,vtkOpenGLRenderWindow);
00041   void PrintSelf(ostream& os, vtkIndent indent);
00042 
00044   virtual void Start(void);
00045 
00047   void Frame(void);
00048 
00050   virtual void WindowInitialize(void);
00051 
00056   virtual void Initialize(void);
00057 
00062   virtual void Finalize(void);
00063 
00065   virtual void SetFullScreen(int);
00066 
00068   virtual void WindowRemap(void);
00069 
00071   virtual void PrefFullScreen(void);
00072 
00074 
00075   virtual void SetSize(int,int);
00076   virtual void SetSize(int a[2]) {vtkOpenGLRenderWindow::SetSize(a);};
00078   
00080   virtual int *GetSize();
00081 
00083 
00084   virtual void SetPosition(int,int);
00085   virtual void SetPosition(int a[2]) {vtkOpenGLRenderWindow::SetPosition(a);};
00087   
00089   virtual int *GetScreenSize();
00090 
00092   virtual int *GetPosition();
00093 
00096   virtual void SetWindowName(const char *);
00097   
00099   void SetWindowInfo(char *);
00100 
00102   void SetNextWindowInfo(char *);
00103 
00105   void SetParentInfo(char *);
00106 
00107   //BTX
00108   virtual void *GetGenericDisplayId() {return (void *)this->ContextId;};
00109   virtual void *GetGenericWindowId()  {return (void *)this->WindowId;};
00110   virtual void *GetGenericParentId()  {return (void *)this->ParentId;};
00111   virtual void *GetGenericContext()   {return (void *)this->DeviceContext;};
00112   virtual void *GetGenericDrawable()  {return (void *)this->WindowId;};
00113   virtual void SetDisplayId(void *);
00114 
00116 
00117   virtual HWND  GetWindowId();
00118   void  SetWindowId(void *foo) {this->SetWindowId((HWND)foo);};
00120 
00122   virtual void  SetWindowId(HWND);
00123   
00125 
00126   virtual void  SetParentId(HWND);
00127   void  SetParentId(void *foo) {this->SetParentId((HWND)foo);};
00129 
00130   void  SetContextId(HGLRC);    // hsr
00131   void  SetDeviceContext(HDC);  // hsr
00132 
00134   virtual void  SetNextWindowId(HWND);
00135 
00138   virtual void SetNextWindowId(void *arg);
00139 
00140   //ETX
00141 
00146   virtual void SetStereoCapableWindow(int capable);
00147 
00149   void MakeCurrent();
00150 
00152   const char *ReportCapabilities();
00153 
00155   int SupportsOpenGL();
00156 
00158   int IsDirect();
00159 
00163   virtual  int GetEventPending();
00164 
00166 
00168   void SetupMemoryRendering(int x, int y, HDC prn);
00169   void SetupMemoryRendering(HBITMAP hbmp);
00170   void ResumeScreenRendering(void);
00171   HDC GetMemoryDC();
00172   unsigned char *GetMemoryData(){return this->MemoryData;};  
00174 
00176 
00177   virtual void SetupPalette(HDC hDC);
00178   virtual void SetupPixelFormat(HDC hDC, DWORD dwFlags, int debug, 
00179                                 int bpp=16, int zbpp=16);
00181   
00183   void Clean();
00184 
00186 
00189   void HideCursor();
00190   void ShowCursor();
00191   void SetCursorPosition(int x, int y);
00193 
00195   virtual void SetCurrentCursor(int);
00196 
00199   virtual void SetOffScreenRendering(int offscreen);
00200 
00201 protected:
00202   vtkWin32OpenGLRenderWindow();
00203   ~vtkWin32OpenGLRenderWindow();
00204 
00205   HINSTANCE ApplicationInstance;
00206   HPALETTE  Palette;
00207   HPALETTE  OldPalette;
00208   HGLRC     ContextId;
00209   HDC       DeviceContext;
00210   BOOL      MFChandledWindow;
00211   HWND      WindowId;
00212   HWND      ParentId;
00213   HWND      NextWindowId;
00214   int       OwnWindow;
00215   int       ScreenSize[2];
00216 
00217   // the following is used to support rendering into memory
00218   BITMAPINFO MemoryDataHeader;
00219   HBITMAP MemoryBuffer;
00220   unsigned char *MemoryData;    // the data in the DIBSection
00221   HDC MemoryHdc;
00222 
00223   int ScreenMapped;
00224   int ScreenWindowSize[2];
00225   HDC ScreenDeviceContext;
00226   int ScreenDoubleBuffer;
00227   HGLRC ScreenContextId;
00228 
00229   //BTX
00230   // message handler
00231   virtual LRESULT MessageProc(HWND hWnd, UINT message, 
00232                               WPARAM wParam, LPARAM lParam);
00233 
00234   static LRESULT APIENTRY WndProc(HWND hWnd, UINT message, 
00235                                   WPARAM wParam, LPARAM lParam);
00236   //ETX
00237   int CursorHidden;
00238   int ForceMakeCurrent;
00239 
00240   char   *Capabilities;
00241 
00242   void ResizeWhileOffscreen(int xsize, int ysize);
00243   void CreateAWindow(int x, int y, int width, int height);
00244   void InitializeApplication();
00245   void CleanUpOffScreenRendering(void);
00246   void CreateOffScreenDC(int xsize, int ysize, HDC aHdc);
00247   void CreateOffScreenDC(HBITMAP hbmp, HDC aHdc);
00248 private:
00249   vtkWin32OpenGLRenderWindow(const vtkWin32OpenGLRenderWindow&);  // Not implemented.
00250   void operator=(const vtkWin32OpenGLRenderWindow&);  // Not implemented.
00251 };
00252 
00253 
00254 #endif
00255 

Generated on Mon Jan 21 23:07:36 2008 for VTK by  doxygen 1.4.3-20050530