readme.md
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
#include <lua.hpp>
|
||||||
using namespace std::chrono_literals;
|
using namespace std::chrono_literals;
|
||||||
void Engine::start_loop() {
|
void Engine::start_loop() {
|
||||||
const auto one_second_milli = std::chrono::milliseconds(1s);
|
const auto one_second_milli = std::chrono::milliseconds(1s);
|
||||||
|
|||||||
@@ -7,17 +7,17 @@
|
|||||||
void SdlRenderer::initialize(RendererParams params) {
|
void SdlRenderer::initialize(RendererParams params) {
|
||||||
if(SDL_Init(SDL_INIT_VIDEO) < 0) {
|
if(SDL_Init(SDL_INIT_VIDEO) < 0) {
|
||||||
printf("SDL vide oinit failed: %s\n", SDL_GetError());
|
printf("SDL vide oinit failed: %s\n", SDL_GetError());
|
||||||
return;
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
auto img_flags = IMG_INIT_PNG;
|
auto img_flags = IMG_INIT_PNG;
|
||||||
if(!(IMG_Init(img_flags) & img_flags)) {
|
if(!(IMG_Init(img_flags) & img_flags)) {
|
||||||
printf("Failed to init image loading: %s", IMG_GetError());
|
printf("Failed to init image loading: %s", IMG_GetError());
|
||||||
return;
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
SDL_Window* sdl_window = SDL_CreateWindow(params.title.c_str(), SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, params.width, params.height, SDL_WINDOW_SHOWN);
|
SDL_Window* sdl_window = SDL_CreateWindow(params.title.c_str(), SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, params.width, params.height, SDL_WINDOW_SHOWN);
|
||||||
if(sdl_window == nullptr) {
|
if(sdl_window == nullptr) {
|
||||||
printf("error making window: %s\n", SDL_GetError());
|
printf("error making window: %s\n", SDL_GetError());
|
||||||
return;
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this->window = sdl_window;
|
this->window = sdl_window;
|
||||||
|
|||||||
Reference in New Issue
Block a user