VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkEGLRenderWindow.h 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 =========================================================================*/ 00024 #ifndef vtkEGLRenderWindow_h 00025 #define vtkEGLRenderWindow_h 00026 00027 #include "vtkRenderingOpenGL2Module.h" // For export macro 00028 #include "vtkOpenGLRenderWindow.h" 00029 00030 #include <EGL/egl.h> // required for EGL members 00031 00032 class vtkIdList; 00033 00034 class VTKRENDERINGOPENGL2_EXPORT vtkEGLRenderWindow : public vtkOpenGLRenderWindow 00035 { 00036 public: 00037 static vtkEGLRenderWindow *New(); 00038 vtkTypeMacro(vtkEGLRenderWindow, vtkOpenGLRenderWindow); 00039 void PrintSelf(ostream& os, vtkIndent indent); 00040 00042 virtual void Start(void); 00043 00045 virtual void Frame(void); 00046 00048 virtual void WindowInitialize(void); 00049 00054 virtual void Initialize(void); 00055 00060 virtual void Finalize(void); 00061 00063 virtual void SetFullScreen(int); 00064 00066 virtual void WindowRemap(void); 00067 00069 virtual void PrefFullScreen(void); 00070 00072 00073 virtual void SetSize(int,int); 00074 virtual void SetSize(int a[2]) {this->SetSize(a[0], a[1]);} 00076 00081 virtual void SetStereoCapableWindow(int capable); 00082 00084 void MakeCurrent(); 00085 00088 virtual bool IsCurrent(); 00089 00091 int SupportsOpenGL(); 00092 00094 int IsDirect() { return 1;}; 00095 00097 virtual int *GetScreenSize(); 00098 00100 virtual int *GetPosition(); 00101 00103 00104 virtual void SetDisplayId(void *) {}; 00105 virtual void SetWindowId(void *window) { this->Window = (ANativeWindow *)window;}; 00106 virtual void SetNextWindowId(void *) {}; 00107 virtual void SetParentId(void *) {}; 00108 virtual void *GetGenericDisplayId() { return this->Display; }; 00109 virtual void *GetGenericWindowId() {}; 00110 virtual void *GetGenericParentId() {}; 00111 virtual void *GetGenericContext() { return this->Context; }; 00112 virtual void *GetGenericDrawable() {}; 00113 virtual void SetWindowInfo(char *); 00114 virtual void SetNextWindowInfo(char *) {}; 00115 virtual void SetParentInfo(char *) {}; 00117 00118 void SetWindowName(const char *); 00119 00121 00122 void SetPosition(int,int); 00123 void SetPosition(int a[2]) {this->SetPosition(a[0], a[1]);}; 00125 00127 00129 void HideCursor(); 00130 void ShowCursor(); 00132 00135 void Render(); 00136 00138 void SetOffScreenRendering(int i); 00139 00144 virtual int GetEventPending() { return 0;}; 00145 00146 int GetOwnWindow() { return this->OwnWindow; }; 00147 00148 protected: 00149 vtkEGLRenderWindow(); 00150 ~vtkEGLRenderWindow(); 00151 00152 ANativeWindow *Window; 00153 EGLDisplay Display; 00154 EGLSurface Surface; 00155 EGLContext Context; 00156 int ScreenSize[2]; 00157 int OwnWindow; 00158 00159 void CreateAWindow(); 00160 void DestroyWindow(); 00161 void CreateOffScreenWindow(int width, int height); 00162 void DestroyOffScreenWindow(); 00163 void ResizeOffScreenWindow(int width, int height); 00164 00165 private: 00166 vtkEGLRenderWindow(const vtkEGLRenderWindow&); // Not implemented. 00167 void operator=(const vtkEGLRenderWindow&); // Not implemented. 00168 }; 00169 00170 00171 00172 #endif