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

gdkmm/gl/context.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 // Generated by gtkmmproc -- DO NOT MODIFY!
00003 #ifndef _GDKMM_GL_CONTEXT_H
00004 #define _GDKMM_GL_CONTEXT_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 #include <gdkmm/gl/tokens.h>
00029 #include <gdkmm/gl/config.h>
00030 #include <gdkmm/gl/drawable.h>
00031 
00032 #include <GL/gl.h>
00033 
00034 
00035 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00036 typedef struct _GdkGLContext GdkGLContext;
00037 typedef struct _GdkGLContextClass GdkGLContextClass;
00038 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00039 
00040 
00041 namespace Gdk
00042 {
00043 
00044 namespace GL
00045 { class Context_Class; } // namespace GL
00046 
00047 } // namespace Gdk
00048 namespace Gdk
00049 {
00050 namespace GL
00051 {
00052 
00053 class Drawable;
00054 
00055   /** OpenGL rendering context.
00056    *
00057    *
00058    */
00059 
00060 
00061 class Context : public Glib::Object
00062 {
00063   
00064 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00065 
00066 public:
00067   typedef Context CppObjectType;
00068   typedef Context_Class CppClassType;
00069   typedef GdkGLContext BaseObjectType;
00070   typedef GdkGLContextClass BaseClassType;
00071 
00072 private:
00073   friend class Context_Class;
00074   static CppClassType context_class_;
00075 
00076   // noncopyable
00077   Context(const Context&);
00078   Context& operator=(const Context&);
00079 
00080 protected:
00081   explicit Context(const Glib::ConstructParams& construct_params);
00082   explicit Context(GdkGLContext* castitem);
00083 
00084 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00085 
00086 public:
00087   virtual ~Context();
00088 
00089 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00090   static GType get_type()      G_GNUC_CONST;
00091   static GType get_base_type() G_GNUC_CONST;
00092 #endif
00093 
00094   GdkGLContext*       gobj()       { return reinterpret_cast<GdkGLContext*>(gobject_); }
00095   const GdkGLContext* gobj() const { return reinterpret_cast<GdkGLContext*>(gobject_); }
00096 
00097   GdkGLContext* gobj_copy();
00098 
00099 private:
00100 
00101 
00102 protected:
00103 
00104   Context(const Glib::RefPtr<const Drawable>& gldrawable,
00105           const Glib::RefPtr<const Context>& share_list,
00106           bool direct = true,
00107           int render_type = RGBA_TYPE);
00108 
00109   explicit Context(const Glib::RefPtr<const Drawable>& gldrawable,
00110                    bool direct = true,
00111                    int render_type = RGBA_TYPE);
00112 
00113 public:
00114 
00115   /** Create a new OpenGL rendering context.
00116    *
00117    * @param gldrawable   a Gdk::GL::Drawable.
00118    * @param share_list   the Gdk::GL::Context which to share display lists.
00119    * @param direct       whether rendering is to be done with a direct
00120    *                     connection to the graphics system.
00121    * @param render_type  Gdk::GL::RGBA_TYPE or Gdk::GL::COLOR_INDEX_TYPE
00122    *                     (currently not used).
00123    * @return  the new Gdk::GL::Context.
00124    */
00125   static Glib::RefPtr<Context> create(const Glib::RefPtr<const Drawable>& gldrawable,
00126                                       const Glib::RefPtr<const Context>& share_list,
00127                                       bool direct = true,
00128                                       int render_type = RGBA_TYPE);
00129 
00130   /** Create a new OpenGL rendering context.
00131    *
00132    * @param gldrawable   a Gdk::GL::Drawable.
00133    * @param direct       whether rendering is to be done with a direct
00134    *                     connection to the graphics system.
00135    * @param render_type  Gdk::GL::RGBA_TYPE or Gdk::GL::COLOR_INDEX_TYPE
00136    *                     (currently not used).
00137    * @return  the new Gdk::GL::Context.
00138    */
00139   static Glib::RefPtr<Context> create(const Glib::RefPtr<const Drawable>& gldrawable,
00140                                       bool direct = true,
00141                                       int render_type = RGBA_TYPE);
00142 
00143 public:
00144 
00145   /** Copy state from one rendering context to another.
00146    *
00147    * @a mask contains the bitwise-OR of the same symbolic names that
00148    * are passed to the glPushAttrib() function. You can use
00149    * GL_ALL_ATTRIB_BITS to copy all the rendering state information.
00150    *
00151    * @param src   the source context.
00152    * @param mask  which portions of @a src state are to be copied.
00153    * @return  <tt>false</tt> if it fails, <tt>true</tt> otherwise.
00154    */
00155   bool copy(const Glib::RefPtr<const Context>& src,
00156             unsigned long mask = GL_ALL_ATTRIB_BITS);
00157 
00158   
00159   /** Gets Gdk::GLDrawable to which the @a glcontext  is bound.
00160    * @return The Gdk::GLDrawable or <tt>0</tt> if no Gdk::GLDrawable is bound.
00161    */
00162   Glib::RefPtr<Drawable> get_gl_drawable();
00163   
00164   /** Gets Gdk::GLDrawable to which the @a glcontext  is bound.
00165    * @return The Gdk::GLDrawable or <tt>0</tt> if no Gdk::GLDrawable is bound.
00166    */
00167   Glib::RefPtr<const Drawable> get_gl_drawable() const;
00168 
00169   
00170   /** Gets Gdk::GLConfig with which the @a glcontext  is configured.
00171    * @return The Gdk::GLConfig.
00172    */
00173   Glib::RefPtr<Config> get_gl_config();
00174   
00175   /** Gets Gdk::GLConfig with which the @a glcontext  is configured.
00176    * @return The Gdk::GLConfig.
00177    */
00178   Glib::RefPtr<const Config> get_gl_config() const;
00179 
00180   
00181   /** Gets Gdk::GLContext with which the @a glcontext  shares the display lists and
00182    * texture objects.
00183    * @return The Gdk::GLContext.
00184    */
00185   Glib::RefPtr<Context> get_share_list();
00186   
00187   /** Gets Gdk::GLContext with which the @a glcontext  shares the display lists and
00188    * texture objects.
00189    * @return The Gdk::GLContext.
00190    */
00191   Glib::RefPtr<const Context> get_share_list() const;
00192 
00193   
00194   /** Returns whether the @a glcontext  is a direct rendering context.
00195    * @return <tt>true</tt> if the @a glcontext  is a direct rendering contest.
00196    */
00197   bool is_direct() const;
00198 
00199   
00200   /** Gets render_type of the @a glcontext .
00201    * @return GDK_GL_RGBA_TYPE or GDK_GL_COLOR_INDEX_TYPE.
00202    */
00203   int get_render_type() const;
00204 
00205   
00206   /** Returns the current Gdk::GLContext.
00207    * @return The current Gdk::GLContext or <tt>0</tt> if there is no current
00208    * context.
00209    */
00210   static Glib::RefPtr<Context> get_current();
00211 
00212 
00213 public:
00214 
00215 public:
00216   //C++ methods used to invoke GTK+ virtual functions:
00217 
00218 protected:
00219   //GTK+ Virtual Functions (override these to change behaviour):
00220 
00221   //Default Signal Handlers::
00222 
00223 
00224 };
00225 
00226 } // namespace GL
00227 } // namespace Gdk
00228 
00229 
00230 namespace Glib
00231 {
00232   /** @relates Gdk::GL::Context */
00233   Glib::RefPtr<Gdk::GL::Context> wrap(GdkGLContext* object, bool take_copy = false);
00234 }
00235 
00236 
00237 #endif /* _GDKMM_GL_CONTEXT_H */
00238 

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