hate-no-d/README.md
pedro-bento 3b9bbd529a
All checks were successful
release / linux/aarch64 (push) Successful in 1m55s
release / linux/armv7 (push) Successful in 2m18s
release / linux/i686 (push) Successful in 2m11s
release / linux/x86_64 (push) Successful in 1m54s
release / android (push) Successful in 2m50s
release / freebsd/x86_64 (push) Successful in 4m55s
release / windows/i686 (push) Successful in 2m7s
release / windows/x86_64 (push) Successful in 2m11s
Add raylib
Co-authored-by: pedro-bento <mail@pbento.pt>
Co-committed-by: pedro-bento <mail@pbento.pt>
2026-10-22 22:47:20 +01:00

3.7 KiB

hate-no-d

A Love2D antagonist.

A glorified Makefile.

Should work on:

  • Linux (x86, x86_64, ARM, ARM64)
  • Android (armeabi-v7a, arm64-v8a, x86, x86_64)
  • macOS (x86_64, ARM64)
  • Windows (x86, x86_64 via MinGW; ARM64 via MSVC)
  • FreeBSD, OpenBSD, NetBSD (x86, x86_64) or DragonFly BSD (x86_64)

Quick Start

Save this as quick-start.lua:

local hnd = require("hate-no-d")

hnd.InitWindow(1280, 720, "hate-no-d")
hnd.SetTargetFPS(60)

local text     = "Your first hate-no-d application!"
local fontSize = 48

while not hnd.WindowShouldClose() do
  hnd.BeginDrawing()
  hnd.ClearBackground(hnd.SKYBLUE)

  local width = hnd.MeasureText(text, fontSize)
  hnd.DrawText(text, (hnd.GetScreenWidth() - width)/2, (hnd.GetScreenHeight() - fontSize)/2, fontSize, hnd.DARKBLUE)

  hnd.EndDrawing()
end

hnd.CloseWindow()

Run it:

./hate-no-d quick-start.lua

On Windows:

hate-no-d.exe quick-start.lua

hate-no-d.lua is the generated raylib/rlgl/raymath binding; release archives ship it next to the binary.

Building

Precompiled builds can be found on the releases page.

Linux prerequisites

Install a C toolchain, git, LuaJIT and the OpenGL/X11 headers.

Debian/Ubuntu:

sudo apt install build-essential git luajit libgl1-mesa-dev libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev

Fedora:

sudo dnf install gcc make git luajit mesa-libGL-devel libX11-devel libXrandr-devel libXinerama-devel libXcursor-devel libXi-devel

Arch:

sudo pacman -S --needed base-devel git luajit mesa libx11 libxrandr libxinerama libxcursor libxi

Void:

sudo xbps-install -S base-devel git luajit MesaLib-devel libX11-devel libXrandr-devel libXinerama-devel libXcursor-devel libXi-devel

Gentoo:

sudo emerge --ask sys-devel/gcc dev-build/make dev-vcs/git dev-lang/luajit media-libs/mesa x11-libs/libX11 x11-libs/libXrandr x11-libs/libXinerama x11-libs/libXcursor x11-libs/libXi

macOS prerequisites

xcode-select --install
brew install luajit

The Command Line Tools provide make and clang; LuaJIT runs the binding generator.

BSD prerequisites

FreeBSD:

sudo pkg install gmake luajit libX11 libXrandr libXinerama libXi libXcursor libglvnd

On OpenBSD, NetBSD and DragonFly install gmake, luajit (pkg_add, pkgin or pkg) and the X11/GL libraries if they are missing. Use gmake instead of make.

Android prerequisites

Cross-compile from Linux or macOS with the Android NDK, passed as ANDROID_NDK or exported as ANDROID_NDK_HOME.

Windows prerequisites

MSVC: install Visual Studio 2022 with the "Desktop development with C++" workload. build.bat finds it. raylib needs CMake 3.22+, so install CMake if the bundled copy is older.

MinGW: use MSYS2 with the mingw-w64 toolchain and make. A native MSYS2 shell is detected automatically; cross-compiling from elsewhere needs PLATFORM=Windows (and WIN_ARCH=i686 for 32-bit).

Building from source

Linux, macOS and the BSDs:

git clone --recurse-submodules https://git.pbento.pt/pedro-bento/hate-no-d.git
cd hate-no-d
make

make builds the CLI and regenerates hate-no-d.lua, which needs a host luajit in PATH (override with make LUAJIT=/path/to/luajit). On the BSDs use gmake.

Windows with MSVC:

git clone --recurse-submodules https://git.pbento.pt/pedro-bento/hate-no-d.git
cd hate-no-d
build.bat

Android from Linux or macOS:

make PLATFORM=Android ANDROID_NDK=/path/to/ndk

ANDROID_ABI defaults to arm64-v8a and ANDROID_API to 21; make help lists the other ABIs. Building armeabi-v7a on a 64-bit host also needs HOST_CC="gcc -m32".