0.1.0 • Published 9 months ago

vulkan-node v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Vulkan-Node - Vulkan API wrapper for Node

+ TypeScript support!

This project is a generated wrapper for Vulkan API for use in Node.js. Features full typing for TypeScript as well.

Specification version: 1.3.250.1
Generated by: https://github.com/achlubek/parsing-vulkan-spec
Generated with version commit: 90c13b99d2226129b684cfc200410a5c936659e6
Generated at: Wed, 30 Aug 2023 19:19:51 GMT

How to use

There are a lot of usage examples here: https://github.com/achlubek/aero-graphics/tree/master/src/vulkan

Here is a very simple example showing how to create an instance:

import * as vk from "vulkan-node";

const appInfo: vk.VkApplicationInfo = {
    pApplicationName: "Hello World",
    applicationVersion: vk.VK_MAKE_VERSION(1, 0, 0),
    pEngineName: "My Engine",
    engineVersion: vk.VK_MAKE_VERSION(1, 0, 0),
    apiVersion: vk.VK_API_VERSION_1_0,
};

const instanceExtensionsWithValidation: string[] = [
    //
];

const layersWithValidation: string[] = [
    //
];

const instanceCreateInfo: vk.VkInstanceCreateInfo = {
    pApplicationInfo: appInfo,
    enabledExtensionCount: instanceExtensionsWithValidation.length,
    ppEnabledExtensionNames: instanceExtensionsWithValidation,
    enabledLayerCount: layersWithValidation.length,
    ppEnabledLayerNames: layersWithValidation,
};

const instance = new vk.VkInstance(); // handle will be stored here
const res = vk.vkCreateInstance({
    pCreateInfo: instanceCreateInfo,
    pInstance: instance,
});
if (res !== vk.VkResult.VK_SUCCESS) {
    throw new Error(`Instance initialization failed with error ${res}`);
}
0.1.0

9 months ago

0.0.13

9 months ago

0.0.12

9 months ago

0.0.11

9 months ago

0.0.10

9 months ago

0.0.9

9 months ago

0.0.8

9 months ago

0.0.7

9 months ago

0.0.6

9 months ago

0.0.5

9 months ago

0.0.4

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago