Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include "Headers/ALWrapper.h"

#include <al.h>
#include <alc.h>

namespace Divide {

ErrorCode OpenAL_API::initAudioAPI(PlatformContext& context) {
    ACKNOWLEDGE_UNUSED(context);

    // Initialization
    ALCdevice* device = alcOpenDevice(NULL);  // select the "preferred device"
    if (device) {
        ALCcontext* alContext = alcCreateContext(device, NULL);
        alcMakeContextCurrent(alContext);
    }
    // Check for EAX 2.0 support
    // ALboolean g_bEAX = alIsExtensionPresent("EAX2.0");
    // Generate Buffers
    alGetError();  // clear error code
    alGenBuffers(MAX_SOUND_BUFFERS, buffers);
    ALenum error = alGetError();
    if (error != AL_NO_ERROR) {
        return ErrorCode::OAL_INIT_ERROR;
    }
    // Clear Error Code (so we can catch any new errors)
    alGetError();
    return ErrorCode::OAL_INIT_ERROR;
}

void OpenAL_API::beginFrame() {}

void OpenAL_API::endFrame() {}

void OpenAL_API::closeAudioAPI() {}

void OpenAL_API::playSound(const AudioDescriptor_ptr& sound) {}

void OpenAL_API::playMusic(const AudioDescriptor_ptr& music) {}

void OpenAL_API::pauseMusic() {}

void OpenAL_API::stopMusic() {}

void OpenAL_API::stopAllSounds() {}

void OpenAL_API::setMusicVolume(I8 value) {}

void OpenAL_API::setSoundVolume(I8 value) {}

void OpenAL_API::musicFinished() {}
};

Commits for Divide-Framework/trunk/Source Code/Platform/Audio/openAl/ALWrapper.cpp

Diff revisions: vs.
Revision Author Commited Message
804 Diff Diff IonutCava picture IonutCava Thu 01 Dec, 2016 17:20:59 +0000

[IonutCava]
- Singleton elimination update Part I: get it to compile
— The following classes are no longer Singletons: GFXDevice, GL_API, DX_API, SFXWrapper, FmodWrapper, SDLWrapper, ALWrapper, PXDevice, InputInterface, RenderPassManager, SceneManager and ResourceManager;
— Refactor system to a Context / Component based implementation (Pass relevant context to objects: e.g. GFXDevice object to Textures, GUI to GUIElements, etc)
— Make devices and managers components of the kernel
— Allow multiple Resource caches to co-exist. This may prove useful for later when a more fragmented memory model is need (per frame / per scene / global caches / etc)

  • next steps: part II – cleanup/refactor new code, part III – optimise code, part IV – remove remaining Singletons (e.g. Application, ParamHandler, FrameListenerManager, Recast, PostFX and DebugInterface)
746 Diff Diff IonutCava picture IonutCava Thu 30 Jun, 2016 10:53:30 +0000

[IonutCava]
- Add multiple playlist support for music.
— Needs more testing
— No cross-fading between tracks because SDL_mixer doesn’t support that.
-— Build cross-fade in the tracks instead?

745 Diff Diff IonutCava picture IonutCava Wed 29 Jun, 2016 20:14:50 +0000

[IonutCava]
- Added on click sounds for buttons
- Added music playlist options for scenes (configurable via XML)
- Cache sound chunks and music files in SDLWrapper.cpp

709 Diff Diff IonutCava picture IonutCava Thu 19 May, 2016 16:21:46 +0000

[IonutCava]
- Massive rewrite of the resource system:
— ResourceCache now uses a map of weak pointers and passes shared pointers to the call point of CreateResource
— RemoveResource is no longer needed, but resource based smart pointers use a custom deleter that calls unload()
— Keep a shared_ptr of the resource in the entity that needs it and pass shared_ptr references from getter methods
-— All of this removed the need for calls to RemoveResource, REGISTER_TRACKED_DEPENDENCY and UNREGISTER_TRACKED_DEPENDENCY reducing the number of mutex locks and atomic exchanges
- Singleton cleanup:
— Removed ShaderManager singleton and merged it’s data and responsibilities in static methods in both ShaderProgram and Shader classes.
Explanation: Due to the complex interdependency chains in the system, copying, updating, tracking the cache in a thread safe way became a lot more slower than a straight forward smart pointer based implementation. (e.g. scene graph nodes have 3d objects and material instances, 3d objects have materials, materials have textures and shaders, etc)

448 Diff Diff IonutCava picture IonutCava Tue 26 May, 2015 16:00:37 +0000

[Ionut]
- Library dependency cleanup:
— All required libraries listed in PlatformDefinesWindows.cpp
— Removed glsl_optimiser as it was very out-of-date

366 Diff Diff IonutCava picture IonutCava Tue 10 Mar, 2015 16:56:30 +0000

[Ionut]
- More type safe enum replacement

358 Diff Diff IonutCava picture IonutCava Sun 01 Mar, 2015 22:44:38 +0000

[Ionut]
- Fixed some OpenGL initialization issues and function calls (no proper support for DSA yet)
- Cleanup up the Sound and Physics Wrappers
- Some readability improvements here and there

350 Diff Diff IonutCava picture IonutCava Tue 10 Feb, 2015 16:25:39 +0000

[Ionut]
- Simplified some Util-namespace level functions by using STL algorithms where possible
- Formatted the entire codebase using clang-format with the following style: "{BasedOnStyle: Google, IndentWidth: 4}"
- Attempted to make ProfileTimer thread-safe (temp fix until std::chrono works properly in Visual Studio)

334 IonutCava picture IonutCava Wed 10 Dec, 2014 17:21:22 +0000

[Ionut]
- Reorganized the Hardware project and renamed to "Platform"
- Reorganized the Server project