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

/home/jeroen/FOX/fox/fox-1.7.33/include/FXGLContext.h
00001 /********************************************************************************
00002 *                                                                               *
00003 *                     G L  R e n d e r i n g   C o n t e x t                    *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 2000,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 FXGLCONTEXT_H
00022 #define FXGLCONTEXT_H
00023 
00024 #ifndef FXID_H
00025 #include "FXId.h"
00026 #endif
00027 
00028 namespace FX {
00029 
00030 
00032 class FXAPI FXGLContext : public FXId {
00033   FXDECLARE(FXGLContext)
00034 private:
00035   FXDrawable  *surface;         // Drawable surface
00036   FXGLVisual  *visual;          // Visual of the context
00037   FXGLContext *shared;          // Shared with other
00038 private:
00039   FXGLContext(const FXGLContext&);
00040   FXGLContext &operator=(const FXGLContext&);
00041 protected:
00042   FXGLContext();
00043 public:
00044 
00049   FXGLContext(FXApp *a,FXGLVisual *vis,FXGLContext* shr=NULL);
00050 
00052   virtual void create();
00053 
00055   virtual void detach();
00056 
00058   virtual void destroy();
00059 
00061   void setVisual(FXGLVisual* vis);
00062 
00064   FXGLVisual* getVisual() const { return visual; }
00065 
00067   void setShared(FXGLContext *ctx);
00068 
00070   FXGLContext* getShared() const { return shared; }
00071 
00073   FXDrawable *drawable() const { return surface; }
00074 
00076   FXbool begin(FXDrawable *draw);
00077 
00079   FXbool end();
00080 
00082   void swapBuffers();
00083 
00085   FXbool isCurrent() const;
00086 
00088   static FXbool hasCurrent();
00089 
00091   FXbool isDoubleBuffer() const;
00092 
00094   FXbool isStereo() const;
00095 
00097   virtual void save(FXStream& store) const;
00098 
00100   virtual void load(FXStream& store);
00101 
00103   virtual ~FXGLContext();
00104   };
00105 
00106 
00107 
00109 extern FXAPI FXbool glUseFXFont(FXFont* font,int first,int count,int list);
00110 
00111 }
00112 
00113 #endif
00114 

Copyright © 1997-2011 Jeroen van der Zijp