mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add headless mode (engine initialization and finalization)
This commit is contained in:
parent
1ab3707343
commit
ee1a170376
7 changed files with 101 additions and 51 deletions
|
|
@ -8,6 +8,9 @@
|
|||
#include "coders/wav.hpp"
|
||||
#include "AL/ALAudio.hpp"
|
||||
#include "NoAudio.hpp"
|
||||
#include "debug/Logger.hpp"
|
||||
|
||||
static debug::Logger logger("audio");
|
||||
|
||||
namespace audio {
|
||||
static speakerid_t nextId = 1;
|
||||
|
|
@ -147,10 +150,14 @@ public:
|
|||
|
||||
void audio::initialize(bool enabled) {
|
||||
if (enabled) {
|
||||
logger.info() << "initializing ALAudio backend";
|
||||
backend = ALAudio::create().release();
|
||||
}
|
||||
if (backend == nullptr) {
|
||||
std::cerr << "could not to initialize audio" << std::endl;
|
||||
if (enabled) {
|
||||
std::cerr << "could not to initialize audio" << std::endl;
|
||||
}
|
||||
logger.info() << "initializing NoAudio backend";
|
||||
backend = NoAudio::create().release();
|
||||
}
|
||||
create_channel("master");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue