raylib-aplAPL
raylib-aplraylibAPL is a library made to write cross-platform graphical applications using the Dyalog APL programming language.
Features
- Supports platforms Windows and Linux.
- Input-methods: Keyboard, Mouse, Controler and Touchscreen.
- Graphics: 2D, 3D, Sound, Text, Vector graphics, Images/Textures and shaders.
- Multiple Fonts formats supported (TTF, OTF, Image fonts, AngelCode fonts).
- Multiple texture formats supported, including compressed formats (DXT, ETC, ASTC).
- Full 3D support, including 3D Shapes, Models, Billboards, Heightmaps and more!
- Flexible Materials system, supporting classic maps and PBR maps.
- Animated 3D models supported (skeletal bones animation) (IQM, M3D, glTF).
- Shaders support, including model shaders and postprocessing shaders.
- Powerful math module for Vector, Matrix and Quaternion operations: raymath.
- Audio loading and playing with streaming support (WAV, QOA, OGG, MP3, FLAC, XM, MOD).
- VR stereo rendering support with configurable HMD device parameters.
Warning
Breaking changes to any feature in raylib-aplraylibAPL should be expected for now, as this library is very young and experimental. If you experience code 999, there was likely a "segfault"/error in raylib-aplraylibAPL, and so a bug report would be appreciated.
Currently raylib-aplraylibAPL provides 4 different libraries; raylib, raygui, physac, and rlgl. Currently only raylib is stable, due to a lack of testing for the other 3.
Documentation
Getting started
Run the following to install temp-c-raylib in the raylib-apl/lib/raylibAPL/lib/ folder.
dyalogscript install-raylib.apls
Instead of running the above, you can manually download temp-c-raylib from it's releases page.
Importing raylib-aplAPL
To import raylib-aplraylibAPL as a namespace, take the code below and replace ../ with the path to raylib-aplraylibAPL:
rlDir ← '../raylibAPL/link/',⍨⊃1⎕NPARTS''rlDir ← '../raylib-apl/link/',⍨⊃1⎕NPARTS''rl ← 0⎕Fix rlDir,'raylib.apln' rl.Init rlDir
When making a script file like the raylib-apl'sraylibAPL's examples, I would recommend the .apls file extension and adding this line at the top of the script #!cd $dir && /usr/bin/dyalogscript $fileName. When running .apls files, remember to always be in their directory.
Using Tatin Package Manager
Tatin is a package manager for Dyalog APL.
-
Install Tatin (if not already installed):
]Activate tatin
-
Install raylib-aplInstall raylibAPL:]Tatin.InstallPackages raylibapl
-
Use in your code:
rl ← raylibapl.raylib rl.Init raylibapl.TatinVars.HOME,'/link'
Using Link:
You may ]Link to the raylib-apl/linkraylibAPL/link folder. This imports raylib.apln, rlgl.apln, and raymath.apln, each of which are from raylib. A 2d physics library called physac is also included as physac.apln, and a GUI library called raygui as raygui.apln.
Example using raylib-aplraylibAPL with ]link is shown below:
]cd /home/brian/Persinal/Scripts/APL/raylibAPL/link]cd /home/brian/Persinal/Scripts/APL/raylib-apl/link]link.create # . raylib.Init '' raylib.InitWindow 800 800 'Hello!!!' :While ~raylib.WindowShouldClose⍬ raylib.BeginDrawing⍬ raylib.ClearBackground raylib.color.gray raylib.EndDrawing⍬ :EndWhile raylib.CloseWindow⍬
Intro to raylib-aplAPL
InitWindow
Developing an application with raylib-aplraylibAPL is very low level. The entirety of raylib-aplraylibAPL is about 200 functions that take in a list of inputs and returns some outputs, and/or change the state of the application. An example of changing the state of the application is the following:
raylib.InitWindow 400 400 'Title'
First application
Applications made with raylib-aplraylibAPL have a common structure and style. As you can see by the below example, there's a :while loop used that draws the frame using BeginDrawing, where the frame being drawn is gray because of ClearBackground . This example is intentionally very simple, simply drawing a window with a black background.
rl.InitWindow 800 800 'abc' # Begin InitWindow scope :While ~rl.WindowShouldClose⍬ # Run this loop per frame rl.BeginDrawing⍬ # Begin a drawing scope to draw the current frame rl.ClearBackground⍬ rl.color.gray # Set background to gray rl.EndDrawing⍬ # End the Drawing scope :EndWhile rl.CloseWindow⍬ # End InitWindow scope
Now to start
To get a good start into raylib-aplraylibAPL, mess around with the examples and see what you can make!
For a proper list of functions and namespaces found in raylib-aplraylibAPL, consider having a look into what the raylib.apln file defines. Note that the function definitions there aren't final, so drop the RAYLIB suffix to use the proper function. An example is the value raylib.KeyboardKey.KEY_SLASH can be given as argument to raylib.IsKeyPressed to check if the slash key is pressed.
Using dyalogscript
All raylib-aplraylibAPL examples support using dyalogscript, by having the following on the top of every example:
#!cd $dir && /usr/bin/dyalogscript $fileName
Optionally parsing raylib-apl/link/raylib.aplnraylibAPL/link/raylib.apln
raylib-apl/link/raylib.aplnThe auto-parsing isn't needed since the parser output is premade, though if you still need to parse, install CBQN to run bqn raylib-apl/parse-raylib-apl/parseAll.bqnbqn raylibAPL/parse-raylibAPL/parseAll.bqn.
Credits
Dyalog Limited
raylib-aplraylibAPL has been financially supported by Dyalog Limited. Brian was hired as an intern by Dyalog Limited at about 7th of July 2024 to develop raylib-aplraylibAPL, alongside Asher. Brian has continued being funded for the development. The Dyalog team have helped a lot with the development of this library.
raylib
raylib-APLraylibAPL relies on the raylib C library. Lots of thanks to raysan5 and the raylib community for this great library.
Marshall Lochbaum
The current version of raylib-aplraylibAPL has parsing that relies on json.bqn made by Marshall Lochbaum.bqn. Also the BQN programming language in general!

0 commit comments