8000 GitHub - nikplu/alw: Simple dynamic loader for OpenAL
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

nikplu/alw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alw: Simple dynamic loader for OpenAL

Introduction

alw is the easiest way to get your hands on the functionality offered by the OpenAL API.

Its main part is a simple alw_gen.py Python script that generates alw.h and alw.c from the OpenAL headers (al.h, alc.h and efx.h). Those files can then be added and linked (statically or dynamically) into your project.

Requirements

alw_gen.py requires Python version 2.6 or newer. It is also compatible with Python 3.x.

Example

Here is a simple example of loading and using the OpenAL API via alw. Note that AL/alw.h must be included before any other OpenAL related headers:

#include <stdio.h>
#include <AL/alw.h>

// ...

int main(int argc, char* argv[])
{
        ALCdevice* dev;
        ALCcontext* ctx;

        if (alwInit() < 0) {
            fprintf(stderr, "Failed to load OpenAL\n");
            return 1;
        }

        // error checking omitted
        dev = alcOpenDevice(0);
        ctx = alcCreateContext(dev, 0);
        alcMakeContextCurrent(ctx);

        // use OpenAL...

        // clean up
        alcMakeContextCurrent(0);
        alcDestroyContext(ctx);
        alcCloseDevice(dev);

        alwTerminate();

        return 0;
}

API Reference

The alw API consists of just three functions:

int alwInit(void)

Initializes the library. Should be called before any call to an OpenAL entry point is made. Returns 0 when alw was initialized successfully or a negative value if there was an error.

int alwInitEfx(void)

Loads the EFX extension entry points. Should be called after creating an OpenAL context. Returns 0 when the EFX extension was loaded successfully or a negative value if there was an error.

void alwTerminate(void)

Terminates the library and unloads the OpenAL module if possible.

License

alw is in the public domain. See the file UNLICENSE for more information.

Credits

Slavomir Kaslev <slavomir.kaslev@gmail.com>
gl3w, which alw is based on
Niklas F. Pluem <niklas.crossedwires@gmail.com>
Implementation

Copyright

OpenAL is a trademark of Creative Labs, Inc.

About

Simple dynamic loader for OpenAL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0