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
00183 GdkGLConfig* gobj_copy();
00184
00185 private:
00186
00187
00188 protected:
00189
00190 explicit Config(const int* attrib_list);
00191 #ifdef GDKGLEXTMM_MULTIHEAD_SUPPORT
00192 Config(const Glib::RefPtr<const Gdk::Screen>& screen,
00193 const int* attrib_list);
00194 #endif // GDKGLEXTMM_MULTIHEAD_SUPPORT
00195 explicit Config(ConfigMode mode);
00196 #ifdef GDKGLEXTMM_MULTIHEAD_SUPPORT
00197 Config(const Glib::RefPtr<const Gdk::Screen>& screen,
00198 ConfigMode mode);
00199 #endif // GDKGLEXTMM_MULTIHEAD_SUPPORT
00200
00201 public:
00202
00211 static Glib::RefPtr<Config> create(const int* attrib_list);
00212
00213 #ifdef GDKGLEXTMM_MULTIHEAD_SUPPORT
00214 static Glib::RefPtr<Config> create(const Glib::RefPtr<const Gdk::Screen>& screen,
00215 const int* attrib_list);
00216 #endif // GDKGLEXTMM_MULTIHEAD_SUPPORT
00217
00225 static Glib::RefPtr<Config> create(ConfigMode mode);
00226
00227 #ifdef GDKGLEXTMM_MULTIHEAD_SUPPORT
00228 static Glib::RefPtr<Config> create(const Glib::RefPtr<const Gdk::Screen>& screen,
00229 ConfigMode mode);
00230 #endif // GDKGLEXTMM_MULTIHEAD_SUPPORT
00231
00232 public:
00233
00234 #ifdef GDKGLEXTMM_MULTIHEAD_SUPPORT
00235
00239 Glib::RefPtr<Gdk::Screen> get_screen();
00240
00244 Glib::RefPtr<const Gdk::Screen> get_screen() const;
00245
00246 #endif // GDKGLEXTMM_MULTIHEAD_SUPPORT
00247
00248
00254 bool get_attrib(int attribute, int& value) const;
00255
00256
00261 Glib::RefPtr<Gdk::Colormap> get_colormap();
00262
00267 Glib::RefPtr<const Gdk::Colormap> get_colormap() const;
00268
00269
00274 Glib::RefPtr<Gdk::Visual> get_visual();
00275
00280 Glib::RefPtr<const Gdk::Visual> get_visual() const;
00281
00282
00286 int get_depth() const;
00287
00288
00296 int get_layer_plane() const;
00297
00298
00302 int get_n_aux_buffers() const;
00303
00304
00308 int get_n_sample_buffers() const;
00309
00310
00315 bool is_rgba() const;
00316
00317
00322 bool is_double_buffered() const;
00323
00324
00328 bool is_stereo() const;
00329
00330
00334 bool has_alpha() const;
00335
00336
00340 bool has_depth_buffer() const;
00341
00342
00346 bool has_stencil_buffer() const;
00347
00348
00353 bool has_accum_buffer() const;
00354
00355
00356 public:
00357
00358 public:
00359
00360
00361 protected:
00362
00363
00364
00365
00366
00367 };
00368
00369 }
00370 }
00371
00372
00373 namespace Glib
00374 {
00380 Glib::RefPtr<Gdk::GL::Config> wrap(GdkGLConfig* object, bool take_copy = false);
00381 }
00382
00383
00384 #endif
00385