Skip to content

RobLoach/raylib-duktape

Repository files navigation

logo.png

raylib-duktape

Embedded JavaScript bindings for raylib, a simple and easy-to-use library to learn videogames programming.

raylib-duktape uses Duktape and Dukglue.

Example

const screenWidth = 800
const screenHeight = 450

InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window")
SetTargetFPS(60)

while (!WindowShouldClose()) {
    BeginDrawing()
        ClearBackground(RAYWHITE)
        DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY)
    EndDrawing()
}

CloseWindow()

CLI

A raylib-duktape CLI launcher is provided to allow running raylib JavaScript files.

raylib-duktape core_basic_window.js

API

Initialize raylib-duktape through your Duktape context.

#include "raylib-duktape.h"

// After initializing the Duktape heap...
duk_raylib_init(ctx, 0);

Build

git clone https://github.com/RobLoach/raylib-duktape.git
cd raylib-duktape
mkdir build
cd build
cmake ..
make
make test

License

zlib

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published