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

FXGLCanvas.h
Go to the documentation of this file.
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,2006 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or *
9 * modify it under the terms of the GNU Lesser General Public *
10 * License as published by the Free Software Foundation; either *
11 * version 2.1 of the License, or (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 GNU *
16 * Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public *
19 * License along with this library; if not, write to the Free Software *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
21 *********************************************************************************
22 * $Id: FXGLCanvas.h,v 1.33 2006/01/22 17:58:02 fox Exp $ *
23 ********************************************************************************/
24 #ifndef FXGLCANVAS_H
25 #define FXGLCANVAS_H
26 
27 #ifndef FXCANVAS_H
28 #include "FXCanvas.h"
29 #endif
30 
31 namespace FX {
32 
33 
34 class FXGLVisual;
35 
36 
37 /// GLCanvas, an area drawn by another object
38 class FXAPI FXGLCanvas : public FXCanvas {
40 private:
41  FXGLCanvas *sgnext; // Share group next in share list
42  FXGLCanvas *sgprev; // Share group previous in share list
43 protected:
44  void *ctx; // GL Context
45 protected:
46  FXGLCanvas();
47 private:
48  FXGLCanvas(const FXGLCanvas&);
49  FXGLCanvas &operator=(const FXGLCanvas&);
50 #ifdef WIN32
51  virtual const char* GetClass() const;
52 #endif
53 public:
54 
55  /**
56  * Construct an OpenGL-capable canvas, with its own private display list.
57  */
58  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);
59 
60  /**
61  * Construct an OpenGL-capable canvas, sharing display
62  * list with another GL canvas. This canvas becomes a member
63  * of a display list share group. All members of the display
64  * list share group have to have the same visual.
65  */
66  FXGLCanvas(FXComposite* p,FXGLVisual *vis,FXGLCanvas* sharegroup,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
67 
68  /// Return TRUE if it is sharing display lists
69  FXbool isShared() const;
70 
71  /// Create all of the server-side resources for this window
72  virtual void create();
73 
74  /// Detach the server-side resources for this window
75  virtual void detach();
76 
77  /// Destroy the server-side resources for this window
78  virtual void destroy();
79 
80  /// Make OpenGL context current prior to performing OpenGL commands
81  virtual FXbool makeCurrent();
82 
83  /// Make OpenGL context non current
84  virtual FXbool makeNonCurrent();
85 
86  /// Return TRUE if this window's context is current
87  virtual FXbool isCurrent() const;
88 
89  /// Return current context, if any
90  static void* getCurrentContext();
91 
92  /// Get GL context handle
93  void* getContext() const { return ctx; }
94 
95  /// Swap front and back buffer
96  virtual void swapBuffers();
97 
98  /// Save object to stream
99  virtual void save(FXStream& store) const;
100 
101  /// Load object from stream
102  virtual void load(FXStream& store);
103 
104  /// Destructor
105  virtual ~FXGLCanvas();
106  };
107 
108 }
109 
110 #endif
111 
Canvas, an area drawn by another object.
Definition: FXCanvas.h:35
unsigned int FXuint
Definition: fxdefs.h:396
FXuint FXSelector
Association key.
Definition: FXObject.h:53
#define FXAPI
Definition: fxdefs.h:122
FXuchar FXbool
Definition: fxdefs.h:393
Base composite.
Definition: FXComposite.h:35
#define NULL
Definition: fxdefs.h:41
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:99
Definition: FX4Splitter.h:31
int FXint
Definition: fxdefs.h:397
GLCanvas, an area drawn by another object.
Definition: FXGLCanvas.h:38
Visual describes pixel format of a drawable.
Definition: FXGLVisual.h:44
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:166
#define FXDECLARE(classname)
Macro to set up class declaration.
Definition: FXObject.h:92

Copyright © 1997-2005 Jeroen van der Zijp