Compare commits
6 Commits
9d5bb51463
...
69dbe5ae2f
Author | SHA1 | Date | |
---|---|---|---|
69dbe5ae2f | |||
de6496ff81 | |||
807e0ce9d9 | |||
58e25b530b | |||
39f528d7ad | |||
6dc269ce13 |
14
README.md
14
README.md
@ -4,6 +4,20 @@
|
|||||||
|
|
||||||
This is a basic future game engine for OpenGL 3D rendered games
|
This is a basic future game engine for OpenGL 3D rendered games
|
||||||
|
|
||||||
|
## Building on Windows
|
||||||
|
|
||||||
|
In order to configure and run project on windows platform use following commands.
|
||||||
|
|
||||||
|
Configuring:
|
||||||
|
|
||||||
|
```console
|
||||||
|
cmake -S . -B build `
|
||||||
|
-G "Visual Studio 17 2022" -A x64 `
|
||||||
|
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake `
|
||||||
|
-DVCPKG_TARGET_TRIPLET=x64-windows `
|
||||||
|
-DCMAKE_BUILD_TYPE=Debug
|
||||||
|
```
|
||||||
|
|
||||||
## Multi-GPU Devices
|
## Multi-GPU Devices
|
||||||
|
|
||||||
If you want to use non-primary GPU on your device when launching the game specifically on Linux you should specify additional environment variables before running. For example in my case I have a hybrid gaming laptop with 2 GPUs AMD from CPU and NVIDIA discrete.
|
If you want to use non-primary GPU on your device when launching the game specifically on Linux you should specify additional environment variables before running. For example in my case I have a hybrid gaming laptop with 2 GPUs AMD from CPU and NVIDIA discrete.
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#define MODEL_H_
|
#define MODEL_H_
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <filesystem>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <glm/glm.hpp>
|
#include <glm/glm.hpp>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@ -120,7 +121,7 @@ public:
|
|||||||
static Object LoadFile(const std::string& filename);
|
static Object LoadFile(const std::string& filename);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void LoadMaterials(const std::string& filename);
|
void LoadMaterials(const std::filesystem::path& filename);
|
||||||
private:
|
private:
|
||||||
void AddMaterial(std::string name, std::shared_ptr<Material> material);
|
void AddMaterial(std::string name, std::shared_ptr<Material> material);
|
||||||
std::shared_ptr<Material> GetMaterial(std::string name);
|
std::shared_ptr<Material> GetMaterial(std::string name);
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
#ifndef PRELUDE_H_
|
#ifndef PRELUDE_H_
|
||||||
#define PRELUDE_H_
|
#define PRELUDE_H_
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
#define GLEW_STATIC
|
#define GLEW_STATIC
|
||||||
|
#endif
|
||||||
#include <GL/glew.h>
|
#include <GL/glew.h>
|
||||||
|
|
||||||
#include "SDL3/SDL.h"
|
#include "SDL3/SDL.h"
|
||||||
|
|
||||||
struct RenderContext {
|
struct RenderContext {
|
||||||
|
@ -1,4 +1,10 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
// #ifdef WIN32
|
||||||
|
#define _USE_MATH_DEFINES
|
||||||
|
#include <cmath>
|
||||||
|
// #endif
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <glm/glm.hpp>
|
#include <glm/glm.hpp>
|
||||||
#include <glm/ext/quaternion_geometric.hpp>
|
#include <glm/ext/quaternion_geometric.hpp>
|
||||||
|
@ -86,7 +86,7 @@ Object::Object() {
|
|||||||
m_texCoords = std::vector<glm::vec2>();
|
m_texCoords = std::vector<glm::vec2>();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Object::LoadMaterials(const std::string& filename) {
|
void Object::LoadMaterials(const std::filesystem::path& filename) {
|
||||||
std::ifstream file(filename);
|
std::ifstream file(filename);
|
||||||
|
|
||||||
std::string currentMaterialName;
|
std::string currentMaterialName;
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include "prelude.h"
|
#include "prelude.h"
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
#define GLEW_STATIC
|
#define GLEW_STATIC
|
||||||
|
#endif
|
||||||
#include <GL/glew.h>
|
#include <GL/glew.h>
|
||||||
|
|
||||||
#define SCREEN_WIDTH 1024
|
#define SCREEN_WIDTH 1024
|
||||||
|
Reference in New Issue
Block a user