00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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
00036 enum {
00037 GLCANVAS_OWN_CONTEXT = 0x00008000
00038 };
00039
00040
00042 class FXAPI FXGLCanvas : public FXCanvas {
00043 FXDECLARE(FXGLCanvas)
00044 protected:
00045 FXGLContext *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