Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

DwmWindow

import { DwmWindow } from "https://raw.githubusercontent.com/deno-windowing/gluten/main/src/webgl/deps.ts";
abstract

Represents a Window

abstract class DwmWindow {
constructor(_options: CreateWindowOptions);
abstract readonly closed: boolean;
abstract readonly contentScale: Position;
abstract focused: boolean;
abstract readonly framebufferSize: Size;
abstract readonly frameSize: LTRB;
abstract fullScreen: boolean;
id;
abstract maximized: boolean;
abstract minimized: boolean;
abstract readonly nativeHandle: Deno.PointerValue;
abstract opacity: number;
abstract position: Position;
abstract readonly shouldClose: boolean;
abstract size: Size;
abstract title: string;
abstract visible: boolean;
 
abstract close(): void;
abstract createSurface(instance: Deno.PointerValue, allocator?: Deno.PointerValue): Deno.PointerValue;
abstract getInputMode(mode: InputMode): InputModeValue;
abstract getMonitor(): DwmMonitor | undefined;
abstract makeContextCurrent(): void;
abstract rawMouseMotionSupported(): boolean;
abstract requestUserAttention(): void;
abstract setAspectRatio(numerator: number, denominator: number): void;
abstract setCursor(icon?: CursorIcon): void;
abstract setCursorPos(xpos: number, ypos: number): void;
abstract setCustomCursor(
image: Uint8Array,
hotspot: Size,
position: Position,
): void;
abstract setIcon(image: Uint8Array, sizes: Size): void;
abstract setIcon(image: ImageStruct): void;
abstract setInputMode(mode: InputMode, value: InputModeValue | boolean): 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

§
closed: boolean
[src]

Check if the window is closed

§
contentScale: Position
[src]

Window's content scale

§
focused: boolean
[src]

Check if the window is focused

§
framebufferSize: Size
[src]

Window's framebuffer size

§
frameSize: LTRB
[src]

Frame size

§
fullScreen: boolean
[src]

Check if the window is fullscreen

§

Window's unique identifier

§
maximized: boolean
[src]

Change whether the window is maximized

§
minimized: boolean
[src]

Change whether the window is minimized

§
nativeHandle: Deno.PointerValue
[src]

The window's pointer

§
opacity: number
[src]

Opacity of the window

§
position: Position
[src]

Window's position

§
shouldClose: boolean
[src]

Whether the window should close

§
size: Size
[src]

Window's size

§
title: string
[src]

Title of the window

§
visible: boolean
[src]

Change whether the window is visible

§Methods

§
close(): void abstract
[src]

Close the window

§
createSurface(instance: Deno.PointerValue, allocator?: Deno.PointerValue): Deno.PointerValue abstract
[src]

Create a VkSurfaceKHR for this window (Only for Vulkan)

§
getInputMode(mode: InputMode): InputModeValue abstract
[src]

Get the window's input mode

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

§
rawMouseMotionSupported(): boolean abstract
[src]

Check if the window has raw mouse motion

§
requestUserAttention(): void abstract
[src]

Requests the User's attention

§
setAspectRatio(numerator: number, denominator: number): void abstract
[src]

Set the window's aspect ratio

§
setCursor(icon?: CursorIcon): void abstract
[src]

Sets the cursor icon

win.setCursor("hand");
§
setCursorPos(xpos: number, ypos: number): void abstract
[src]

Sets the cursor to a specific position

§
setCustomCursor(image: Uint8Array, hotspot: Size, position: Position): void abstract
[src]

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,
});
§
setIcon(image: Uint8Array, sizes: Size): void abstract
[src]

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")));
setIcon(image: ImageStruct): void abstract
[src]
§
setInputMode(mode: InputMode, value: InputModeValue | boolean): void abstract
[src]

Set the window's input mode

§
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

§
setSizeLimits(minWidth: number, minHeight: number, maxWidth: number, maxHeight: number): void abstract
[src]

Set the window's size limits

§
swapBuffers(): void abstract
[src]

Swaps the window's buffers (Only for OpenGL)

§
windowSurface(): Deno.UnsafeWindowSurface abstract
[src]

Creates a Window Surface for Use with WebGPU

const surface = win.windowSurface();
const context = surface.getContext("webgpu");