FXGLContext.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                        G L  C o n t e x t   C l a s s                         *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 2000,2006 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or                 *
00009 * modify it under the terms of the GNU Lesser General Public                    *
00010 * License as published by the Free Software Foundation; either                  *
00011 * version 2.1 of the License, or (at your option) any later version.            *
00012 *                                                                               *
00013 * This library is distributed in the hope that it will be useful,               *
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU             *
00016 * Lesser General Public License for more details.                               *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public              *
00019 * License along with this library; if not, write to the Free Software           *
00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.    *
00021 *********************************************************************************
00022 * $Id: FXGLContext.h,v 1.14 2006/01/22 17:58:02 fox Exp $                       *
00023 ********************************************************************************/
00024 #ifndef FX_DISABLEGL
00025 
00026 #if FX_GRAPHINGMODULE
00027 
00028 #ifndef FXGLCONTEXT_H
00029 #define FXGLCONTEXT_H
00030 
00032 
00033 namespace FX {
00034 
00035 class FXApp;
00036 class FXDrawable;
00037 class FXGLVisual;
00038 
00039 
00050 class FXGRAPHINGMODULEAPI FXGLContext : public FXId {
00051   FXDECLARE(FXGLContext)
00052 private:
00053   FXGLVisual     *visual;     // Visual for this context
00054   FXDrawable     *surface;    // Drawable context is locked on
00055   FXGLContext    *sgnext;     // Share group next in share list
00056   FXGLContext    *sgprev;     // Share group previous in share list
00057 protected:
00058   void           *ctx;        // GL Context
00059 protected:
00060   FXGLContext():visual(NULL),surface(NULL),sgnext(NULL),sgprev(NULL),ctx(NULL){}
00061 private:
00062   FXGLContext(const FXGLContext&);
00063   FXGLContext &operator=(const FXGLContext&);
00064 public:
00065 
00069   FXGLContext(FXApp* a,FXGLVisual *vis);
00070 
00074   FXGLContext(FXApp* a,FXGLVisual *vis,FXGLContext *shared);
00075 
00077   FXbool isShared() const;
00078 
00080   FXGLVisual* getVisual() const { return visual; }
00081 
00083   virtual void create();
00084 
00086   virtual void detach();
00087 
00089   virtual void destroy();
00090 
00092   FXbool begin(FXDrawable *drawable);
00093 
00095   FXbool end();
00096 
00098   void swapBuffers();
00099 
00101   void swapSubBuffers(FXint x,FXint y,FXint w,FXint h);
00102 
00104   virtual void save(FXStream& store) const;
00105 
00107   virtual void load(FXStream& store);
00108 
00110   virtual ~FXGLContext();
00111   };
00112 
00113 }
00114 
00115 #endif
00116 #endif
00117 #endif

(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:31:22 2009 for TnFOX by doxygen v1.4.7