IWindowing#

class carb.windowing.IWindowing#

Bases: pybind11_object

Windowing interface for creating and managing windows, cursors, and input.

Methods

__init__(*args, **kwargs)

create_cursor(self, arg0, arg1, arg2)

Creates a custom cursor from RGBA image data.

create_cursor_standard(self, arg0)

Creates a standard-shaped cursor.

create_window(self, width, height, title, ...)

Creates a window.

destroy_cursor(self, arg0)

Destroys a cursor.

destroy_window(self, arg0)

Destroys a window.

focus_window(self, arg0)

Gives focus to the window.

get_clipboard(self, arg0)

Gets clipboard text.

get_cursor_mode(self, arg0)

Gets the cursor mode for the window.

get_cursor_position(self, arg0)

Gets the cursor position relative to the window.

get_input_mode(self, arg0, arg1)

Gets the value of an input mode option for the window.

get_keyboard(self, arg0)

Gets the logical keyboard associated with the window.

get_monitor_position(self, arg0)

Gets a monitor's virtual position as Int2.

get_monitor_work_area(self, arg0)

Gets a monitor's work area as (position, size).

get_monitors(self)

Gets the currently enumerated monitors as a tuple.

get_mouse(self, arg0)

Gets the logical mouse associated with the window.

get_native_display(self, arg0)

Gets the native display handle.

get_native_window(self, arg0)

Gets the native window handle.

get_window_height(self, arg0)

Gets the current window height.

get_window_opacity(self, arg0)

Gets the window opacity.

get_window_position(self, arg0)

Gets the current window position (Int2).

get_window_user_pointer(self, arg0)

Gets the user-defined pointer on the window.

get_window_width(self, arg0)

Gets the current window width.

hide_window(self, arg0)

Hides a window.

is_window_focused(self, arg0)

Returns True if the window has focus.

is_window_fullscreen(self, arg0)

Returns True if the window is in fullscreen mode.

is_window_maximized(self, arg0)

Returns True if the window is maximized.

is_window_minimized(self, arg0)

Returns True if the window is minimized.

maximize_window(self, arg0)

Maximizes the window.

minimize_window(self, arg0)

Minimizes the window.

poll_events(self)

Polls and processes pending events, then returns.

resize_window(self, arg0, arg1, arg2)

Resizes the window.

restore_window(self, arg0)

Restores the window.

set_clipboard(self, arg0, arg1)

Sets clipboard text.

set_cursor(self, arg0, arg1)

Sets the cursor for the window (or None for default).

set_cursor_mode(self, arg0, arg1)

Sets the cursor mode for the window.

set_cursor_position(self, arg0, arg1)

Sets the cursor position relative to the window.

set_input_mode(self, arg0, arg1, arg2)

Sets an input mode option for the window.

set_window_content_scale(self, arg0)

Gets the content scale (DPI) for the window.

set_window_fullscreen(self, arg0, arg1)

Sets fullscreen or windowed mode.

set_window_icon(self, arg0, arg1)

Sets the window icon from RGBA image data.

set_window_opacity(self, arg0, arg1)

Sets the window opacity (1.0 opaque, 0.0 transparent).

set_window_position(self, arg0, arg1)

Sets the window position.

set_window_should_close(self, arg0, arg1)

Hints to the window that it should close.

set_window_title(self, arg0, arg1)

Sets the window title (UTF-8).

set_window_user_pointer(self, arg0, arg1)

Sets the user-defined pointer on the window.

should_window_close(self, arg0)

Returns True if the user has requested the window to close.

show_window(self, arg0)

Shows a window (makes it visible).

translate_key(self, arg0)

update_input_devices(self)

Updates input device states.

wait_events(self)

Sleeps the calling thread until at least one event is received.

__init__(*args, **kwargs)#
create_cursor(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Image,
arg1: int,
arg2: int,
) carb.windowing.Cursor#

Creates a custom cursor from RGBA image data.

Parameters:
  • image – Image(width, height, pixels) in 32-bit little-endian RGBA.

  • xhot – Hotspot x-coordinate in pixels.

  • yhot – Hotspot y-coordinate in pixels.

Returns:

Cursor or None if creation failed.

create_cursor_standard(
self: carb.windowing.IWindowing,
arg0: carb.windowing.CursorStandardShape,
) carb.windowing.Cursor#

Creates a standard-shaped cursor.

create_window(
self: carb.windowing.IWindowing,
width: int,
height: int,
title: str,
fullscreen: bool,
hints: int = 0,
) carb.windowing.Window#

