1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2006 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGCSMWINDOW_H_
40 #define _OSGCSMWINDOW_H_
45 #include "OSGCSMWindowBase.h"
46 #include "OSGWindow.h"
50 class StatisticsForeground
;
52 /*! \brief CSMWindow class. See \ref
53 PageContribCSMCSMWindow for a description.
59 class OSG_CONTRIBCSM_DLLMAPPING CSMWindow
: public CSMWindowBase
63 /*========================== PUBLIC =================================*/
67 typedef CSMWindowBase Inherited
;
68 typedef CSMWindow Self
;
70 /*---------------------------------------------------------------------*/
74 virtual void changed(ConstFieldMaskArg whichField
,
79 /*---------------------------------------------------------------------*/
83 virtual bool init(void);
86 /*---------------------------------------------------------------------*/
90 Real32
getXPos (void) const;
91 Real32
getYPos (void) const;
93 Real32
getXSize (void) const;
94 Real32
getYSize (void) const;
96 CSMDrawer
*getParent(void) const;
98 Window
*getWindow(void) const;
101 /*---------------------------------------------------------------------*/
106 /*---------------------------------------------------------------------*/
110 virtual Vec2f
translateScreenCoordinatesRel (Real32 rX
,
113 virtual Vec2i
translateGlobalCoordinatesRel (Real32 rX
,
116 virtual Vec2i
translateGlobalCoordinatesAbs (Int32 iX
,
119 virtual Vec2f
translateToScreenCoordinatesAbs(Real32 rX
,
123 /*---------------------------------------------------------------------*/
127 CSMViewport
*findViewport(Real32 x
, Real32 y
) const;
130 /*---------------------------------------------------------------------*/
134 void queueTask(DrawTask
*pTask
);
137 /*---------------------------------------------------------------------*/
141 virtual void dump( UInt32 uiIndent
= 0,
142 const BitVector bvFlags
= 0) const;
145 /*========================= PROTECTED ===============================*/
149 static UInt32 _extMultiSample
;
150 static UInt32 _extNVMultiSampleHint
;
151 static UInt32 FuncIdSampleCoverage
;
153 // Variables should all be in CSMWindowBase.
155 WindowRecPtr _pWindow
;
156 StatisticsForeground
*_pStatFG
;
159 MTouchData::MTouchBlob _oTouchBlob
;
163 /*---------------------------------------------------------------------*/
164 /*! \name Constructors */
168 CSMWindow(const CSMWindow
&source
);
171 /*---------------------------------------------------------------------*/
172 /*! \name Destructors */
175 virtual ~CSMWindow(void);
178 /*---------------------------------------------------------------------*/
182 virtual void resolveLinks(void);
185 /*---------------------------------------------------------------------*/
189 void reshape (Int32 w
,
192 void mouse (Int32 iButton
,
198 void motion (Int32 x
,
202 void addMTouchCursor (Int32 iCursorId
,
207 void updateMTouchCursor (Int32 iCursorId
,
212 void removeMTouchCursor (Int32 iCursorId
);
213 void commitMTouchCursors(void );
216 /*---------------------------------------------------------------------*/
220 virtual void render (RenderAction
*pAction
);
222 virtual void frameRenderNoFinish(RenderAction
*pAction
);
223 virtual void frameFinish (void );
224 virtual void frameExit (void );
226 void postSync (void );
228 void shutdown (void );
231 /*---------------------------------------------------------------------*/
235 virtual void terminateGLContext(void) = 0;
238 /*---------------------------------------------------------------------*/
242 bool requestStereoVisual(void);
245 /*---------------------------------------------------------------------*/
249 static void initMethod(InitPhase ePhase
);
252 /*========================== PRIVATE ================================*/
256 friend class FieldContainer
;
257 friend class CSMWindowBase
;
258 friend class CSMDrawer
;
259 friend class CSMViewport
;
261 // prohibit default functions (move to 'public' if you need one)
262 void operator =(const CSMWindow
&source
);
265 typedef CSMWindow
*CSMWindowP
;
269 #include "OSGCSMWindowBase.inl"
270 #include "OSGCSMWindow.inl"
272 #endif /* _OSGCSMWINDOW_H_ */