All Projects → Andre-LA → raylib-nelua

Andre-LA / raylib-nelua

Licence: MPL-2.0 License
Raylib wrapper to nelua language

Programming Languages

lua
6591 projects
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to raylib-nelua

Qtsharp
Mono/.NET bindings for Qt
Stars: ✭ 532 (+1870.37%)
Mutual labels:  wrapper, binding
Dxwrapper
Fixes compatibility issues with older games running on Windows 10 by wrapping DirectX dlls. Also allows loading custom libraries with the file extension .asi into game processes.
Stars: ✭ 460 (+1603.7%)
Mutual labels:  gamedev, wrapper
Dukglue
A C++ binding/wrapper library for the Duktape JavaScript interpreter.
Stars: ✭ 132 (+388.89%)
Mutual labels:  wrapper, binding
Nimterop
Nimterop is a Nim package that aims to make C/C++ interop seamless
Stars: ✭ 244 (+803.7%)
Mutual labels:  wrapper, binding
raylib-zig
Manually tweaked, auto generated raylib bindings for zig. https://github.com/raysan5/raylib
Stars: ✭ 122 (+351.85%)
Mutual labels:  binding, raylib
Jni.hpp
A modern, type-safe, header-only, C++14 wrapper for JNI
Stars: ✭ 313 (+1059.26%)
Mutual labels:  wrapper, binding
Raylib
A simple and easy-to-use library to enjoy videogames programming
Stars: ✭ 8,169 (+30155.56%)
Mutual labels:  gamedev, raylib
nelua-game2048
Clone of the 2048 game in Nelua using Raylib
Stars: ✭ 16 (-40.74%)
Mutual labels:  raylib, nelua
nelua-tetris
Tetris game clone made in Nelua with Raylib
Stars: ✭ 16 (-40.74%)
Mutual labels:  raylib, nelua
Raylib Cs
C# bindings for raylib, a simple and easy-to-use library to learn videogames programming
Stars: ✭ 182 (+574.07%)
Mutual labels:  gamedev, binding
Cimgui
c-api for imgui (https://github.com/ocornut/imgui) Look at: https://github.com/cimgui for other widgets
Stars: ✭ 707 (+2518.52%)
Mutual labels:  gamedev, binding
steampak
Nicely packed tools to work with Steam APIs
Stars: ✭ 21 (-22.22%)
Mutual labels:  wrapper, binding
sdlpp
C++ wrapper for SDL2
Stars: ✭ 37 (+37.04%)
Mutual labels:  gamedev, wrapper
hibpwned
Python API wrapper for haveibeenpwned.com (API v3)
Stars: ✭ 21 (-22.22%)
Mutual labels:  wrapper, binding
restique
A wrapper around restic with profiles
Stars: ✭ 43 (+59.26%)
Mutual labels:  wrapper
antkeeper-source
💿🐜 Antkeeper source code (GitHub mirror)
Stars: ✭ 23 (-14.81%)
Mutual labels:  gamedev
dotty dict
Dictionary wrapper for quick access to deeply nested keys.
Stars: ✭ 67 (+148.15%)
Mutual labels:  wrapper
UIFramework
VBM UI Framework For Unity3D
Stars: ✭ 25 (-7.41%)
Mutual labels:  binding
GLFW-CMake-starter
Use CMake to create a project with GLFW - Multi-platform Windows, Linux and MacOS.
Stars: ✭ 53 (+96.3%)
Mutual labels:  gamedev
ScriptableObjectMultiSelectDropdown
Multi Select Dropdown for ScriptableObjects
Stars: ✭ 18 (-33.33%)
Mutual labels:  gamedev

raylib-nelua

raylib-nelua-logo

This is a Raylib binding for Nelua language.

How to use

First, install Nelua language and Raylib library.

Then, you can use raylib.nelua, you can use it as a project file or as a external library:

As project file

Just move raylib.nelua file to your project.

As external library

Clone or download this repository somewhere and then either:

  • use the -L option, for example: nelua -L ~/path/to/nelua-raylib my-game.nelua
  • use a neluacfg.lua script on the project's root directory or on your $HOME/.config/nelua with the content return { add_path = {'/path/to/nelua-raylib'} } (See about this here)

Quick Raylib-nelua specific changes:

This binding contains some extra features to better integrate with nelua language:

  • unbounded arrays are specified on arguments and return types; for example, Raylib.GetWaveData returns a *[0]float32 instead of just *float32
  • for every record an is_* field is defined on the type information; for example, ## rAudioBuffer.value.is_raudiobuffer is true;
  • several functions are also applied to records, for example, function Camera.UpdateCamera(camera: *Camera) is defined, which can be used as a method camera:UpdateCamera();
  • operator overloading functions for raymath.hfunctions defined:
    • Vector2:
      • __add: calls Vector2Add
      • __sub: calls Vector2Subtract
      • __len: calls Vector2Length
      • __unm: calls Vector2Negate
      • __div: calls Vector2Divide or Vector2DivideV
      • __mul: calls Vector2Scale or Vector2MultiplyV
    • Vector3:
      • __add: calls Vector3Add
      • __sub: calls Vector3Subtract
      • __len: calls Vector3Length
      • __unm: calls Vector3Negate
      • __mul: calls Vector3Scale or Vector3Multiply
      • __div: calls Vector3Divide or Vector3DivideV
    • Matrix:
      • __add: calls MatrixAdd
      • __sub: calls MatrixSubtract
      • __mul: calls MatrixMultiply
    • Quaternion:
      • __len: calls QuaternionLength
      • __mul: calls QuaternionMultiply

NOTE: TraceLogCallback and SetTraceLogCallback aren't imported

Example

require 'raylib'

-- [[ Initialization [[
local screen_width: integer <comptime> = 800
local screen_height: integer <comptime> = 450
Raylib.InitWindow(screen_width, screen_height, "raylib-nelua [core] example - keyboard input")

local ball_position: Vector2 = { screen_width / 2, screen_height / 2}

Raylib.SetTargetFPS(60) -- Set our game to run at 60 frames-per-second
-- ]] Initialization ]]

-- [[ Main game loop [[
while not Raylib.WindowShouldClose() do -- Detect window close button or ESC key
  -- [[ Update [[
  if Raylib.IsKeyDown(KeyboardKey.KEY_RIGHT) then
    ball_position.x = ball_position.x + 2
  end
  if Raylib.IsKeyDown(KeyboardKey.KEY_LEFT) then
    ball_position.x = ball_position.x - 2
  end
  if Raylib.IsKeyDown(KeyboardKey.KEY_UP) then
    ball_position.y = ball_position.y - 2
  end
  if Raylib.IsKeyDown(KeyboardKey.KEY_DOWN) then
    ball_position.y = ball_position.y + 2
  end
   -- ]] Update ]]

   -- [[ Draw [[
  Raylib.BeginDrawing()
    Raylib.ClearBackground(RAYWHITE)
    Raylib.DrawText("move the ball with arrow keys", 10, 10, 20, DARKGRAY)
    Raylib.DrawCircleV(ball_position, 50, MAROON)
  Raylib.EndDrawing()
  -- ]] Draw ]]
end

-- [[ De-Initialization [[
Raylib.CloseWindow() -- Close window and OpenGL context
-- ]] De-Initialization ]]
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].