Panda3D
glxGraphicsPixmap.h
1 // Filename: glxGraphicsPixmap.h
2 // Created by: drose (10Mar09)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef GLXGRAPHICSPIXMAP_H
16 #define GLXGRAPHICSPIXMAP_H
17 
18 #include "pandabase.h"
19 
20 #include "glxGraphicsPipe.h"
21 #include "graphicsBuffer.h"
22 
23 ////////////////////////////////////////////////////////////////////
24 // Class : glxGraphicsPixmap
25 // Description : Another offscreen buffer in the GLX environment. This
26 // creates a Pixmap object, which is probably less
27 // efficient than a GLXPBuffer, so this class is a
28 // second choice to glxGraphicsBuffer. However, this
29 // might be the only option for some graphics drivers.
30 ////////////////////////////////////////////////////////////////////
32 public:
34  const string &name,
35  const FrameBufferProperties &fb_prop,
36  const WindowProperties &win_prop,
37  int flags,
39  GraphicsOutput *host);
40  virtual ~glxGraphicsPixmap();
41 
42  virtual bool begin_frame(FrameMode mode, Thread *current_thread);
43  virtual void end_frame(FrameMode mode, Thread *current_thread);
44 
45 protected:
46  virtual void close_buffer();
47  virtual bool open_buffer();
48 
49 private:
50  X11_Display *_display;
51  X11_Window _drawable;
52  Pixmap _x_pixmap;
53  GLXPixmap _glx_pixmap;
54 
55 public:
56  static TypeHandle get_class_type() {
57  return _type_handle;
58  }
59  static void init_type() {
60  GraphicsBuffer::init_type();
61  register_type(_type_handle, "glxGraphicsPixmap",
62  GraphicsBuffer::get_class_type());
63  }
64  virtual TypeHandle get_type() const {
65  return get_class_type();
66  }
67  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
68 
69 private:
70  static TypeHandle _type_handle;
71 };
72 
73 #include "glxGraphicsPixmap.I"
74 
75 #endif
virtual void end_frame(FrameMode mode, Thread *current_thread)
This function will be called within the draw thread after rendering is completed for a given frame...
A container for the various kinds of properties we might ask to have on a graphics window before we o...
An offscreen buffer for rendering into.
An object to create GraphicsOutputs that share a particular 3-D API.
Definition: graphicsPipe.h:58
This is a base class for the various different classes that represent the result of a frame of render...
A thread; that is, a lightweight process.
Definition: thread.h:51
Encapsulates all the communication with a particular instance of a given rendering backend...
virtual bool begin_frame(FrameMode mode, Thread *current_thread)
This function will be called within the draw thread before beginning rendering for a given frame...
This class is the main interface to controlling the render process.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
A container for the various kinds of properties we might ask to have on a graphics frameBuffer before...
Another offscreen buffer in the GLX environment.