Panda3D

- Main Page
- Packages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Classes | Public Types | Public Member Functions | Static Public Member Functions

# CallbackGraphicsWindow Class Reference

This special window object doesn't represent a window in its own right, but instead hooks into some third-party API for creating and rendering to windows via callbacks. More...

Inheritance diagram for CallbackGraphicsWindow:

List of all members.

## Classes
class | EventsCallbackData
class | PropertiesCallbackData
class | RenderCallbackData
class | WindowCallbackData
## Public Types
enum | RenderCallbackType { RCTBeginFrame = 0, RCTEndFrame = 1, RCTBeginFlip = 2, RCTEndFlip = 3 }
## Public Member Functions
| clearEventsCallback ()
| Removes the callback set by an earlier call to set_events_callback().
| clearPropertiesCallback ()
| Removes the callback set by an earlier call to set_properties_callback().
| clearRenderCallback ()
| Removes the callback set by an earlier call to set_render_callback().
int | createInputDevice (string name)
| Adds a new input device (mouse) to the window with the indicated name.
CallbackObject | getEventsCallback ()
| Returns the CallbackObject set by set_events_callback().
GraphicsWindowInputDevice | getInputDevice (int device)
| Returns a writable reference to the nth input device (mouse).
CallbackObject | getPropertiesCallback ()
| Returns the CallbackObject set by set_properties_callback().
CallbackObject | getRenderCallback ()
| Returns the CallbackObject set by set_render_callback().
| setEventsCallback (CallbackObject object)
| Sets the CallbackObject that will be notified when this window is polled for window events, including mouse and keyboard events, as well as window resize events and other system-generated events.
| setPropertiesCallback (CallbackObject object)
| Sets the CallbackObject that will be notified when this window receives a property change request from user code (e.g.
| setRenderCallback (CallbackObject object)
| Sets the CallbackObject that will be notified when this window is invoked (in the draw thread) to render its contents, and/or flip the graphics buffers.
## Static Public Member Functions
static TypeHandle | getClassType ()

## Detailed Description

This special window object doesn't represent a window in its own right, but instead hooks into some third-party API for creating and rendering to windows via callbacks.

This can be used to allow Panda to render into an already-created OpenGL context, for instance.

## Member Enumeration Documentation

enum RenderCallbackType

Enumerator:

  RCTBeginFrame |
  RCTEndFrame |
  RCTBeginFlip |
  RCTEndFlip |

## Member Function Documentation

clearEventsCallback | ( |  | ) |

Removes the callback set by an earlier call to set_events_callback().

clearPropertiesCallback | ( |  | ) |

Removes the callback set by an earlier call to set_properties_callback().

clearRenderCallback | ( |  | ) |

Removes the callback set by an earlier call to set_render_callback().

int createInputDevice | ( | string | name | ) |

Adds a new input device (mouse) to the window with the indicated name.

Returns the index of the new device.

static TypeHandle getClassType | ( |  | ) | `[static]`

Reimplemented from GraphicsWindow.

CallbackObject getEventsCallback | ( |  | ) |

Returns the CallbackObject set by set_events_callback().

GraphicsWindowInputDevice getInputDevice | ( | int | device | ) |

Returns a writable reference to the nth input device (mouse).

This is intended to be used for the window implementation to record mouse and keyboard input information for the Panda system.

CallbackObject getPropertiesCallback | ( |  | ) |

Returns the CallbackObject set by set_properties_callback().

CallbackObject getRenderCallback | ( |  | ) |

Returns the CallbackObject set by set_render_callback().

setEventsCallback | ( | CallbackObject | object | ) |

Sets the CallbackObject that will be notified when this window is polled for window events, including mouse and keyboard events, as well as window resize events and other system-generated events.

This callback will receive a CallbackGraphicsWindow.EventsCallbackData.

This callback should process any system-generated events, and call data->upcall() to process requested property change requests made via request_properties().

setPropertiesCallback | ( | CallbackObject | object | ) |

Sets the CallbackObject that will be notified when this window receives a property change request from user code (e.g.

via request_properties).

This callback will receive a CallbackGraphicsWindow.PropertiesCallbackData, which provides a get_properties() method that returns a modifiable reference to a WindowsProperties object. This object will contain only those properties requested by user code. The callback should handle any of the requests it finds, including and especially set_open(), and remove them from the object when it has handled them. Any unhandled properties should be left unchanged in the properties object.

setRenderCallback | ( | CallbackObject | object | ) |

Sets the CallbackObject that will be notified when this window is invoked (in the draw thread) to render its contents, and/or flip the graphics buffers.

This callback will actually serve several different functions. It receivces a RenderCallbackData, and you can query data->get_callback_type() to return the actual function of each particular callback.

All Classes Namespaces Functions Variables Enumerations Enumerator Properties