00001
00002
00003 #ifndef _GDKMM_GL_CONFIG_H
00004 #define _GDKMM_GL_CONFIG_H
00005
00006 #include <glibmm.h>
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include <gdkmm/gl/defs.h>
00028
00029 #ifdef GDKGLEXTMM_MULTIHEAD_SUPPORT
00030 #include <gdkmm/screen.h>
00031 #endif // GDKGLEXTMM_MULTIHEAD_SUPPORT
00032 #include <gdkmm/visual.h>
00033 #include <gdkmm/colormap.h>
00034
00035
00036 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00037 typedef struct _GdkGLConfig GdkGLConfig;
00038 typedef struct _GdkGLConfigClass GdkGLConfigClass;
00039 #endif
00040
00041
00042 namespace Gdk
00043 {
00044
00045 namespace GL
00046 { class Config_Class; }
00047
00048 }
00049 namespace Gdk
00050 {
00051 namespace GL
00052 {
00053
00067 enum ConfigMode
00068 {
00069 MODE_RGB = 0,
00070 MODE_RGBA = 0,
00071 MODE_INDEX = 1 << 0,
00072 MODE_SINGLE = 0,
00073 MODE_DOUBLE = 1 << 1,
00074 MODE_STEREO = 1 << 2,
00075 MODE_ALPHA = 1 << 3,
00076 MODE_DEPTH = 1 << 4,
00077 MODE_STENCIL = 1 << 5,
00078 MODE_ACCUM = 1 << 6,
00079 MODE_MULTISAMPLE = 1 << 7
00080 };
00081
00083 inline ConfigMode operator|(ConfigMode lhs, ConfigMode rhs)
00084 { return static_cast<ConfigMode>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
00085
00087 inline ConfigMode operator&(ConfigMode lhs, ConfigMode rhs)
00088 { return static_cast<ConfigMode>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
00089
00091 inline ConfigMode operator^(ConfigMode lhs, ConfigMode rhs)
00092 { return static_cast<ConfigMode>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
00093
00095 inline ConfigMode operator~(ConfigMode flags)
00096 { return static_cast<ConfigMode>(~static_cast<unsigned>(flags)); }
00097
00099 inline ConfigMode& operator|=(ConfigMode& lhs, ConfigMode rhs)
00100 { return (lhs = static_cast<ConfigMode>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
00101
00103 inline ConfigMode& operator&=(ConfigMode& lhs, ConfigMode rhs)
00104 { return (lhs = static_cast<ConfigMode>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
00105
00107 inline ConfigMode& operator^=(ConfigMode& lhs, ConfigMode rhs)
00108 { return (lhs = static_cast<ConfigMode>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
00109
00110 }
00111
00112 }
00113
00114
00115 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00116 namespace Glib
00117 {
00118
00119 template <>
00120 class Value<Gdk::GL::ConfigMode> : public Glib::Value_Flags<Gdk::GL::ConfigMode>
00121 {
00122 public:
00123 static GType value_type() G_GNUC_CONST;
00124 };
00125
00126 }
00127 #endif
00128
00129
00130 namespace Gdk
00131 {
00132
00133 namespace GL
00134 {
00135
00136
00143 class Config : public Glib::Object
00144 {
00145
00146 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00147
00148 public:
00149 typedef Config CppObjectType;
00150 typedef Config_Class CppClassType;
00151 typedef GdkGLConfig BaseObjectType;
00152 typedef GdkGLConfigClass BaseClassType;
00153
00154 private: friend class Config_Class;
00155 static CppClassType config_class_;
00156
00157 private:
00158
00159 Config(const Config&);
00160 Config& operator=(const Config&);
00161
00162 protected:
00163 explicit Config(const Glib::ConstructParams& construct_params);
00164 explicit Config(GdkGLConfig* castitem);
00165
00166 #endif
00167
00168 public:
00169 virtual ~Config();
00170
00171 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00172 static GType get_type() G_GNUC_CONST;
00173 static GType get_base_type() G_GNUC_CONST;
00174 #endif
00175
00177 GdkGLConfig* gobj() { return reinterpret_cast<GdkGLConfig*>(gobject_); }
00178
00180 const GdkGLConfig* gobj() const { return reinterpret_cast<GdkGLConfig*>(gobject_); }
00181
00182 GdkGLConfig* gobj_copy();
00183
00184 private:
00185
00186
00187 protected:
00188
00189 explicit Config(const int* attrib_list);
00190 #ifdef GDKGLEXTMM_MULTIHEAD_SUPPORT
00191 Config(const Glib::RefPtr<const Gdk::Screen>& screen,
00192 const int* attrib_list);
00193 #endif // GDKGLEXTMM_MULTIHEAD_SUPPORT
00194 explicit Config(ConfigMode mode);
00195 #ifdef GDKGLEXTMM_MULTIHEAD_SUPPORT
00196 Config(const Glib::RefPtr<const Gdk::Screen>& screen,
00197 ConfigMode mode);
00198 #endif // GDKGLEXTMM_MULTIHEAD_SUPPORT
00199
00200 public:
00201
00210 static Glib::RefPtr<Config> create(const int* attrib_list);
00211
00212 #ifdef GDKGLEXTMM_MULTIHEAD_SUPPORT
00213 static Glib::RefPtr<Config> create(const Glib::RefPtr<const Gdk::Screen>& screen,
00214 const int* attrib_list);
00215 #endif // GDKGLEXTMM_MULTIHEAD_SUPPORT
00216
00224 static Glib::RefPtr<Config> create(ConfigMode mode);
00225
00226 #ifdef GDKGLEXTMM_MULTIHEAD_SUPPORT
00227 static Glib::RefPtr<Config> create(const Glib::RefPtr<const Gdk::Screen>& screen,
00228 ConfigMode mode);
00229 #endif // GDKGLEXTMM_MULTIHEAD_SUPPORT
00230
00231 public:
00232
00233 #ifdef GDKGLEXTMM_MULTIHEAD_SUPPORT
00234
00238 Glib::RefPtr<Gdk::Screen> get_screen();
00239
00243 Glib::RefPtr<const Gdk::Screen> get_screen() const;
00244
00245 #endif // GDKGLEXTMM_MULTIHEAD_SUPPORT
00246
00247
00253 bool get_attrib(int attribute, int& value) const;
00254
00255
00260 Glib::RefPtr<Gdk::Colormap> get_colormap();
00261
00266 Glib::RefPtr<const Gdk::Colormap> get_colormap() const;
00267
00268
00273 Glib::RefPtr<Gdk::Visual> get_visual();
00274
00279 Glib::RefPtr<const Gdk::Visual> get_visual() const;
00280
00281
00285 int get_depth() const;
00286
00287
00295 int get_layer_plane() const;
00296
00297
00301 int get_n_aux_buffers() const;
00302
00303
00307 int get_n_sample_buffers() const;
00308
00309
00314 bool is_rgba() const;
00315
00316
00321 bool is_double_buffered() const;
00322
00323
00327 bool is_stereo() const;
00328
00329
00333 bool has_alpha() const;
00334
00335
00339 bool has_depth_buffer() const;
00340
00341
00345 bool has_stencil_buffer() const;
00346
00347
00352 bool has_accum_buffer() const;
00353
00354
00355 public:
00356
00357 public:
00358
00359
00360 protected:
00361
00362
00363
00364
00365
00366 };
00367
00368 }
00369 }
00370
00371
00372 namespace Glib
00373 {
00375 Glib::RefPtr<Gdk::GL::Config> wrap(GdkGLConfig* object, bool take_copy = false);
00376 }
00377
00378
00379 #endif
00380