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
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
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
00082
00083 inline ConfigMode operator|(ConfigMode lhs, ConfigMode rhs)
00084 { return static_cast<ConfigMode>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
00085
00086
00087 inline ConfigMode operator&(ConfigMode lhs, ConfigMode rhs)
00088 { return static_cast<ConfigMode>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
00089
00090
00091 inline ConfigMode operator^(ConfigMode lhs, ConfigMode rhs)
00092 { return static_cast<ConfigMode>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
00093
00094
00095 inline ConfigMode operator~(ConfigMode flags)
00096 { return static_cast<ConfigMode>(~static_cast<unsigned>(flags)); }
00097
00098
00099 inline ConfigMode& operator|=(ConfigMode& lhs, ConfigMode rhs)
00100 { return (lhs = static_cast<ConfigMode>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
00101
00102
00103 inline ConfigMode& operator&=(ConfigMode& lhs, ConfigMode rhs)
00104 { return (lhs = static_cast<ConfigMode>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
00105
00106
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
00137
00138
00139
00140
00141
00142
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:
00155 friend class Config_Class;
00156 static CppClassType config_class_;
00157
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
00176 GdkGLConfig* gobj() { return reinterpret_cast<GdkGLConfig*>(gobject_); }
00177 const GdkGLConfig* gobj() const { return reinterpret_cast<GdkGLConfig*>(gobject_); }
00178
00179 GdkGLConfig* gobj_copy();
00180
00181 private:
00182
00183
00184 protected:
00185
00186 explicit Config(const int* attrib_list);
00187 #ifdef GDKGLEXTMM_MULTIHEAD_SUPPORT
00188 Config(const Glib::RefPtr<const Gdk::Screen>& screen,
00189 const int* attrib_list);
00190 #endif // GDKGLEXTMM_MULTIHEAD_SUPPORT
00191 explicit Config(ConfigMode mode);
00192 #ifdef GDKGLEXTMM_MULTIHEAD_SUPPORT
00193 Config(const Glib::RefPtr<const Gdk::Screen>& screen,
00194 ConfigMode mode);
00195 #endif // GDKGLEXTMM_MULTIHEAD_SUPPORT
00196
00197 public:
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207 static Glib::RefPtr<Config> create(const int* attrib_list);
00208
00209 #ifdef GDKGLEXTMM_MULTIHEAD_SUPPORT
00210 static Glib::RefPtr<Config> create(const Glib::RefPtr<const Gdk::Screen>& screen,
00211 const int* attrib_list);
00212 #endif // GDKGLEXTMM_MULTIHEAD_SUPPORT
00213
00214
00215
00216
00217
00218
00219
00220
00221 static Glib::RefPtr<Config> create(ConfigMode mode);
00222
00223 #ifdef GDKGLEXTMM_MULTIHEAD_SUPPORT
00224 static Glib::RefPtr<Config> create(const Glib::RefPtr<const Gdk::Screen>& screen,
00225 ConfigMode mode);
00226 #endif // GDKGLEXTMM_MULTIHEAD_SUPPORT
00227
00228 public:
00229
00230 #ifdef GDKGLEXTMM_MULTIHEAD_SUPPORT
00231
00232
00233
00234
00235 Glib::RefPtr<Gdk::Screen> get_screen();
00236
00237
00238
00239
00240 Glib::RefPtr<const Gdk::Screen> get_screen() const;
00241
00242 #endif // GDKGLEXTMM_MULTIHEAD_SUPPORT
00243
00244
00245
00246
00247
00248
00249
00250 bool get_attrib(int attribute, int& value) const;
00251
00252
00253
00254
00255
00256
00257 Glib::RefPtr<Gdk::Colormap> get_colormap();
00258
00259
00260
00261
00262
00263 Glib::RefPtr<const Gdk::Colormap> get_colormap() const;
00264
00265
00266
00267
00268
00269
00270 Glib::RefPtr<Gdk::Visual> get_visual();
00271
00272
00273
00274
00275
00276 Glib::RefPtr<const Gdk::Visual> get_visual() const;
00277
00278
00279
00280
00281
00282 int get_depth() const;
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292 int get_layer_plane() const;
00293
00294
00295
00296
00297
00298 int get_n_aux_buffers() const;
00299
00300
00301
00302
00303
00304 int get_n_sample_buffers() const;
00305
00306
00307
00308
00309
00310
00311 bool is_rgba() const;
00312
00313
00314
00315
00316
00317
00318 bool is_double_buffered() const;
00319
00320
00321
00322
00323
00324 bool is_stereo() const;
00325
00326
00327
00328
00329
00330 bool has_alpha() const;
00331
00332
00333
00334
00335
00336 bool has_depth_buffer() const;
00337
00338
00339
00340
00341
00342 bool has_stencil_buffer() const;
00343
00344
00345
00346
00347
00348
00349 bool has_accum_buffer() const;
00350
00351
00352 public:
00353
00354 public:
00355
00356
00357 protected:
00358
00359
00360
00361
00362
00363 };
00364
00365 }
00366 }
00367
00368
00369 namespace Glib
00370 {
00371
00372 Glib::RefPtr<Gdk::GL::Config> wrap(GdkGLConfig* object, bool take_copy = false);
00373 }
00374
00375
00376 #endif
00377