import { DwmWindow } from "https://deno.land/x/dwm@0.3.6/ext/canvas.ts";
Represents a Window
Constructors
new
DwmWindow(_options: CreateWindowOptions)Methods
abstract
createSurface(instance: Deno.PointerValue, allocator?: Deno.PointerValue): Deno.PointerValueCreate a VkSurfaceKHR for this window (Only for Vulkan)
abstract
getMonitor(): DwmMonitor | undefinedGet the monitor that the window is on (undefined if not fullscreen)
abstract
makeContextCurrent(): voidSets this window's context as the current context (Only for OpenGL)
abstract
setCustomCursor(): voidSets 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")));
abstract
setIcon(image: ImageStruct): voidabstract
setInputMode(mode: InputMode, value: InputModeValue | boolean): voidSet the window's input mode
abstract
setMonitor(monitor: DwmMonitor | undefined,
xpos?: number,
ypos?: number,
width?: number,
height?: number,
refreshRate?: number,
Set the monitor that the window is on
abstract
setSizeLimits(minWidth: number,
minHeight: number,
maxWidth: number,
maxHeight: number,
Set the window's size limits
abstract
windowSurface(): Deno.UnsafeWindowSurfaceCreates a Window Surface for Use with WebGPU
const surface = win.windowSurface();
const context = surface.getContext("webgpu");