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 Acron to render into an already-created OpenGL context, for instance.

Inheritance diagram

digraph inheritance69cad81272 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "CallbackGraphicsWindow" [URL="acron.core.CallbackGraphicsWindow.html#acron.core.CallbackGraphicsWindow",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "GraphicsWindow" -> "CallbackGraphicsWindow" [arrowsize=0.75,style=""]; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "DrawableRegion" [URL="acron.core.DrawableRegion.html#acron.core.DrawableRegion",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "DrawableRegion" [arrowsize=0.75,style=""]; "GraphicsOutput" [URL="acron.core.GraphicsOutput.html#acron.core.GraphicsOutput",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "GraphicsOutputBase" -> "GraphicsOutput" [arrowsize=0.75,style=""]; "DrawableRegion" -> "GraphicsOutput" [arrowsize=0.75,style=""]; "GraphicsOutputBase" [URL="acron.core.GraphicsOutputBase.html#acron.core.GraphicsOutputBase",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedWritableReferenceCount" -> "GraphicsOutputBase" [arrowsize=0.75,style=""]; "GraphicsWindow" [URL="acron.core.GraphicsWindow.html#acron.core.GraphicsWindow",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "GraphicsOutput" -> "GraphicsWindow" [arrowsize=0.75,style=""]; "ReferenceCount" [URL="acron.core.ReferenceCount.html#acron.core.ReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "ReferenceCount" [arrowsize=0.75,style=""]; "TypedObject" [URL="acron.core.TypedObject.html#acron.core.TypedObject",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "TypedObject" [arrowsize=0.75,style=""]; "TypedWritable" [URL="acron.core.TypedWritable.html#acron.core.TypedWritable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedObject" -> "TypedWritable" [arrowsize=0.75,style=""]; "TypedWritableReferenceCount" [URL="acron.core.TypedWritableReferenceCount.html#acron.core.TypedWritableReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedWritable" -> "TypedWritableReferenceCount" [arrowsize=0.75,style=""]; "ReferenceCount" -> "TypedWritableReferenceCount" [arrowsize=0.75,style=""]; }
class CallbackGraphicsWindow.EventsCallbackData

Bases:

Bases: CallbackGraphicsWindow.WindowCallbackData

static get_class_type()
class CallbackGraphicsWindow.PropertiesCallbackData

Bases:

Bases: CallbackGraphicsWindow.WindowCallbackData

static get_class_type()
get_properties()

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.

class CallbackGraphicsWindow.RenderCallbackData

Bases:

Bases: CallbackGraphicsWindow.WindowCallbackData

property callback_type → RenderCallbackType

Since the render callback is shared for several functions, this method is needed to indicate which particular function is being invoked with this callback.

property frame_mode → FrameMode

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_callback_type()

Since the render callback is shared for several functions, this method is needed to indicate which particular function is being invoked with this callback.

static get_class_type()
get_frame_mode()

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()

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

property render_flag → bool
Getter

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

Setter

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()

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.

enum RenderCallbackType
enumerator RCT_begin_frame = 0
enumerator RCT_end_frame = 1
enumerator RCT_begin_flip = 2
enumerator RCT_end_flip = 3
class CallbackGraphicsWindow.WindowCallbackData

Bases:

Bases: CallbackData

static get_class_type()
get_window()

Returns the window this callback was triggered from.

property window → CallbackGraphicsWindow

Returns the window this callback was triggered from.

CallbackGraphicsWindow.clear_events_callback()

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

CallbackGraphicsWindow.clear_properties_callback()

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

CallbackGraphicsWindow.clear_render_callback()

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

CallbackGraphicsWindow.create_input_device()

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

static CallbackGraphicsWindow.get_class_type()
CallbackGraphicsWindow.get_events_callback()

Returns the CallbackObject set by set_events_callback().

CallbackGraphicsWindow.get_properties_callback()

Returns the CallbackObject set by set_properties_callback().

CallbackGraphicsWindow.get_render_callback()

Returns the CallbackObject set by set_render_callback().

CallbackGraphicsWindow.set_events_callback()

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 EventsCallbackData.

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

CallbackGraphicsWindow.set_properties_callback()

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 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.

CallbackGraphicsWindow.set_render_callback()

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.