00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00023
#ifndef __vtkCarbonRenderWindow_h
00024
#define __vtkCarbonRenderWindow_h
00025
00026
#include "vtkOpenGLRenderWindow.h"
00027
00028
00029
#include <Carbon/Carbon.h>
00030
#include <OpenGL/gl.h>
00031
#include <AGL/agl.h>
00032
00033
class vtkIdList;
00034
00035 class VTK_RENDERING_EXPORT vtkCarbonRenderWindow :
public vtkOpenGLRenderWindow
00036 {
00037
public:
00038
static vtkCarbonRenderWindow *
New();
00039 vtkTypeRevisionMacro(vtkCarbonRenderWindow,
vtkOpenGLRenderWindow);
00040
void PrintSelf(ostream& os,
vtkIndent indent);
00041
00043
void Start(
void);
00044
00046
void Frame(
void);
00047
00049
virtual void WindowConfigure(
void);
00050
00052
virtual void WindowInitialize(
void);
00053
00058
virtual void Initialize(
void);
00059
00064
virtual void Finalize(
void);
00065
00067
virtual void SetFullScreen(
int);
00068
00070
virtual void WindowRemap(
void);
00071
00073
virtual void PrefFullScreen(
void);
00074
00076
virtual void SetSize(
int,
int);
00077
00079
virtual int *
GetSize();
00080
00082
virtual void SetPosition(
int,
int);
00083
00085
virtual int *GetScreenSize();
00086
00088
virtual int *
GetPosition();
00089
00092
virtual void SetWindowName(
const char *);
00093
00095
void SetWindowInfo(
void *);
00096
00097 void SetNextWindowInfo(
char *)
00098 {
00099 vtkWarningMacro(
"SetNextWindowInfo not implemented (WindowRemap not implemented).");
00100 }
00101
00102
00103 virtual void *
GetGenericDisplayId() {
return (
void *)this->ContextId;};
00104 virtual void *
GetGenericWindowId() {
return (
void *)this->WindowId;};
00105 virtual void *
GetGenericParentId() {
return (
void *)this->ParentId;};
00106 virtual AGLContext GetContextId() {
return this->ContextId;};
00107 virtual void *
GetGenericContext() {
return (
void *)this->DeviceContext;};
00108 virtual void SetDisplayId(
void *) {};
00109
00110 virtual void*
GetGenericDrawable()
00111 {
00112 vtkWarningMacro(
"GetGenericDrawable Method not implemented.");
00113
return 0;
00114 }
00115 void SetWindowInfo(
char*)
00116 {
00117 vtkWarningMacro(
"SetWindowInfo Method not implemented.");
00118 }
00119 void SetParentInfo(
char*)
00120 {
00121 vtkWarningMacro(
"SetParentInfo Method not implemented.");
00122 }
00123
00125
00126
virtual WindowPtr GetWindowId();
00127 void SetWindowId(
void *foo) {this->
SetWindowId((WindowPtr)foo);};
00128 void SetNextWindowId(
void*)
00129 {
00130 vtkWarningMacro(
"SetNextWindowId not implemented (WindowRemap not implemented).");
00131 }
00133
00135
00136
virtual void SetParentId(WindowPtr);
00137 void SetParentId(
void *foo) {this->
SetParentId((WindowPtr)foo);};
00139
00141
virtual void SetWindowId(WindowPtr);
00142
00143
void SetContextId(
void *);
00144
void SetDeviceContext(
void *);
00145
00146
00147
00148
00149 vtkSetMacro(MultiSamples,
int);
00150 vtkGetMacro(MultiSamples,
int);
00151
00156
virtual void SetStereoCapableWindow(
int capable);
00157
00159
void MakeCurrent();
00160
00164
void SetForceMakeCurrent();
00165
00168
virtual int GetEventPending();
00169
00177
virtual void SetupPalette(
void *hDC);
00178
virtual void SetupPixelFormat(
void *hDC,
void *dwFlags,
int debug,
00179
int bpp=16,
int zbpp=16);
00181
00183
void Clean();
00184
00186
int GetDepthBufferSize();
00187
00189
00191
void HideCursor();
00192
void ShowCursor();
00194
00195
void UpdateSizeAndPosition(
int xPos,
int yPos,
int xSize,
int ySize);
00196
00197
00198
protected:
00199 vtkCarbonRenderWindow();
00200 ~vtkCarbonRenderWindow();
00201
00202 int ApplicationInitialized;
00203 Boolean fAcceleratedMust;
00204 Boolean draggable;
00205 GLint aglAttributes[64];
00206
00207 SInt32 VRAM;
00208
00209 SInt32 textureRAM;
00210
00211 AGLPixelFormat fmt;
00212 AGLContext ContextId;
00213 AGLDrawable DeviceContext;
00214 WindowPtr WindowId;
00215 WindowPtr ParentId;
00216 int OwnWindow;
00217 int ScreenSize[2];
00218
00219 int ScreenMapped;
00220 int ScreenWindowSize[2];
00221 void *ScreenDeviceContext;
00222 int ScreenDoubleBuffer;
00223 void *ScreenContextId;
00224
00225 int CursorHidden;
00226 int ForceMakeCurrent;
00227
00228
void CreateAWindow(
int x,
int y,
int width,
int height);
00229
void InitializeApplication();
00230
private:
00231 vtkCarbonRenderWindow(
const vtkCarbonRenderWindow&);
00232
void operator=(
const vtkCarbonRenderWindow&);
00233 };
00234
00235
#endif