Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

/home/jeroen/FOX/fox/fox-1.7.33/include/FXGLCanvas.h
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,2012 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or modify          *
00009 * it under the terms of the GNU Lesser General Public License as published by   *
00010 * the Free Software Foundation; either version 3 of the License, or             *
00011 * (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                 *
00016 * GNU Lesser General Public License for more details.                           *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public License      *
00019 * along with this program.  If not, see <http://www.gnu.org/licenses/>          *
00020 ********************************************************************************/
00021 #ifndef FXGLCANVAS_H
00022 #define FXGLCANVAS_H
00023 
00024 #ifndef FXCANVAS_H
00025 #include "FXCanvas.h"
00026 #endif
00027 
00028 namespace FX {
00029 
00030 
00031 class FXGLVisual;
00032 class FXGLContext;
00033 
00034 
00035 // GL Canvas options
00036 enum {
00037   GLCANVAS_OWN_CONTEXT = 0x00008000  
00038   };
00039 
00040 
00042 class FXAPI FXGLCanvas : public FXCanvas {
00043   FXDECLARE(FXGLCanvas)
00044 protected:
00045   FXGLContext *context; // Graphic context
00046 protected:
00047   FXGLCanvas();
00048 private:
00049   FXGLCanvas(const FXGLCanvas&);
00050   FXGLCanvas &operator=(const FXGLCanvas&);
00051 #ifdef WIN32
00052   virtual const void* GetClass() const;
00053 #endif
00054 public:
00055 
00059   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);
00060 
00064   FXGLCanvas(FXComposite* p,FXGLVisual *vis,FXGLCanvas* share,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
00065 
00069   FXGLCanvas(FXComposite* p,FXGLContext* ctx,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
00070 
00072   void setContext(FXGLContext *ctx,FXbool owned=false);
00073 
00075   FXGLContext* getContext() const { return context; }
00076 
00078   virtual void create();
00079 
00081   virtual void detach();
00082 
00084   virtual void destroy();
00085 
00087   virtual FXbool makeCurrent();
00088 
00090   virtual FXbool makeNonCurrent();
00091 
00093   virtual FXbool isCurrent() const;
00094 
00096   virtual void swapBuffers();
00097 
00099   FXbool isShared() const;
00100 
00102   virtual void save(FXStream& store) const;
00103 
00105   virtual void load(FXStream& store);
00106 
00108   virtual ~FXGLCanvas();
00109   };
00110 
00111 }
00112 
00113 #endif
00114 

Copyright © 1997-2011 Jeroen van der Zijp