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

FXGLContext.h
1 /********************************************************************************
2 * *
3 * G L R e n d e r i n g C o n t e x t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 2000,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 FXGLCONTEXT_H
22 #define FXGLCONTEXT_H
23 
24 #ifndef FXID_H
25 #include "FXId.h"
26 #endif
27 
28 namespace FX {
29 
30 
32 class FXAPI FXGLContext : public FXId {
33  FXDECLARE(FXGLContext)
34 private:
35  FXDrawable *surface; // Drawable surface
36  FXGLVisual *visual; // Visual of the context
37  FXGLContext *shared; // Shared with other
38 private:
39  FXGLContext(const FXGLContext&);
40  FXGLContext &operator=(const FXGLContext&);
41 protected:
42  FXGLContext();
43 public:
44 
49  FXGLContext(FXApp *a,FXGLVisual *vis,FXGLContext* shr=NULL);
50 
52  virtual void create();
53 
55  virtual void detach();
56 
58  virtual void destroy();
59 
61  void setVisual(FXGLVisual* vis);
62 
64  FXGLVisual* getVisual() const { return visual; }
65 
67  void setShared(FXGLContext *ctx);
68 
70  FXGLContext* getShared() const { return shared; }
71 
73  FXDrawable *drawable() const { return surface; }
74 
76  FXbool begin(FXDrawable *draw);
77 
79  FXbool end();
80 
82  void swapBuffers();
83 
85  FXbool isCurrent() const;
86 
88  static FXbool hasCurrent();
89 
91  FXbool isDoubleBuffer() const;
92 
94  FXbool isStereo() const;
95 
97  virtual void save(FXStream& store) const;
98 
100  virtual void load(FXStream& store);
101 
103  virtual ~FXGLContext();
104  };
105 
106 
107 
109 extern FXAPI FXbool glUseFXFont(FXFont* font,int first,int count,int list);
110 
111 }
112 
113 #endif
114 

Copyright © 1997-2016 Jeroen van der Zijp