Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Examples  

gdkmm/gl/config.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 // Generated by gtkmmproc -- DO NOT MODIFY!
00003 #ifndef _GDKMM_GL_CONFIG_H
00004 #define _GDKMM_GL_CONFIG_H
00005 
00006 #include <glibmm.h>
00007 
00008 // -*- C++ -*-
00009 /* gdkglextmm - C++ Wrapper for GdkGLExt
00010  * Copyright (C) 2002-2003  Naofumi Yasufuku
00011  *
00012  * This library is free software; you can redistribute it and/or
00013  * modify it under the terms of the GNU Lesser General Public
00014  * License as published by the Free Software Foundation; either
00015  * version 2.1 of the License, or (at your option) any later version.
00016  *
00017  * This library is distributed in the hope that it will be useful,
00018  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020  * Lesser General Public License for more details.
00021  *
00022  * You should have received a copy of the GNU Lesser General Public
00023  * License along with this library; if not, write to the Free Software
00024  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA.
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 /* DOXYGEN_SHOULD_SKIP_THIS */
00040 
00041 
00042 namespace Gdk
00043 {
00044 
00045 namespace GL
00046 { class Config_Class; } // namespace GL
00047 
00048 } // namespace Gdk
00049 namespace Gdk
00050 {
00051 namespace GL
00052 {
00053 
00054 /** @addtogroup gdkmm_glEnums Enums and Flags */
00055 
00056 /**
00057  * @ingroup gdkmm_glEnums
00058  * @par Bitwise operators:
00059  * <tt>%ConfigMode operator|(ConfigMode, ConfigMode)</tt><br>
00060  * <tt>%ConfigMode operator&(ConfigMode, ConfigMode)</tt><br>
00061  * <tt>%ConfigMode operator^(ConfigMode, ConfigMode)</tt><br>
00062  * <tt>%ConfigMode operator~(ConfigMode)</tt><br>
00063  * <tt>%ConfigMode& operator|=(ConfigMode&, ConfigMode)</tt><br>
00064  * <tt>%ConfigMode& operator&=(ConfigMode&, ConfigMode)</tt><br>
00065  * <tt>%ConfigMode& operator^=(ConfigMode&, ConfigMode)</tt><br>
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 /** @ingroup gdkmm_glEnums */
00083 inline ConfigMode operator|(ConfigMode lhs, ConfigMode rhs)
00084   { return static_cast<ConfigMode>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
00085 
00086 /** @ingroup gdkmm_glEnums */
00087 inline ConfigMode operator&(ConfigMode lhs, ConfigMode rhs)
00088   { return static_cast<ConfigMode>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
00089 
00090 /** @ingroup gdkmm_glEnums */
00091 inline ConfigMode operator^(ConfigMode lhs, ConfigMode rhs)
00092   { return static_cast<ConfigMode>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
00093 
00094 /** @ingroup gdkmm_glEnums */
00095 inline ConfigMode operator~(ConfigMode flags)
00096   { return static_cast<ConfigMode>(~static_cast<unsigned>(flags)); }
00097 
00098 /** @ingroup gdkmm_glEnums */
00099 inline ConfigMode& operator|=(ConfigMode& lhs, ConfigMode rhs)
00100   { return (lhs = static_cast<ConfigMode>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
00101 
00102 /** @ingroup gdkmm_glEnums */
00103 inline ConfigMode& operator&=(ConfigMode& lhs, ConfigMode rhs)
00104   { return (lhs = static_cast<ConfigMode>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
00105 
00106 /** @ingroup gdkmm_glEnums */
00107 inline ConfigMode& operator^=(ConfigMode& lhs, ConfigMode rhs)
00108   { return (lhs = static_cast<ConfigMode>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
00109 
00110 } // namespace GL
00111 
00112 } // namespace Gdk
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 } // namespace Glib
00127 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00128 
00129 
00130 namespace Gdk
00131 {
00132 
00133 namespace GL
00134 {
00135 
00136 
00137   /** OpenGL frame buffer configuration.
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   // noncopyable
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 /* DOXYGEN_SHOULD_SKIP_THIS */
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   /** Returns an OpenGL frame buffer configuration that match
00200    * the specified attributes.
00201    *
00202    * @param attrib_list  a list of attribute/value pairs. The last
00203    *                     attribute must be Gdk::GL::ATTRIB_LIST_NONE.
00204    * @return  the new Gdk::GL::Config if it is successful,
00205    *          NULL RefPtr otherwise.
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   /** Returns an OpenGL frame buffer configuration that match
00215    * the specified display mode.
00216    *
00217    * @param mode  display mode bit mask.
00218    * @return  the new Gdk::GL::Config if it is successful,
00219    *          NULL RefPtr otherwise.
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   /** Get Gdk::Screen.
00233    * @return The Gdk::Screen.
00234    */
00235   Glib::RefPtr<Gdk::Screen> get_screen();
00236   
00237   /** Get Gdk::Screen.
00238    * @return The Gdk::Screen.
00239    */
00240   Glib::RefPtr<const Gdk::Screen> get_screen() const;
00241 
00242 #endif // GDKGLEXTMM_MULTIHEAD_SUPPORT
00243 
00244   
00245   /** Gets information about a OpenGL frame buffer configuration.
00246    * @param attribute The attribute to be returned.
00247    * @param value Returns the requested value.
00248    * @return <tt>true</tt> if it succeeded, <tt>false</tt> otherwise.
00249    */
00250   bool get_attrib(int attribute, int& value) const;
00251 
00252   
00253   /** Gets the Gdk::Colormap that is appropriate for the OpenGL frame buffer
00254    * configuration.
00255    * @return The appropriate Gdk::Colormap.
00256    */
00257   Glib::RefPtr<Gdk::Colormap> get_colormap();
00258   
00259   /** Gets the Gdk::Colormap that is appropriate for the OpenGL frame buffer
00260    * configuration.
00261    * @return The appropriate Gdk::Colormap.
00262    */
00263   Glib::RefPtr<const Gdk::Colormap> get_colormap() const;
00264 
00265   
00266   /** Gets the Gdk::Visual that is appropriate for the OpenGL frame buffer
00267    * configuration.
00268    * @return The appropriate Gdk::Visual.
00269    */
00270   Glib::RefPtr<Gdk::Visual> get_visual();
00271   
00272   /** Gets the Gdk::Visual that is appropriate for the OpenGL frame buffer
00273    * configuration.
00274    * @return The appropriate Gdk::Visual.
00275    */
00276   Glib::RefPtr<const Gdk::Visual> get_visual() const;
00277 
00278   
00279   /** Gets the color depth of the OpenGL-capable visual.
00280    * @return Number of bits per pixel.
00281    */
00282   int get_depth() const;
00283 
00284   
00285   /** Gets the layer plane (level) of the frame buffer.
00286    * Zero is the default frame buffer.
00287    * Positive layer planes correspond to frame buffers that overlay the default
00288    * buffer, and negative layer planes correspond to frame buffers that underlie
00289    * the default frame buffer.
00290    * @return Layer plane.
00291    */
00292   int get_layer_plane() const;
00293 
00294   
00295   /** Gets the number of auxiliary color buffers.
00296    * @return Number of auxiliary color buffers.
00297    */
00298   int get_n_aux_buffers() const;
00299 
00300   
00301   /** Gets the number of multisample buffers.
00302    * @return Number of multisample buffers.
00303    */
00304   int get_n_sample_buffers() const;
00305 
00306   
00307   /** Returns whether the configured frame buffer is RGBA mode.
00308    * @return <tt>true</tt> if the configured frame buffer is RGBA mode, <tt>false</tt>
00309    * otherwise.
00310    */
00311   bool is_rgba() const;
00312 
00313   
00314   /** Returns whether the configuration supports the double-buffered visual.
00315    * @return <tt>true</tt> if the double-buffered visual is supported, <tt>false</tt>
00316    * otherwise.
00317    */
00318   bool is_double_buffered() const;
00319 
00320   
00321   /** Returns whether the configuration supports the stereo visual.
00322    * @return <tt>true</tt> if the stereo visual is supported, <tt>false</tt> otherwise.
00323    */
00324   bool is_stereo() const;
00325 
00326   
00327   /** Returns whether the configured color buffer has alpha bits.
00328    * @return <tt>true</tt> if the color buffer has alpha bits, <tt>false</tt> otherwise.
00329    */
00330   bool has_alpha() const;
00331 
00332   
00333   /** Returns whether the configured frame buffer has depth buffer.
00334    * @return <tt>true</tt> if the frame buffer has depth buffer, <tt>false</tt> otherwise.
00335    */
00336   bool has_depth_buffer() const;
00337 
00338   
00339   /** Returns whether the configured frame buffer has stencil buffer.
00340    * @return <tt>true</tt> if the frame buffer has stencil buffer, <tt>false</tt> otherwise.
00341    */
00342   bool has_stencil_buffer() const;
00343 
00344   
00345   /** Returns whether the configured frame buffer has accumulation buffer.
00346    * @return <tt>true</tt> if the frame buffer has accumulation buffer, <tt>false</tt>
00347    * otherwise.
00348    */
00349   bool has_accum_buffer() const;
00350 
00351 
00352 public:
00353 
00354 public:
00355   //C++ methods used to invoke GTK+ virtual functions:
00356 
00357 protected:
00358   //GTK+ Virtual Functions (override these to change behaviour):
00359 
00360   //Default Signal Handlers::
00361 
00362 
00363 };
00364 
00365 } // namespace GL
00366 } // namespace Gdk
00367 
00368 
00369 namespace Glib
00370 {
00371   /** @relates Gdk::GL::Config */
00372   Glib::RefPtr<Gdk::GL::Config> wrap(GdkGLConfig* object, bool take_copy = false);
00373 }
00374 
00375 
00376 #endif /* _GDKMM_GL_CONFIG_H */
00377 

Generated on Sat May 17 02:09:50 2003 for gtkglextmm by doxygen1.3