FXGLCanvas.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                G L  C a n v a s   W i n d o w   W i d g e t                   *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1997,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: FXGLCanvas.h,v 1.33 2006/01/22 17:58:02 fox Exp $                        *
00023 ********************************************************************************/
00024 #ifndef FX_DISABLEGL
00025 
00026 #if FX_GRAPHINGMODULE
00027 
00028 #ifndef FXGLCANVAS_H
00029 #define FXGLCANVAS_H
00030 
00031 #ifndef FXCANVAS_H
00032 #include "FXCanvas.h"
00033 #endif
00034 
00035 namespace FX {
00036 
00037 
00038 class FXGLVisual;
00039 
00040 
00042 class FXGRAPHINGMODULEAPI FXGLCanvas : public FXCanvas {
00043   FXDECLARE(FXGLCanvas)
00044 private:
00045   FXGLCanvas  *sgnext;  // Share group next in share list
00046   FXGLCanvas  *sgprev;  // Share group previous in share list
00047 protected:
00048   void        *ctx;     // GL Context
00049 protected:
00050   FXGLCanvas();
00051 private:
00052   FXGLCanvas(const FXGLCanvas&);
00053   FXGLCanvas &operator=(const FXGLCanvas&);
00054 #ifdef WIN32
00055   virtual const char* GetClass() const;
00056 #endif
00057 public:
00058 
00062   FXGLCanvas(FXComposite* p,FXGLVisual *vis,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
00063 
00070   FXGLCanvas(FXComposite* p,FXGLVisual *vis,FXGLCanvas* sharegroup,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
00071 
00073   FXbool isShared() const;
00074 
00076   virtual void create();
00077 
00079   virtual void detach();
00080 
00082   virtual void destroy();
00083 
00085   virtual FXbool makeCurrent();
00086 
00088   virtual FXbool makeNonCurrent();
00089 
00091   virtual FXbool isCurrent() const;
00092 
00094   static void* getCurrentContext();
00095 
00097   void* getContext() const { return ctx; }
00098 
00100   FXuint getOptions() const { return options; }
00101 
00103   void setOptions(FXuint ops) { options=ops; }
00104 
00106   virtual void swapBuffers();
00107 
00109   virtual void save(FXStream& store) const;
00110 
00112   virtual void load(FXStream& store);
00113 
00115   virtual ~FXGLCanvas();
00116   };
00117 
00118 }
00119 
00120 #endif
00121 #endif
00122 #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