monorepo/TTT/App.hh

48 lines
1.3 KiB
C++

#pragma once
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <SDL2/SDL_timer.h>
#include <SDL2/SDL2_gfxPrimitives.h>
#include <map>
#include <vector>
namespace TTT
{
enum TEXTURE {
NONE,
WALL,
SYMBOL_X,
SYMBOL_O
};
class App
{
private:
int m_WindowWidth;
int m_WindowHeight;
int m_Close;
int m_GridHeight;
int m_GridWidth;
SDL_Window* m_Window;
SDL_Renderer* m_Renderer;
SDL_Surface* m_Surface;
std::map<TEXTURE,SDL_Texture*> m_Textures;
std::vector<std::vector<std::pair<SDL_Rect, TEXTURE>>> m_Grid;
public:
App(int width, int height);
void DrawToGridCell(TEXTURE textureId, int x, int y);
void DrawGrid();
void UpdateGridHover(int x, int y);
void GridRenderCopy();
~App();
};
} // namespace TTT