15 #include "pandabase.h" 17 #include "tinyGraphicsBuffer.h" 18 #include "config_tinydisplay.h" 19 #include "tinyGraphicsStateGuardian.h" 20 #include "pStatTimer.h" 37 GraphicsBuffer(engine, pipe, name, fb_prop, win_prop, flags, gsg, host)
48 ~TinyGraphicsBuffer() {
62 begin_frame_spam(mode);
68 DCAST_INTO_R(tinygsg, _gsg,
false);
70 tinygsg->_current_frame_buffer = _frame_buffer;
74 return _gsg->begin_frame(current_thread);
89 if (mode == FM_render) {
94 _gsg->end_frame(current_thread);
96 if (mode == FM_render) {
98 clear_cube_map_selection();
108 void TinyGraphicsBuffer::
112 DCAST_INTO_V(tinygsg, _gsg);
113 tinygsg->_current_frame_buffer = NULL;
127 bool TinyGraphicsBuffer::
136 DCAST_INTO_R(tinygsg, _gsg,
false);
139 create_frame_buffer();
140 if (_frame_buffer == NULL) {
141 tinydisplay_cat.error()
142 <<
"Could not create frame buffer.\n";
146 tinygsg->_current_frame_buffer = _frame_buffer;
164 void TinyGraphicsBuffer::
165 create_frame_buffer() {
166 if (_frame_buffer != NULL) {
167 ZB_close(_frame_buffer);
168 _frame_buffer = NULL;
virtual void clear(DrawableRegion *clearable)
Clears the framebuffer within the current DisplayRegion, according to the flags indicated by the give...
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...
bool reset_if_new()
Calls reset() to initialize the GSG, but only if it hasn't been called yet.
int get_fb_y_size() const
Returns the internal height of the window or buffer.
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.
This is a base class for the various different classes that represent the result of a frame of render...
int get_fb_x_size() const
Returns the internal width of the window or buffer.
A thread; that is, a lightweight process.
Encapsulates all the communication with a particular instance of a given rendering backend...
bool is_valid() const
Returns true if the GSG has been correctly initialized within a graphics context, false if there has ...
This class is the main interface to controlling the render process.
TypeHandle is the identifier used to differentiate C++ class types.
A container for the various kinds of properties we might ask to have on a graphics frameBuffer before...
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...
An interface to the TinyPanda software rendering code within this module.
const FrameBufferProperties & get_fb_properties() const
Returns the framebuffer properties of the window.