Initial commit
This commit is contained in:
commit
fce29361f6
35 changed files with 59905 additions and 0 deletions
27
include/display/base_window.hpp
Normal file
27
include/display/base_window.hpp
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#pragma once
|
||||
|
||||
#include "glad.h"
|
||||
#include "glfw3.h"
|
||||
#include "imgui.h"
|
||||
#include "imgui_impl_glfw.h"
|
||||
#include "imgui_impl_opengl3.h"
|
||||
#include <string>
|
||||
|
||||
class BaseWindow {
|
||||
public:
|
||||
int windowWidth, windowHeight;
|
||||
std::string windowTitle;
|
||||
GLFWwindow* windowHandle;
|
||||
|
||||
public:
|
||||
BaseWindow();
|
||||
BaseWindow(int width, int height, std::string title);
|
||||
int Run();
|
||||
|
||||
protected:
|
||||
virtual void Initialize() = 0;
|
||||
virtual void LoadContent() = 0;
|
||||
virtual void Update() = 0;
|
||||
virtual void Render() = 0;
|
||||
virtual void Unload() = 0;
|
||||
};
|
||||
11
include/display/game_window.hpp
Normal file
11
include/display/game_window.hpp
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#include "display/base_window.hpp"
|
||||
|
||||
class GameWindow : public BaseWindow {
|
||||
public:
|
||||
GameWindow(int width, int height, std::string title) : BaseWindow(width, height, title) {};
|
||||
void Initialize();
|
||||
void LoadContent();
|
||||
void Update();
|
||||
void Render();
|
||||
void Unload();
|
||||
};
|
||||
25
include/shaders/shader.hpp
Normal file
25
include/shaders/shader.hpp
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#pragma once
|
||||
|
||||
#include "glad.h"
|
||||
#include "glfw3.h"
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
class Shader {
|
||||
public:
|
||||
unsigned int programID;
|
||||
std::string vertexFile;
|
||||
std::string fragmentFile;
|
||||
|
||||
long fragmentModTimeOnLoad;
|
||||
|
||||
Shader();
|
||||
void Unload();
|
||||
void ReloadFromFile();
|
||||
static Shader LoadShader(std::string fileVertexShader, std::string fileFragmentShader);
|
||||
|
||||
private:
|
||||
static bool CompileShader(unsigned int shaderId, char(&infoLog)[512]);
|
||||
static bool LinkProgram(unsigned int programID, char(&infoLog)[512]);
|
||||
};
|
||||
12
include/utils/utility.hpp
Normal file
12
include/utils/utility.hpp
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#pragma once
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <ctime>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <cerrno>
|
||||
using namespace std;
|
||||
|
||||
bool ReadFile(std::string file, std::string& fileContents, bool addLineTerminator = false);
|
||||
long GetFileModTime(std::string file);
|
||||
Loading…
Add table
Add a link
Reference in a new issue