Add everything.
Some checks failed
Build C++ Project with Fedora Container and Create Release / build (push) Has been cancelled
Some checks failed
Build C++ Project with Fedora Container and Create Release / build (push) Has been cancelled
This commit is contained in:
4
include/General/GlobalHeaders.h
Normal file
4
include/General/GlobalHeaders.h
Normal file
@@ -0,0 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
28
include/Shaders/Shader.h
Normal file
28
include/Shaders/Shader.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef SHADER_H
|
||||
#define SHADER_H
|
||||
|
||||
#include <string>
|
||||
#include "../../ThirdParty/glm/glm.hpp"
|
||||
|
||||
class Shader
|
||||
{
|
||||
public:
|
||||
unsigned int ID;
|
||||
|
||||
Shader(const char* vertexPath, const char* fragmentPath);
|
||||
|
||||
void use();
|
||||
|
||||
void setBool(const std::string &name, bool value) const;
|
||||
void setInt(const std::string &name, int value) const;
|
||||
void setFloat(const std::string &name, float value) const;
|
||||
void setVec3(const std::string &name, const glm::vec3 &value) const;
|
||||
void setMat4(const std::string &name, const glm::mat4 &mat) const;
|
||||
|
||||
private:
|
||||
std::string readShaderFile(const char* filePath);
|
||||
void compileShaders(const char* vertexSource, const char* fragmentSource);
|
||||
void checkCompileErrors(unsigned int shader, std::string type);
|
||||
};
|
||||
|
||||
#endif
|
||||
23
include/Skybox/Skybox.h
Normal file
23
include/Skybox/Skybox.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef SKYBOX_H
|
||||
#define SKYBOX_H
|
||||
|
||||
class Shader;
|
||||
|
||||
class Skybox {
|
||||
private:
|
||||
unsigned int VAO, VBO;
|
||||
Shader* skyboxShader;
|
||||
float timeOfDay = 0.5f; // 0.0 = night, 0.25 = sunrise, 0.5 = day, 0.75 = sunset, 1.0 = midnight
|
||||
|
||||
void setupMesh();
|
||||
|
||||
public:
|
||||
Skybox();
|
||||
~Skybox();
|
||||
|
||||
void draw(const float* view, const float* projection);
|
||||
void setTimeOfDay(float time); // 0.0 to 1.0
|
||||
float getTimeOfDay() const { return timeOfDay; }
|
||||
};
|
||||
|
||||
#endif
|
||||
34
include/Textures/Texture.h
Normal file
34
include/Textures/Texture.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#ifndef TEXTURE_H
|
||||
#define TEXTURE_H
|
||||
|
||||
#include <string>
|
||||
#include <glad/glad.h>
|
||||
|
||||
class Texture
|
||||
{
|
||||
public:
|
||||
// load from file; format and wrap/filter are optional
|
||||
Texture(const std::string& path,
|
||||
GLenum wrapS = GL_REPEAT,
|
||||
GLenum wrapT = GL_REPEAT,
|
||||
GLenum minFilter = GL_LINEAR_MIPMAP_LINEAR,
|
||||
GLenum magFilter = GL_LINEAR);
|
||||
~Texture();
|
||||
|
||||
void Bind(GLenum unit = GL_TEXTURE0) const;
|
||||
void Unbind() const;
|
||||
|
||||
GLuint GetID() const { return m_ID; }
|
||||
int GetWidth() const { return m_Width; }
|
||||
int GetHeight() const { return m_Height; }
|
||||
|
||||
private:
|
||||
GLuint m_ID = 0;
|
||||
int m_Width = 0;
|
||||
int m_Height = 0;
|
||||
int m_Channels = 0;
|
||||
GLenum m_InternalFormat = GL_RGBA;
|
||||
GLenum m_DataFormat = GL_RGBA;
|
||||
};
|
||||
|
||||
#endif
|
||||
7988
include/ThirdParty/stb_image.h
vendored
Normal file
7988
include/ThirdParty/stb_image.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
3517
include/ThirdParty/tiny_obj_loader.h
vendored
Normal file
3517
include/ThirdParty/tiny_obj_loader.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
12
include/Window/Window.h
Normal file
12
include/Window/Window.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef WINDOW_H
|
||||
#define WINDOW_H
|
||||
#include "../General/GlobalHeaders.h"
|
||||
#include <glad/glad.h>
|
||||
#include "../../src/ThirdParty/glfw/include/GLFW/glfw3.h"
|
||||
|
||||
class Window {
|
||||
public:
|
||||
GLFWwindow* makeWindow();
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user