BARE2D
BARE2DEngine.cpp
Go to the documentation of this file.
1
#include "
BARE2DEngine.hpp
"
2
3
#include <SDL2/SDL.h>
4
#include <GL/glew.h>
5
6
#include "
BAREErrors.hpp
"
7
8
namespace
BARE2D
{
9
10
void
init
() {
11
12
// Initialize all of SDL
13
int
err = SDL_Init(SDL_INIT_EVERYTHING);
14
// Get error from SDL
15
if
(err != 0) {
16
throwFatalError
(
BAREError::SDL_FAILURE
);
17
}
18
19
// Tell SDL to create a double buffered window, to avoid flickering.
20
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER,
true
);
21
}
22
23
}
BARE2D
Definition:
App.cpp:13
BARE2DEngine.hpp
BARE2D::BAREError::SDL_FAILURE
@ SDL_FAILURE
BAREErrors.hpp
BARE2D::init
void init()
Inits the required systems used by BARE2D.
Definition:
BARE2DEngine.cpp:10
BARE2D::throwFatalError
void throwFatalError(BAREError err, std::string message)
Throws an error (fatal). Also calls displayErrors and exits the program.
Definition:
BAREErrors.cpp:178
Source
BARE2DEngine.cpp
Generated by
1.8.17