Panda3D
glxGraphicsPixmap.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file glxGraphicsPixmap.h
10  * @author drose
11  * @date 2009-03-10
12  */
13 
14 #ifndef GLXGRAPHICSPIXMAP_H
15 #define GLXGRAPHICSPIXMAP_H
16 
17 #include "pandabase.h"
18 
19 #include "glxGraphicsPipe.h"
20 #include "graphicsBuffer.h"
21 
22 /**
23  * Another offscreen buffer in the GLX environment. This creates a Pixmap
24  * object, which is probably less efficient than a GLXPBuffer, so this class
25  * is a second choice to glxGraphicsBuffer. However, this might be the only
26  * option for some graphics drivers.
27  */
29 public:
31  const std::string &name,
32  const FrameBufferProperties &fb_prop,
33  const WindowProperties &win_prop,
34  int flags,
36  GraphicsOutput *host);
37  virtual ~glxGraphicsPixmap();
38 
39  virtual bool begin_frame(FrameMode mode, Thread *current_thread);
40  virtual void end_frame(FrameMode mode, Thread *current_thread);
41 
42 protected:
43  virtual void close_buffer();
44  virtual bool open_buffer();
45 
46 private:
47  X11_Display *_display;
48  X11_Window _drawable;
49  Pixmap _x_pixmap;
50  GLXPixmap _glx_pixmap;
51 
52 public:
53  static TypeHandle get_class_type() {
54  return _type_handle;
55  }
56  static void init_type() {
57  GraphicsBuffer::init_type();
58  register_type(_type_handle, "glxGraphicsPixmap",
59  GraphicsBuffer::get_class_type());
60  }
61  virtual TypeHandle get_type() const {
62  return get_class_type();
63  }
64  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
65 
66 private:
67  static TypeHandle _type_handle;
68 };
69 
70 #include "glxGraphicsPixmap.I"
71 
72 #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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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:52
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:46
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:81
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.