Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/h2co3/sdl2-sparkling
SDL2 bindings for Sparkling
https://github.com/h2co3/sdl2-sparkling
c draw ffi ffi-bindings ffi-wrapper graphics graphics-library sdl sdl2 sdl2-bindings sparkling
Last synced: about 1 month ago
JSON representation
SDL2 bindings for Sparkling
- Host: GitHub
- URL: https://github.com/h2co3/sdl2-sparkling
- Owner: H2CO3
- License: other
- Created: 2015-03-30T18:30:05.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-05-05T05:49:39.000Z (over 8 years ago)
- Last Synced: 2023-03-12T05:57:31.077Z (almost 2 years ago)
- Topics: c, draw, ffi, ffi-bindings, ffi-wrapper, graphics, graphics-library, sdl, sdl2, sdl2-bindings, sparkling
- Language: C
- Size: 2.46 MB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SDL2 bindings for Sparkling
## Basic usage
1. Import SDL
2. Open window(s) to draw on
3. Draw window; render
4. Handle events
5. goto 3// 1.
let SDL = dynld("sdl2");// 2.
let window = SDL::OpenWindow("Title", optionalWidth, optionalHeight);while true {
// 3.
window.fillRect(0, 0, window.width, window.height);
window.refresh();// 4.
let event;
while (event = SDL::PollEvent()) != nil {
// do something with 'event' here...
}// 5.
}Check out the Documentation, starting with [SDL.md](doc/SDL.md),
on how to get started and for further reference.## Installing
First things first, make sure that [Sparkling](https://github.com/H2CO3/Sparkling)
is installed.
Then, compile this with `make` (no extra flags are necessary).
Finally, you must place the resulting library file in the same directory as
`libspn`, which should be `/usr/local/lib` (unless you specified another
installation directory).## Examples
For example code, see the Sparkling files:
- [`example_docsig.spn`](examples/example_docsig.spn)
- [`example_graph.spn`](examples/example_graph.spn)
- [`demo_linear_gradient.spn`](examples/demo_linear_gradient.spn)
- [`demo_radial_gradient.spn`](examples/demo_radial_gradient.spn)
- [`demo_conical_gradient.spn`](examples/demo_conical_gradient.spn)