Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tatut/raylib-smalltalk
Smalltalk bindings to Raylib
https://github.com/tatut/raylib-smalltalk
Last synced: 3 days ago
JSON representation
Smalltalk bindings to Raylib
- Host: GitHub
- URL: https://github.com/tatut/raylib-smalltalk
- Owner: tatut
- License: mit
- Created: 2024-02-07T15:19:02.000Z (12 months ago)
- Default Branch: master
- Last Pushed: 2024-02-17T11:04:13.000Z (11 months ago)
- Last Synced: 2024-11-21T12:09:33.714Z (2 months ago)
- Language: Smalltalk
- Size: 39.1 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Raylib Smalltalk bindings
Smalltalk bindings for [raylib](https://www.raylib.com).
Developed in [Pharo](https://pharo.org) (11).WIP: not all raylib functions are implemented yet, only tested on OS X.
# Notes on changes
All code lives in the `raylib` package.
The FFI bindings to the raylib C functions are in the class FFIRaylib class.Structs are their own classes prefixed with Rb, eg. `Vector2` and `Color` become `RbVector2` and `RbColor`.
The typical Smalltalk accessor methods to get/set the values are present.As Smalltalk uses different naming styles, the methods are not one to one to the C functions names.
Getter functions like `GetScreenWidth` omit the first part and becomes `screenWidth`.
Functions to set things likewise omit the first part so `SetTargetFPS` becomes `targetFPS:`.There is a new class called `RbScene` which abstracts the update & draw functionality that will be called
in a loop.# Development
As Pharo is single threaded, the regular raylib loop to continuously redraw everything and wait for next frame,
will cause the development environment to halt as well. It is recommended to add a keybinding to scene update
that calls `terminate` which stops the game loop (without closing the window). This allows you to inspect things
in Pharo and change code and then continue the game.There is also a method `runOnce` which calls the scene update/draw one time. This can be used to step through
frames of the game. Or see how code changes would look.