00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
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
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);
00131 void SetDeviceContext(HDC);
00132
00134 virtual void SetNextWindowId(HWND);
00135
00138 virtual void SetNextWindowId(void *arg);
00139
00140
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
00218 BITMAPINFO MemoryDataHeader;
00219 HBITMAP MemoryBuffer;
00220 unsigned char *MemoryData;
00221 HDC MemoryHdc;
00222
00223 int ScreenMapped;
00224 int ScreenWindowSize[2];
00225 HDC ScreenDeviceContext;
00226 int ScreenDoubleBuffer;
00227 HGLRC ScreenContextId;
00228
00229 int CreatingOffScreenWindow;
00230
00231
00232
00233 virtual LRESULT MessageProc(HWND hWnd, UINT message,
00234 WPARAM wParam, LPARAM lParam);
00235
00236 static LRESULT APIENTRY WndProc(HWND hWnd, UINT message,
00237 WPARAM wParam, LPARAM lParam);
00238
00239 int CursorHidden;
00240 int ForceMakeCurrent;
00241
00242 char *Capabilities;
00243 int WindowIdReferenceCount;
00244 void ResizeWhileOffscreen(int xsize, int ysize);
00245 virtual void CreateAWindow();
00246 virtual void DestroyWindow();
00247 void InitializeApplication();
00248 void CleanUpOffScreenRendering(void);
00249 void CreateOffScreenDC(int xsize, int ysize, HDC aHdc);
00250 void CreateOffScreenDC(HBITMAP hbmp, HDC aHdc);
00251 void CreateOffScreenWindow(int width,int height);
00252 void SaveScreenRendering();
00253 void CleanUpRenderers();
00254
00255 private:
00256 vtkWin32OpenGLRenderWindow(const vtkWin32OpenGLRenderWindow&);
00257 void operator=(const vtkWin32OpenGLRenderWindow&);
00258 };
00259
00260
00261 #endif
00262