Initial
This commit is contained in:
22
include/utils.hpp
Normal file
22
include/utils.hpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#define DISABLE_COPY(Class) \
|
||||
Class(const Class&) = delete; \
|
||||
Class& operator=(const Class&) = delete;
|
||||
|
||||
#define DISABLE_MOVE(Class) \
|
||||
Class(Class&&) = delete; \
|
||||
Class& operator=(Class&&) = delete;
|
||||
|
||||
#define DISABLE_COPY_AND_MOVE(Class) \
|
||||
DISABLE_COPY(Class) \
|
||||
DISABLE_MOVE(Class)
|
||||
|
||||
#define LOG(Msg) \
|
||||
std::cout << "\033[0m[LOG] " << __PRETTY_FUNCTION__ << ' ' << Msg << '\n';
|
||||
|
||||
#define WARN(Msg) \
|
||||
std::cout << "\033[33m[WARN] " << __PRETTY_FUNCTION__ << ' ' << Msg << "\033[0m\n";
|
||||
|
||||
#define ERROR(Msg) \
|
||||
std::cout << "\033[31m[ERROR] " << __PRETTY_FUNCTION__ << ' ' << Msg << '\033[0m\n';
|
||||
23
include/window/window.hpp
Normal file
23
include/window/window.hpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <SDL2/SDL.h>
|
||||
#include <iostream>
|
||||
|
||||
#include <utils.hpp>
|
||||
|
||||
namespace Game::Window {
|
||||
class Window {
|
||||
public:
|
||||
Window();
|
||||
DISABLE_COPY_AND_MOVE(Window)
|
||||
~Window();
|
||||
|
||||
bool init(int width, int height, const std::string& title);
|
||||
void run();
|
||||
|
||||
private:
|
||||
SDL_Window *mWindow;
|
||||
bool mRunning;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user