Go to the documentation of this file.
14 #ifndef CALLBACKGRAPHICSWINDOW_H
15 #define CALLBACKGRAPHICSWINDOW_H
30 const std::string &name,
45 MAKE_PROPERTY(window, get_window);
54 static void init_type() {
55 CallbackData::init_type();
56 register_type(_type_handle,
"CallbackGraphicsWindow::WindowCallbackData",
57 CallbackData::get_class_type());
60 return get_class_type();
62 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
79 static void init_type() {
80 WindowCallbackData::init_type();
81 register_type(_type_handle,
"CallbackGraphicsWindow::EventsCallbackData",
82 WindowCallbackData::get_class_type());
85 return get_class_type();
87 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
109 static void init_type() {
110 WindowCallbackData::init_type();
111 register_type(_type_handle,
"CallbackGraphicsWindow::PropertiesCallbackData",
112 WindowCallbackData::get_class_type());
115 return get_class_type();
117 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
123 enum RenderCallbackType {
135 INLINE CallbackGraphicsWindow::RenderCallbackType get_callback_type()
const;
136 INLINE GraphicsOutput::FrameMode get_frame_mode()
const;
137 MAKE_PROPERTY(callback_type, get_callback_type);
138 MAKE_PROPERTY(frame_mode, get_frame_mode);
140 INLINE
void set_render_flag(
bool render_flag);
141 INLINE
bool get_render_flag()
const;
142 MAKE_PROPERTY(render_flag, get_render_flag, set_render_flag);
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();}
194 virtual bool open_window();
195 virtual bool do_reshape_request(
int x_origin,
int y_origin,
bool has_origin,
196 int x_size,
int y_size);
207 static void init_type() {
208 GraphicsWindow::init_type();
210 GraphicsWindow::get_class_type());
211 WindowCallbackData::init_type();
212 EventsCallbackData::init_type();
213 PropertiesCallbackData::init_type();
214 RenderCallbackData::init_type();
217 return get_class_type();
219 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
void set_events_callback(CallbackObject *object)
Sets the CallbackObject that will be notified when this window is polled for window events,...
void clear_events_callback()
Removes the callback set by an earlier call to set_events_callback().
get_properties
Returns the current properties of the window.
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...
This is a generic data block that is passed along to a CallbackObject when a callback is made.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
void clear_properties_callback()
Removes the callback set by an earlier call to set_properties_callback().
This is a generic object that can be assigned to a callback at various points in the rendering proces...
CallbackObject * get_events_callback() const
Returns the CallbackObject set by set_events_callback().
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 upcall()
You should make this call during the callback if you want to continue the normal function that would ...
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.
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void set_render_callback(CallbackObject *object)
Sets the CallbackObject that will be notified when this window is invoked (in the draw thread) to ren...
An object to create GraphicsOutputs that share a particular 3-D API.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This special window object doesn't represent a window in its own right, but instead hooks into some t...
virtual void set_properties_now(WindowProperties &properties)
Applies the requested set of properties to the window, if possible, for instance to request a change ...
CallbackObject * get_properties_callback() const
Returns the CallbackObject set by set_properties_callback().
Encapsulates all the communication with a particular instance of a given rendering backend.
void clear_render_callback()
Removes the callback set by an earlier call to set_render_callback().
CallbackObject * get_render_callback() const
Returns the CallbackObject set by set_render_callback().
void set_properties_callback(CallbackObject *object)
Sets the CallbackObject that will be notified when this window receives a property change request fro...
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.
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,...