CallbackGraphicsWindow

from panda3d.core import CallbackGraphicsWindow
class CallbackGraphicsWindow

Bases: GraphicsWindow

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.

Inheritance diagram

Inheritance diagram of CallbackGraphicsWindow

class EventsCallbackData

Bases: WindowCallbackData

__init__(*args, **kwargs)
getClassType()

C++ Interface: get_class_type()

get_class_type()

C++ Interface: get_class_type()

class PropertiesCallbackData

Bases: WindowCallbackData

__init__(*args, **kwargs)
getClassType()

C++ Interface: get_class_type()

getProperties()

C++ Interface: get_properties(PropertiesCallbackData self)

/**
  • Returns the WindowProperties object that this callback should process. Any

  • properties that are handled should be removed from this object; properties

  • that are unhandled should be left alone.

*/

get_class_type()

C++ Interface: get_class_type()

get_properties()

C++ Interface: get_properties(PropertiesCallbackData self)

/**
  • Returns the WindowProperties object that this callback should process. Any

  • properties that are handled should be removed from this object; properties

  • that are unhandled should be left alone.

*/

RCTBeginFlip = 2
RCTBeginFrame = 0
RCTEndFlip = 3
RCTEndFrame = 1
RCT_begin_flip = 2
RCT_begin_frame = 0
RCT_end_flip = 3
RCT_end_frame = 1
class RenderCallbackData

Bases: WindowCallbackData

__init__(*args, **kwargs)
callback_type
frame_mode
getCallbackType()

C++ Interface: get_callback_type(RenderCallbackData self)

/**
  • Since the render callback is shared for several functions, this method is

  • needed to indicate which particular function is being invoked with this

  • callback.

*/

getClassType()

C++ Interface: get_class_type()

getFrameMode()

C++ Interface: get_frame_mode(RenderCallbackData self)

/**
  • If the callback type (returned by get_callback_type) is RCT_begin_frame or

  • RCT_end_frame, then this method will return the particular frame mode

  • indicating what, precisely, we want to do this frame.

*/

getRenderFlag()

C++ Interface: get_render_flag(RenderCallbackData self)

/**
  • Returns the current setting of the render flag. See set_render_flag().

*/

get_callback_type()

C++ Interface: get_callback_type(RenderCallbackData self)

/**
  • Since the render callback is shared for several functions, this method is

  • needed to indicate which particular function is being invoked with this

  • callback.

*/

get_class_type()

C++ Interface: get_class_type()

get_frame_mode()

C++ Interface: get_frame_mode(RenderCallbackData self)

/**
  • If the callback type (returned by get_callback_type) is RCT_begin_frame or

  • RCT_end_frame, then this method will return the particular frame mode

  • indicating what, precisely, we want to do this frame.

*/

get_render_flag()

C++ Interface: get_render_flag(RenderCallbackData self)

/**
  • Returns the current setting of the render flag. See set_render_flag().

*/

render_flag
setRenderFlag()

C++ Interface: set_render_flag(const RenderCallbackData self, bool render_flag)

/**
  • If the callback type is RCT_begin_frame, this call is available to specify

  • the return value from the begin_frame() call. If this is true (the

  • default), the frame is rendered normally; if it is false, the frame is

  • omitted.

*/

set_render_flag()

C++ Interface: set_render_flag(const RenderCallbackData self, bool render_flag)

/**
  • If the callback type is RCT_begin_frame, this call is available to specify

  • the return value from the begin_frame() call. If this is true (the

  • default), the frame is rendered normally; if it is false, the frame is

  • omitted.

*/

class WindowCallbackData

Bases: CallbackData

__init__(*args, **kwargs)
getClassType()

C++ Interface: get_class_type()

getWindow()

C++ Interface: get_window(WindowCallbackData self)

/**
  • Returns the window this callback was triggered from.

*/

get_class_type()

C++ Interface: get_class_type()

get_window()

C++ Interface: get_window(WindowCallbackData self)

/**
  • Returns the window this callback was triggered from.

*/

window
__init__(*args, **kwargs)
clearEventsCallback()

C++ Interface: clear_events_callback(const CallbackGraphicsWindow self)

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

*/

clearPropertiesCallback()

C++ Interface: clear_properties_callback(const CallbackGraphicsWindow self)

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

*/

clearRenderCallback()

C++ Interface: clear_render_callback(const CallbackGraphicsWindow self)

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

*/

clear_events_callback()

C++ Interface: clear_events_callback(const CallbackGraphicsWindow self)

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

*/

clear_properties_callback()

C++ Interface: clear_properties_callback(const CallbackGraphicsWindow self)

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

*/

clear_render_callback()

C++ Interface: clear_render_callback(const CallbackGraphicsWindow self)

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

*/

createInputDevice()

C++ Interface: create_input_device(const CallbackGraphicsWindow self, str name)

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

  • Returns the index of the new device.

*/

create_input_device()

C++ Interface: create_input_device(const CallbackGraphicsWindow self, str name)

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

  • Returns the index of the new device.

*/

getClassType()

C++ Interface: get_class_type()

getEventsCallback()

C++ Interface: get_events_callback(CallbackGraphicsWindow self)

/**
  • Returns the CallbackObject set by set_events_callback().

*/

getPropertiesCallback()

C++ Interface: get_properties_callback(CallbackGraphicsWindow self)

/**
  • Returns the CallbackObject set by set_properties_callback().

*/

getRenderCallback()

C++ Interface: get_render_callback(CallbackGraphicsWindow self)

/**
  • Returns the CallbackObject set by set_render_callback().

*/

get_class_type()

C++ Interface: get_class_type()

get_events_callback()

C++ Interface: get_events_callback(CallbackGraphicsWindow self)

/**
  • Returns the CallbackObject set by set_events_callback().

*/

get_properties_callback()

C++ Interface: get_properties_callback(CallbackGraphicsWindow self)

/**
  • Returns the CallbackObject set by set_properties_callback().

*/

get_render_callback()

C++ Interface: get_render_callback(CallbackGraphicsWindow self)

/**
  • Returns the CallbackObject set by set_render_callback().

*/

setEventsCallback()

C++ Interface: set_events_callback(const CallbackGraphicsWindow self, 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()

C++ Interface: set_properties_callback(const CallbackGraphicsWindow self, 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()

C++ Interface: set_render_callback(const CallbackGraphicsWindow self, 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.

*/

set_events_callback()

C++ Interface: set_events_callback(const CallbackGraphicsWindow self, 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().

*/

set_properties_callback()

C++ Interface: set_properties_callback(const CallbackGraphicsWindow self, 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.

*/

set_render_callback()

C++ Interface: set_render_callback(const CallbackGraphicsWindow self, 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.

*/