mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-08 09:43:22 +08:00
Change CMakeLists.txt to add 2d_game project, and added irrKlang to LIBS.
Added irrKlang.dll and ikpMP2.dll to dlls folder. Added irrKlang as a sub-folder under includes. Added irrKlang.lib to lib folder. At this point running cmake gave an error it couldn't find source files under 2d_game. Moved 2d_game source up one folder level, then cmake found the files.
This commit is contained in:
@@ -1,41 +0,0 @@
|
||||
/*******************************************************************
|
||||
** This code is part of Breakout.
|
||||
**
|
||||
** Breakout is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the CC BY 4.0 license as published by
|
||||
** Creative Commons, either version 4 of the License, or (at your
|
||||
** option) any later version.
|
||||
******************************************************************/
|
||||
#ifndef GAMELEVEL_H
|
||||
#define GAMELEVEL_H
|
||||
#include <vector>
|
||||
|
||||
#include <glad/glad.h>
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
#include "game_object.h"
|
||||
#include "sprite_renderer.h"
|
||||
#include "resource_manager.h"
|
||||
|
||||
|
||||
/// GameLevel holds all Tiles as part of a Breakout level and
|
||||
/// hosts functionality to Load/render levels from the harddisk.
|
||||
class GameLevel
|
||||
{
|
||||
public:
|
||||
// level state
|
||||
std::vector<GameObject> Bricks;
|
||||
// constructor
|
||||
GameLevel() { }
|
||||
// loads level from file
|
||||
void Load(const char *file, unsigned int levelWidth, unsigned int levelHeight);
|
||||
// render level
|
||||
void Draw(SpriteRenderer &renderer);
|
||||
// check if the level is completed (all non-solid tiles are destroyed)
|
||||
bool IsCompleted();
|
||||
private:
|
||||
// initialize level from tile data
|
||||
void init(std::vector<std::vector<unsigned int>> tileData, unsigned int levelWidth, unsigned int levelHeight);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user