import { DwmWindow } from "https://deno.land/x/dwm@0.3.6/src/core/mod.ts";
Represents a Window
Constructors
Properties
Window's content scale
Window's framebuffer size
Frame size
The window's pointer
Window's position
Window's size
Methods
Close the window
Create a VkSurfaceKHR for this window (Only for Vulkan)
Get the window's input mode
Get the monitor that the window is on (undefined if not fullscreen)
Sets this window's context as the current context (Only for OpenGL)
Check if the window has raw mouse motion
Requests the User's attention
Set the window's aspect ratio
Sets the cursor icon
win.setCursor("hand");
Sets the cursor to a specific position
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")));
Set the window's input mode
Set the monitor that the window is on
Set the window's size limits
Swaps the window's buffers (Only for OpenGL)
Creates a Window Surface for Use with WebGPU
const surface = win.windowSurface();
const context = surface.getContext("webgpu");