62 lines
1.7 KiB
JavaScript
62 lines
1.7 KiB
JavaScript
// SDL Video Actor
|
|
// This actor runs on the main thread and handles all SDL video operations
|
|
|
|
// Default window configuration - documents all available window options
|
|
var default_window = {
|
|
// Basic properties
|
|
title: "Prosperon Window",
|
|
width: 640,
|
|
height: 480,
|
|
|
|
// Position - can be numbers or "centered"
|
|
x: undefined, // SDL_WINDOWPOS_UNDEFINED by default
|
|
y: undefined, // SDL_WINDOWPOS_UNDEFINED by default
|
|
|
|
// Window behavior flags
|
|
resizable: true,
|
|
fullscreen: false,
|
|
hidden: false,
|
|
borderless: false,
|
|
alwaysOnTop: false,
|
|
minimized: false,
|
|
maximized: false,
|
|
|
|
// Input grabbing
|
|
mouseGrabbed: false,
|
|
keyboardGrabbed: false,
|
|
|
|
// Display properties
|
|
highPixelDensity: false,
|
|
transparent: false,
|
|
opacity: 1.0, // 0.0 to 1.0
|
|
|
|
// Focus behavior
|
|
notFocusable: false,
|
|
|
|
// Special window types (mutually exclusive)
|
|
utility: false, // Utility window (not in taskbar)
|
|
tooltip: false, // Tooltip window (requires parent)
|
|
popupMenu: false, // Popup menu window (requires parent)
|
|
|
|
// Graphics API flags (let SDL choose if not specified)
|
|
opengl: false, // Force OpenGL context
|
|
vulkan: false, // Force Vulkan context
|
|
metal: false, // Force Metal context (macOS)
|
|
|
|
// Advanced properties
|
|
parent: undefined, // Parent window for tooltips/popups/modal
|
|
modal: false, // Modal to parent window (requires parent)
|
|
externalGraphicsContext: false, // Use external graphics context
|
|
|
|
// Input handling
|
|
textInput: true, // Enable text input on creation
|
|
};
|
|
|
|
var winwin
|
|
|
|
// Export the video functions for other actors to call
|
|
$_.receiver(function(msg) {
|
|
console.log("Video actor received message:", msg);
|
|
winwin = new prosperon.endowments.window(default_window)
|
|
});
|