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

FXGLCanvas.h
1 /********************************************************************************
2 * *
3 * G L C a n v a s W i n d o w W i d g e t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1997,2017 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/> *
20 ********************************************************************************/
21 #ifndef FXGLCANVAS_H
22 #define FXGLCANVAS_H
23 
24 #ifndef FXCANVAS_H
25 #include "FXCanvas.h"
26 #endif
27 
28 namespace FX {
29 
30 
31 class FXGLVisual;
32 class FXGLContext;
33 
34 
35 // GL Canvas options
36 enum {
37  GLCANVAS_OWN_CONTEXT = 0x00008000
38  };
39 
40 
42 class FXAPI FXGLCanvas : public FXCanvas {
43  FXDECLARE(FXGLCanvas)
44 protected:
45  FXGLContext *context; // Graphic context
46 protected:
47  FXGLCanvas();
48 private:
49  FXGLCanvas(const FXGLCanvas&);
50  FXGLCanvas &operator=(const FXGLCanvas&);
51 #ifdef WIN32
52  virtual const void* GetClass() const;
53 #endif
54 public:
55 
59  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);
60 
64  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);
65 
69  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);
70 
72  void setContext(FXGLContext *ctx,FXbool owned=false);
73 
75  FXGLContext* getContext() const { return context; }
76 
78  virtual void create();
79 
81  virtual void detach();
82 
84  virtual void destroy();
85 
87  virtual FXbool makeCurrent();
88 
90  virtual FXbool makeNonCurrent();
91 
93  virtual FXbool isCurrent() const;
94 
96  virtual void swapBuffers();
97 
99  FXbool isShared() const;
100 
102  virtual void save(FXStream& store) const;
103 
105  virtual void load(FXStream& store);
106 
108  virtual ~FXGLCanvas();
109  };
110 
111 }
112 
113 #endif
114 

Copyright © 1997-2016 Jeroen van der Zijp