26 lines
484 B
C++
26 lines
484 B
C++
#include "../init.h"
|
|
|
|
#include <iostream>
|
|
#include <SDL.h>
|
|
|
|
#include "AudioBackend.h"
|
|
#include "../Video.h"
|
|
|
|
namespace System {
|
|
void init() {
|
|
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_AUDIO) < 0) {
|
|
std::cerr << "Error initializing SDL: " << SDL_GetError() << std::endl;
|
|
abort();
|
|
}
|
|
|
|
audioBackend.init();
|
|
}
|
|
|
|
void terminate() {
|
|
audioBackend.terminate();
|
|
video.exit();
|
|
SDL_Quit();
|
|
}
|
|
}
|
|
|