Creates a window.

Parameters:
  • width – Initial window width in pixels.

  • height – Initial window height in pixels.

  • title – Initial title of the window.

  • fullscreen – Whether the window starts in fullscreen mode.

  • hints – Bitfield of window hints (WINDOW_HINT_*).

Returns:

The created window.

Return type:

Window

destroy_cursor(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Cursor,
) None#

Destroys a cursor.

destroy_window(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
) None#

Destroys a window.

focus_window(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
) None#

Gives focus to the window.

get_clipboard(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
) str#

Gets clipboard text.

get_cursor_mode(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
) carb.windowing.CursorMode#

Gets the cursor mode for the window.

get_cursor_position(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
) carb._carb.Int2#

Gets the cursor position relative to the window.

get_input_mode(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
arg1: carb.windowing.InputMode,
) bool#

Gets the value of an input mode option for the window.

get_keyboard(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
) carb.input.Keyboard#

Gets the logical keyboard associated with the window.

get_monitor_position(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Monitor,
) carb._carb.Int2#

Gets a monitor’s virtual position as Int2.

get_monitor_work_area(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Monitor,
) tuple#

Gets a monitor’s work area as (position, size).

get_monitors(self: carb.windowing.IWindowing) tuple#

Gets the currently enumerated monitors as a tuple.

get_mouse(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
) carb.input.Mouse#

Gets the logical mouse associated with the window.

get_native_display(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
) capsule#

Gets the native display handle.

get_native_window(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
) capsule#

Gets the native window handle.

get_window_height(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
) int#

Gets the current window height.

get_window_opacity(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
) float#

Gets the window opacity.

get_window_position(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
) carb._carb.Int2#

Gets the current window position (Int2).

get_window_user_pointer(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
) capsule#

Gets the user-defined pointer on the window.

get_window_width(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
) int#

Gets the current window width.

hide_window(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
) None#

Hides a window.

is_window_focused(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
) bool#

Returns True if the window has focus.

is_window_fullscreen(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
) bool#

Returns True if the window is in fullscreen mode.

is_window_maximized(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
) bool#

Returns True if the window is maximized.

is_window_minimized(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
) bool#

Returns True if the window is minimized.

maximize_window(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
) None#

Maximizes the window.

minimize_window(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
) None#

Minimizes the window.

poll_events(self: carb.windowing.IWindowing) None#

Polls and processes pending events, then returns.

resize_window(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
arg1: int,
arg2: int,
) None#

Resizes the window.

restore_window(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
) None#

Restores the window.

set_clipboard(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
arg1: str,
) None#

Sets clipboard text.

set_cursor(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
arg1: carb.windowing.Cursor,
) None#

Sets the cursor for the window (or None for default).

set_cursor_mode(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
arg1: carb.windowing.CursorMode,
) None#

Sets the cursor mode for the window.

set_cursor_position(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
arg1: carb._carb.Int2,
) None#

Sets the cursor position relative to the window.

set_input_mode(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
arg1: carb.windowing.InputMode,
arg2: bool,
) None#

Sets an input mode option for the window.

set_window_content_scale(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
) carb._carb.Float2#

Gets the content scale (DPI) for the window.

set_window_fullscreen(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
arg1: bool,
) None#

Sets fullscreen or windowed mode.

set_window_icon(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
arg1: carb.windowing.Image,
) None#

Sets the window icon from RGBA image data.

set_window_opacity(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
arg1: float,
) None#

Sets the window opacity (1.0 opaque, 0.0 transparent).

set_window_position(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
arg1: carb._carb.Int2,
) None#

Sets the window position.

set_window_should_close(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
arg1: bool,
) None#

Hints to the window that it should close.

set_window_title(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
arg1: str,
) None#

Sets the window title (UTF-8).

set_window_user_pointer(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
arg1: capsule,
) None#

Sets the user-defined pointer on the window.

should_window_close(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
) bool#

Returns True if the user has requested the window to close.

show_window(
self: carb.windowing.IWindowing,
arg0: carb.windowing.Window,
) None#

Shows a window (makes it visible).

translate_key(
self: carb.windowing.IWindowing,
arg0: carb.input.KeyboardInput,
) carb.input.KeyboardInput#
update_input_devices(
self: carb.windowing.IWindowing,
) None#

Updates input device states.

wait_events(self: carb.windowing.IWindowing) None#

Sleeps the calling thread until at least one event is received.