15 #ifndef CALLBACKGRAPHICSWINDOW_H
16 #define CALLBACKGRAPHICSWINDOW_H
18 #include "pandabase.h"
19 #include "graphicsWindow.h"
57 static void init_type() {
58 CallbackData::init_type();
59 register_type(_type_handle,
"CallbackGraphicsWindow::WindowCallbackData",
60 CallbackData::get_class_type());
63 return get_class_type();
65 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
76 virtual void upcall();
82 static void init_type() {
83 WindowCallbackData::init_type();
84 register_type(_type_handle,
"CallbackGraphicsWindow::EventsCallbackData",
85 WindowCallbackData::get_class_type());
88 return get_class_type();
90 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
103 virtual void upcall();
112 static void init_type() {
113 WindowCallbackData::init_type();
114 register_type(_type_handle,
"CallbackGraphicsWindow::PropertiesCallbackData",
115 WindowCallbackData::get_class_type());
118 return get_class_type();
120 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
126 enum RenderCallbackType {
138 INLINE CallbackGraphicsWindow::RenderCallbackType get_callback_type()
const;
139 INLINE GraphicsOutput::FrameMode get_frame_mode()
const;
141 INLINE
void set_render_flag(
bool render_flag);
142 INLINE
bool get_render_flag()
const;
144 virtual void upcall();
147 RenderCallbackType _callback_type;
148 FrameMode _frame_mode;
155 static void init_type() {
156 WindowCallbackData::init_type();
157 register_type(_type_handle,
"CallbackGraphicsWindow::RenderCallbackData",
158 WindowCallbackData::get_class_type());
161 return get_class_type();
163 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
195 virtual bool open_window();
196 virtual bool do_reshape_request(
int x_origin,
int y_origin,
bool has_origin,
197 int x_size,
int y_size);
208 static void init_type() {
209 GraphicsWindow::init_type();
210 register_type(_type_handle,
"CallbackGraphicsWindow",
211 GraphicsWindow::get_class_type());
212 WindowCallbackData::init_type();
213 EventsCallbackData::init_type();
214 PropertiesCallbackData::init_type();
215 RenderCallbackData::init_type();
218 return get_class_type();
220 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
228 #include "callbackGraphicsWindow.I"
void set_events_callback(CallbackObject *object)
Sets the CallbackObject that will be notified when this window is polled for window events...
GraphicsWindowInputDevice & get_input_device(int device)
Returns a writable reference to the nth input device (mouse).
CallbackObject * get_events_callback() const
Returns the CallbackObject set by set_events_callback().
void set_properties_callback(CallbackObject *object)
Sets the CallbackObject that will be notified when this window receives a property change request fro...
virtual void begin_flip()
This function will be called within the draw thread after end_frame() has been called on all windows...
This is a generic data block that is passed along to a CallbackObject when a callback is made...
A window, fullscreen or on a desktop, into which a graphics device sends its output for interactive d...
CallbackObject * get_properties_callback() const
Returns the CallbackObject set by set_properties_callback().
void clear_render_callback()
Removes the callback set by an earlier call to set_render_callback().
void clear_events_callback()
Removes the callback set by an earlier call to set_events_callback().
CallbackObject * get_render_callback() const
Returns the CallbackObject set by set_render_callback().
A container for the various kinds of properties we might ask to have on a graphics window before we o...
This special window object doesn't represent a window in its own right, but instead hooks into some t...
virtual void process_events()
Do whatever processing is necessary to ensure that the window responds to user events.
int create_input_device(const string &name)
Adds a new input device (mouse) to the window with the indicated name.
An object to create GraphicsOutputs that share a particular 3-D API.
This is a generic object that can be assigned to a callback at various points in the rendering proces...
virtual void set_properties_now(WindowProperties &properties)
Applies the requested set of properties to the window, if possible, for instance to request a change ...
A thread; that is, a lightweight process.
void set_render_callback(CallbackObject *object)
Sets the CallbackObject that will be notified when this window is invoked (in the draw thread) to ren...
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...
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...
This class is the main interface to controlling the render process.
TypeHandle is the identifier used to differentiate C++ class types.
virtual void end_flip()
This function will be called within the draw thread after begin_flip() has been called on all windows...
A container for the various kinds of properties we might ask to have on a graphics frameBuffer before...
void clear_properties_callback()
Removes the callback set by an earlier call to set_properties_callback().