wheel 0.5.3

A simple SDL-based engine


To use this package, run the following command in your project's root directory:

Wheel

Build Status Dub package License

Wheel is a library for the D programming language which provides a high-level interface to the Simple DirectMedia Layer (SDL) library.

It is built upon the BindBC SDL binding and some imports are required from BindBC to set SDL up and use some features.

Using Wheel

To start using wheel, follow the instructions to set up the SDL binding. To initialize SDL, call the initSDL and initSystem functions in cat.wheel.events as necessary to set up the required subsystems. The functions essentially map SDL_Init and SDL_InitSubSystem with exception checking. To quit SDL, call quitSDL or quitSystem.

The main "selling point" of wheel is the Handler class. A Handler instance has a method handle which starts a loop of SDL event polling and function calling. Functions get registered as delegates to the Handler instance, and called when predetermined events get fired by the handler.

A typical simple program would look like this (barring the BindBC code):

import cat.wheel.events;

void main() {
    initSDL();

    auto h = new Handler();

    h.addDelegate((args) {
        if ((cast(PumpEventArgs) args).event.type == SDL_EventType.SDL_QUIT) {
            h.stop();
        }
    }, ED_PUMP);

    h.handle();

    quitSDL();
}
Authors:
  • TheOnlyMrCat
Dependencies:
bindbc-sdl
Versions:
0.5.3 2019-Nov-10
0.5.2 2019-Nov-10
0.5.1 2019-Nov-09
0.5.0 2019-Nov-07
0.4.2 2019-Nov-05
Show all 12 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 1 downloads this month

  • 15 downloads total

Score:
0.3
Short URL:
wheel.dub.pm