DwmWindow
import { DwmWindow } from "https://raw.githubusercontent.com/deno-windowing/gluten/main/src/webgl/deps.ts";
Represents a Window
abstract class DwmWindow { }
constructor(_options: CreateWindowOptions);
abstract readonly closed: boolean;
abstract focused: boolean;
abstract fullScreen: boolean;
id;
abstract maximized: boolean;
abstract minimized: boolean;
abstract readonly nativeHandle: Deno.PointerValue;
abstract opacity: number;
abstract readonly shouldClose: boolean;
abstract title: string;
abstract visible: boolean;
abstract close(): void;
abstract createSurface(instance: Deno.PointerValue, allocator?: Deno.PointerValue): Deno.PointerValue;
abstract makeContextCurrent(): void;
abstract rawMouseMotionSupported(): boolean;
abstract requestUserAttention(): void;
abstract setAspectRatio(numerator: number, denominator: number): void;
abstract setCursorPos(xpos: number, ypos: number): void;
abstract setMonitor(
monitor: DwmMonitor | undefined,
xpos?: number,
ypos?: number,
width?: number,
height?: number,
refreshRate?: number,
): void;abstract setSizeLimits(
minWidth: number,
minHeight: number,
maxWidth: number,
maxHeight: number,
): void;abstract swapBuffers(): void;
abstract windowSurface(): Deno.UnsafeWindowSurface;
§Constructors
§
new DwmWindow(_options: CreateWindowOptions)
[src]§Properties
§Methods
§
createSurface(instance: Deno.PointerValue, allocator?: Deno.PointerValue): Deno.PointerValue abstract
[src]Create a VkSurfaceKHR for this window (Only for Vulkan)
§
getMonitor(): DwmMonitor | undefined abstract
[src]Get the monitor that the window is on (undefined if not fullscreen)
§
makeContextCurrent(): void abstract
[src]Sets this window's context as the current context (Only for OpenGL)
§
setAspectRatio(numerator: number, denominator: number): void abstract
[src]Set the window's aspect ratio
§
Sets the cursor to a custom image
const cursor = new Uint8Array(16 * 16 * 4);
for (let i = 0; i < 16; i++) {
cursor[i * 16 * 4 + i * 4 + 3] = 255;
cursor[i * 16 * 4 + (15 - i) * 4 + 3] = 255;
}
win.setCustomCursor(cursor, {
width: 16,
height: 16,
}, {
x: 0,
y: 0,
});
§
Sets the window icon to a custom icon
import { decode } from "https://deno.land/x/pngs@0.1.1/mod.ts";
win.setIcon(decode(await Deno.readFile("./path/to/icon/icon.png")));
§
setMonitor(monitor: DwmMonitor | undefined, xpos?: number, ypos?: number, width?: number, height?: number, refreshRate?: number): void abstract
[src]Set the monitor that the window is on