changed: auto add updateData callback to stages so that stagedata can be updated...
[opensg.git] / Source / WindowSystem / EGL / OSGEGLWindowDataFields.h
blob6f421a003b1abac1196c2c5cc4500b8f33c0b9f1
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
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. *
18 * *
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. *
23 * *
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. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
40 #ifndef _OSGEGLWINDOWDATAFIELDS_H_
41 #define _OSGEGLWINDOWDATAFIELDS_H_
42 #ifdef __sgi
43 #pragma once
44 #endif
47 #include "OSGConfig.h"
49 // Forget everything if we're not doing a windows compile
50 #ifdef OSG_USE_EGL
52 #include "gles/egltypes.h"
54 #include "OSGWindowEGLDef.h"
56 #include "OSGWindowFields.h"
57 #include "OSGSysSFields.h"
59 //#include "windows.h"
61 /*! The field types for the local types needed by the EGLWINdow class */
63 OSG_BEGIN_NAMESPACE
66 template <>
67 struct FieldTraits<EGLDisplay> :
68 public FieldTraitsPtrToStringTemplateBase<EGLDisplay>
70 typedef FieldTraits<EGLDisplay> Self;
71 static DataType _type;
73 enum { Convertible = (Self::ToStringConvertible |
74 Self::FromStringConvertible)};
76 OSG_WINDOWEGL_DLLMAPPING
77 static DataType &getType (void);
79 static char *getSName(void) { return "SFEGLDisplay"; }
80 static char *getMName(void) { return "MFEGLDisplay"; }
82 static bool getFromCString( EGLDisplay &,
83 const Char8 *)
85 return true;
88 static void putToString (const EGLDisplay &,
89 std::string &outStr)
91 outStr.assign("EGLDisplay");
96 template <>
97 struct FieldTraits<EGLSurface> :
98 public FieldTraitsPtrToStringTemplateBase<EGLSurface>
100 static DataType _type;
101 typedef FieldTraits<EGLSurface> Self;
103 enum { Convertible = (Self::ToStringConvertible |
104 Self::FromStringConvertible)};
106 static DataType &getType (void);
108 static char *getSName(void) { return "SFEGLSurface"; }
109 static char *getMName(void) { return "MFEGLSurface"; }
111 static bool getFromCString( EGLSurface &,
112 const Char8 *)
114 return true;
117 static void putToString (const EGLSurface &,
118 std::string &outStr)
120 outStr.assign("EGLSurface");
124 template <>
125 struct FieldTraits<EGLContext> :
126 public FieldTraitsPtrToStringTemplateBase<EGLContext>
128 static DataType _type;
129 typedef FieldTraits<EGLContext> Self;
131 enum { Convertible = (Self::ToStringConvertible |
132 Self::FromStringConvertible)};
134 static DataType &getType (void);
136 static char *getSName(void) { return "SFEGLContext"; }
137 static char *getMName(void) { return "MFEGLContext"; }
139 static bool getFromCString( EGLContext &,
140 const Char8 *)
142 return true;
145 static void putToString (const EGLContext &,
146 std::string &outStr)
148 outStr.assign("EGLContext");
152 #if 0
153 template <>
154 struct FieldTraits<PAINTSTRUCT> :
155 public FieldTraitsPtrToStringTemplateBase<PAINTSTRUCT>
157 static DataType _type;
158 typedef FieldTraits<PAINTSTRUCT> Self;
160 enum { Convertible = (Self::ToStringConvertible |
161 Self::FromStringConvertible)};
163 static DataType &getType (void);
165 static char *getSName(void) { return "SFPAINTSTRUCT"; }
166 static char *getMName(void) { return "MFPAINTSTRUCT"; }
168 static bool getFromCString( PAINTSTRUCT &,
169 const Char8 *)
171 return true;
174 static void putToString (const PAINTSTRUCT &,
175 std::string &outStr)
177 outStr.assign("PAINTSTRUCT");
180 #endif
182 //! SFEGLDisplay
183 //! \ingroup GrpBaseFieldSingle
185 //typedef SField<HWND> SFHWND;
186 typedef SFInt32 SFEGLDisplay;
188 //! SFEGLSurface
189 //! \ingroup GrpBaseFieldSingle
191 typedef SField<EGLSurface> SFEGLSurface;
193 //! SFEGLContext
194 //! \ingroup GrpBaseFieldSingle
196 typedef SField<EGLContext> SFEGLContext;
198 // Instantiations
200 OSG_END_NAMESPACE
202 #endif /* OSG_USE_GLES */
204 #endif /* _OSGEGLWINDOWDATAFIELDS_H_ */