Go to the documentation of this file.
16 TypeHandle CallbackGraphicsWindow::_type_handle;
17 TypeHandle CallbackGraphicsWindow::WindowCallbackData::_type_handle;
18 TypeHandle CallbackGraphicsWindow::EventsCallbackData::_type_handle;
19 TypeHandle CallbackGraphicsWindow::PropertiesCallbackData::_type_handle;
20 TypeHandle CallbackGraphicsWindow::RenderCallbackData::_type_handle;
25 CallbackGraphicsWindow::
27 const std::string &name,
32 GraphicsWindow(engine, pipe, name, fb_prop, win_prop, flags, gsg, nullptr)
34 #ifdef DO_MEMORY_USAGE
39 _properties.set_origin(0, 0);
40 _properties.set_size(0, 0);
46 CallbackGraphicsWindow::
47 ~CallbackGraphicsWindow() {
56 return add_input_device(GraphicsWindowInputDevice::pointer_and_keyboard(
this, name));
68 if (_render_callback !=
nullptr) {
70 _render_callback->do_callback(&data);
71 result = data.get_render_flag();
83 return _gsg->begin_frame(current_thread);
93 if (_render_callback !=
nullptr) {
96 _gsg->set_state_and_transform(RenderState::make_empty(), _gsg->get_internal_transform());
97 _gsg->clear_before_callback();
100 _render_callback->do_callback(&data);
105 _gsg->end_frame(current_thread);
107 if (mode == FM_render) {
109 clear_cube_map_selection();
126 if (_render_callback !=
nullptr) {
128 _render_callback->do_callback(&data);
143 if (_render_callback !=
nullptr) {
145 _render_callback->do_callback(&data);
160 if (_events_callback !=
nullptr) {
162 _events_callback->do_callback(&data);
174 if (_properties_callback !=
nullptr) {
176 _properties_callback->do_callback(&data);
186 bool CallbackGraphicsWindow::
193 _fb_properties.set_rgb_color(1);
195 if (_fb_properties.get_color_bits() == 0) {
196 _fb_properties.set_color_bits(16);
207 bool CallbackGraphicsWindow::
208 do_reshape_request(
int x_origin,
int y_origin,
bool has_origin,
209 int x_size,
int y_size) {
215 properties.
set_size(x_size, y_size);
216 system_changed_properties(properties);
226 _window->GraphicsWindow::process_events();
234 _window->GraphicsWindow::set_properties_now(_properties);
242 switch (_callback_type) {
243 case RCT_begin_frame:
246 set_render_flag(render_flag);
255 _window->GraphicsWindow::begin_flip();
259 _window->GraphicsWindow::end_flip();
int create_input_device(const std::string &name)
Adds a new input device (mouse) to the window with the indicated name.
A container for the various kinds of properties we might ask to have on a graphics frameBuffer before...
virtual void set_properties_now(WindowProperties &properties)
Applies the requested set of properties to the window, if possible, for instance to request a change ...
set_origin
Specifies the origin on the screen (in pixels, relative to the top-left corner) at which the window s...
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.
virtual void begin_flip()
This function will be called within the draw thread after end_frame() has been called on all windows,...
virtual void upcall()
You should make this call during the callback if you want to continue the normal function that would ...
A container for the various kinds of properties we might ask to have on a graphics window before we o...
virtual void end_flip()
This function will be called within the draw thread after begin_flip() has been called on all windows...
virtual void process_events()
Do whatever processing is necessary to ensure that the window responds to user events.
This class is the main interface to controlling the render process.
get_current_thread
Returns a pointer to the currently-executing Thread object.
TypeHandle is the identifier used to differentiate C++ class types.
static void update_type(ReferenceCount *ptr, TypeHandle type)
Associates the indicated type with the given pointer.
set_size
Specifies the requested size of the window, in pixels.
virtual void upcall()
You should make this call during the callback if you want to continue the normal function that would ...
An object to create GraphicsOutputs that share a particular 3-D API.
const FrameBufferProperties & get_fb_properties() const
Returns the framebuffer properties of the window.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void set_properties_now(WindowProperties &properties)
Applies the requested set of properties to the window, if possible, for instance to request a change ...
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.
Encapsulates all the communication with a particular instance of a given rendering backend.
virtual void process_events()
Do whatever processing is necessary to ensure that the window responds to user events.
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.
virtual void end_flip()
This function will be called within the draw thread after begin_flip() has been called on all windows...
A thread; that is, a lightweight process.
A window, fullscreen or on a desktop, into which a graphics device sends its output for interactive d...
virtual void begin_flip()
This function will be called within the draw thread after end_frame() has been called on all windows,...
virtual void upcall()
You should make this call during the callback if you want to continue the normal function that would ...
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.