46 lines
1.3 KiB
C++
46 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>
|
|
#include <memory>
|
|
|
|
#include "Typedef.hh"
|
|
#include "Board.hh"
|
|
|
|
namespace TTT
|
|
{
|
|
|
|
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;
|
|
std::shared_ptr<Board> m_Board;
|
|
|
|
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
|
|
|
|
|
|
|