Panda3D
graphicsBuffer.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 graphicsBuffer.h
10  * @author drose
11  * @date 2004-02-06
12  */
13 
14 #ifndef GRAPHICSBUFFER_H
15 #define GRAPHICSBUFFER_H
16 
17 #include "pandabase.h"
18 
19 #include "graphicsOutput.h"
20 #include "texture.h"
21 #include "pointerTo.h"
22 
23 /**
24  * An offscreen buffer for rendering into. This is similar in function to a
25  * GraphicsWindow, except that the output is not visible to the user.
26  */
27 class EXPCL_PANDA_DISPLAY GraphicsBuffer : public GraphicsOutput {
28 protected:
30  GraphicsPipe *pipe,
31  const std::string &name,
32  const FrameBufferProperties &fb_prop,
33  const WindowProperties &win_prop,
34  int flags,
36  GraphicsOutput *host);
37 
38 PUBLISHED:
39  virtual ~GraphicsBuffer();
40  virtual void set_size(int x, int y);
41 
42 public:
43  virtual void request_open();
44  virtual void request_close();
45 
46  // It is an error to call any of the following methods from any thread other
47  // than the window thread. These methods are normally called by the
48  // GraphicsEngine.
49  virtual void set_close_now();
50  virtual void process_events();
51 
52 protected:
53  virtual void close_buffer();
54  virtual bool open_buffer();
55 
56 protected:
57  enum OpenRequest {
58  OR_none,
59  OR_open,
60  OR_close,
61  };
62  OpenRequest _open_request;
63 
64 public:
65  static TypeHandle get_class_type() {
66  return _type_handle;
67  }
68  static void init_type() {
69  GraphicsOutput::init_type();
70  register_type(_type_handle, "GraphicsBuffer",
71  GraphicsOutput::get_class_type());
72  }
73  virtual TypeHandle get_type() const {
74  return get_class_type();
75  }
76  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
77 
78 private:
79  static TypeHandle _type_handle;
80 };
81 
82 #include "graphicsBuffer.I"
83 
84 #endif
virtual void request_close()
This is called by the GraphicsEngine to request that the window (or whatever) close itself or,...
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.
virtual void set_close_now()
This is called by the GraphicsEngine to insist that the output be closed immediately.
A container for the various kinds of properties we might ask to have on a graphics window before we o...
virtual void request_open()
This is called by the GraphicsEngine to request that the window (or whatever) open itself or,...
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...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void process_events()
Do whatever processing in the window thread is appropriate for this output object each frame.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Encapsulates all the communication with a particular instance of a given rendering backend.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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...