mirror of
https://github.com/bailwillharr/engine.git
synced 2024-09-21 04:51:18 +00:00
Clean stuff up
This commit is contained in:
parent
0a39baea20
commit
c489c66a44
@ -1,8 +1,12 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "resource_manager.hpp"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
|
#include <unordered_map>
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
namespace engine {
|
namespace engine {
|
||||||
|
|
||||||
@ -19,6 +23,30 @@ namespace engine {
|
|||||||
Application(const Application&) = delete;
|
Application(const Application&) = delete;
|
||||||
Application& operator=(const Application&) = delete;
|
Application& operator=(const Application&) = delete;
|
||||||
|
|
||||||
|
/* resource stuff */
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
void registerResourceManager()
|
||||||
|
{
|
||||||
|
size_t hash = typeid(T).hash_code();
|
||||||
|
assert(m_resourceManagers.contains(hash) == false && "Registering resource manager type more than once.");
|
||||||
|
m_resourceManagers.emplace(hash, std::make_unique<ResourceManager<T>>());
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
std::shared_ptr<T> addResource(const std::string& name, std::unique_ptr<T>&& resource)
|
||||||
|
{
|
||||||
|
auto resourceManager = getResourceManager<T>();
|
||||||
|
return resourceManager->add(name, std::move(resource));
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
std::shared_ptr<T> getResource(const std::string& name)
|
||||||
|
{
|
||||||
|
auto resourceManager = getResourceManager<T>();
|
||||||
|
return resourceManager->get(name);
|
||||||
|
}
|
||||||
|
|
||||||
/* methods */
|
/* methods */
|
||||||
void gameLoop();
|
void gameLoop();
|
||||||
|
|
||||||
@ -42,6 +70,24 @@ namespace engine {
|
|||||||
|
|
||||||
bool m_enableFrameLimiter = true;
|
bool m_enableFrameLimiter = true;
|
||||||
|
|
||||||
|
/* resource stuff */
|
||||||
|
|
||||||
|
std::unordered_map<size_t, std::unique_ptr<IResourceManager>> m_resourceManagers{};
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
ResourceManager<T>* getResourceManager()
|
||||||
|
{
|
||||||
|
size_t hash = typeid(T).hash_code();
|
||||||
|
auto it = m_resourceManagers.find(hash);
|
||||||
|
if (it == m_resourceManagers.end()) {
|
||||||
|
throw std::runtime_error("Cannot find resource manager.");
|
||||||
|
}
|
||||||
|
auto ptr = it->second.get();
|
||||||
|
auto castedPtr = dynamic_cast<ResourceManager<T>*>(ptr);
|
||||||
|
assert(castedPtr != nullptr);
|
||||||
|
return castedPtr;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -25,8 +25,9 @@ namespace engine::gfx {
|
|||||||
};
|
};
|
||||||
|
|
||||||
enum class VertexAttribFormat {
|
enum class VertexAttribFormat {
|
||||||
VEC2,
|
FLOAT2,
|
||||||
VEC3,
|
FLOAT3,
|
||||||
|
FLOAT4
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class TextureFilter {
|
enum class TextureFilter {
|
||||||
|
@ -14,13 +14,10 @@ public:
|
|||||||
|
|
||||||
// defines what vertex inputs are defined, position is always vec3
|
// defines what vertex inputs are defined, position is always vec3
|
||||||
struct VertexParams {
|
struct VertexParams {
|
||||||
bool hasNormal;
|
bool hasNormal; // vec3
|
||||||
bool hasUV0;
|
bool hasTangent; // vec3
|
||||||
bool hasUV1;
|
bool hasColor; // vec3
|
||||||
bool hasUV2;
|
bool hasUV0; // vec2
|
||||||
bool hasUV3;
|
|
||||||
bool hasTangent;
|
|
||||||
bool hasColor;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Shader(GFXDevice* gfx, const char* vertPath, const char* fragPath, const VertexParams& vertexParams, bool alphaBlending, bool cullBackFace);
|
Shader(GFXDevice* gfx, const char* vertPath, const char* fragPath, const VertexParams& vertexParams, bool alphaBlending, bool cullBackFace);
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include "log.hpp"
|
#include "log.hpp"
|
||||||
|
|
||||||
#include "resource_manager.hpp"
|
|
||||||
#include "ecs_system.hpp"
|
#include "ecs_system.hpp"
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
@ -26,30 +25,6 @@ namespace engine {
|
|||||||
|
|
||||||
Application* app() { return m_app; }
|
Application* app() { return m_app; }
|
||||||
|
|
||||||
/* resource stuff */
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
void registerResourceManager()
|
|
||||||
{
|
|
||||||
size_t hash = typeid(T).hash_code();
|
|
||||||
assert(m_resourceManagers.contains(hash) == false && "Registering resource manager type more than once.");
|
|
||||||
m_resourceManagers.emplace(hash, std::make_unique<ResourceManager<T>>());
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
std::shared_ptr<T> addResource(const std::string& name, std::unique_ptr<T>&& resource)
|
|
||||||
{
|
|
||||||
auto resourceManager = getResourceManager<T>();
|
|
||||||
return resourceManager->add(name, std::move(resource));
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
std::shared_ptr<T> getResource(const std::string& name)
|
|
||||||
{
|
|
||||||
auto resourceManager = getResourceManager<T>();
|
|
||||||
return resourceManager->get(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ecs stuff */
|
/* ecs stuff */
|
||||||
|
|
||||||
uint32_t createEntity(const std::string& tag, uint32_t parent = 0);
|
uint32_t createEntity(const std::string& tag, uint32_t parent = 0);
|
||||||
@ -127,24 +102,6 @@ namespace engine {
|
|||||||
Application* const m_app;
|
Application* const m_app;
|
||||||
uint32_t m_nextEntityID = 1000;
|
uint32_t m_nextEntityID = 1000;
|
||||||
|
|
||||||
/* resource stuff */
|
|
||||||
|
|
||||||
std::map<size_t, std::unique_ptr<IResourceManager>> m_resourceManagers{};
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
ResourceManager<T>* getResourceManager()
|
|
||||||
{
|
|
||||||
size_t hash = typeid(T).hash_code();
|
|
||||||
auto it = m_resourceManagers.find(hash);
|
|
||||||
if (it == m_resourceManagers.end()) {
|
|
||||||
throw std::runtime_error("Cannot find resource manager.");
|
|
||||||
}
|
|
||||||
auto ptr = it->second.get();
|
|
||||||
auto castedPtr = dynamic_cast<ResourceManager<T>*>(ptr);
|
|
||||||
assert(castedPtr != nullptr);
|
|
||||||
return castedPtr;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ecs stuff */
|
/* ecs stuff */
|
||||||
|
|
||||||
size_t m_nextSignaturePosition = 0;
|
size_t m_nextSignaturePosition = 0;
|
||||||
|
@ -9,12 +9,6 @@ namespace engine {
|
|||||||
|
|
||||||
class Application;
|
class Application;
|
||||||
class Scene; // "scene.hpp"
|
class Scene; // "scene.hpp"
|
||||||
namespace resources {
|
|
||||||
class Texture;
|
|
||||||
class Shader;
|
|
||||||
class Mesh;
|
|
||||||
class Material;
|
|
||||||
}
|
|
||||||
|
|
||||||
class SceneManager {
|
class SceneManager {
|
||||||
|
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
#version 450
|
|
||||||
|
|
||||||
layout(location = 0) in vec3 fragPos;
|
|
||||||
layout(location = 1) in vec3 fragNorm;
|
|
||||||
layout(location = 2) in vec2 fragUV;
|
|
||||||
layout(location = 3) in vec3 fragLightPos;
|
|
||||||
|
|
||||||
layout(location = 0) out vec4 outColor;
|
|
||||||
|
|
||||||
void main() {
|
|
||||||
|
|
||||||
// constants
|
|
||||||
vec3 lightColor = vec3(1.0, 1.0, 1.0);
|
|
||||||
vec3 ambientColor = vec3(1.0, 1.0, 1.0);
|
|
||||||
float ambientStrength = 0.05;
|
|
||||||
vec3 baseColor = vec3(fragUV.x, 0.0, fragUV.y);
|
|
||||||
vec3 emission = vec3(0.0, 0.0, 0.0);
|
|
||||||
|
|
||||||
// code
|
|
||||||
|
|
||||||
vec3 norm = normalize(fragNorm);
|
|
||||||
vec3 lightDir = normalize(fragLightPos - fragPos);
|
|
||||||
|
|
||||||
vec3 diffuse = max(dot(norm, lightDir), 0.0) * lightColor;
|
|
||||||
vec3 ambient = ambientColor * ambientStrength;
|
|
||||||
|
|
||||||
vec3 viewDir = normalize(-fragPos);
|
|
||||||
vec3 reflectDir = reflect(-lightDir, norm);
|
|
||||||
|
|
||||||
float spec = pow(max(dot(viewDir, reflectDir), 0.0), 32);
|
|
||||||
vec3 specular = 0.5 * spec * lightColor;
|
|
||||||
|
|
||||||
vec3 lighting = min(diffuse + ambient + specular, 1.0);
|
|
||||||
outColor = min( ( vec4(baseColor, 1.0) ) * vec4(lighting + emission, 1.0), vec4(1.0));
|
|
||||||
}
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
|||||||
#version 450
|
|
||||||
|
|
||||||
layout(binding = 0) uniform UBO {
|
|
||||||
mat4 proj;
|
|
||||||
} ubo;
|
|
||||||
|
|
||||||
layout( push_constant ) uniform Constants {
|
|
||||||
mat4 model;
|
|
||||||
mat4 view;
|
|
||||||
} constants;
|
|
||||||
|
|
||||||
layout(location = 0) in vec3 inPosition;
|
|
||||||
layout(location = 1) in vec3 inNorm;
|
|
||||||
layout(location = 2) in vec2 inUV;
|
|
||||||
|
|
||||||
layout(location = 0) out vec3 fragPos;
|
|
||||||
layout(location = 1) out vec3 fragNorm;
|
|
||||||
layout(location = 2) out vec2 fragUV;
|
|
||||||
layout(location = 3) out vec3 fragLightPos;
|
|
||||||
|
|
||||||
void main() {
|
|
||||||
gl_Position = ubo.proj * constants.view * constants.model * vec4(inPosition, 1.0);
|
|
||||||
fragPos = vec3(constants.view * constants.model * vec4(inPosition, 1.0));
|
|
||||||
fragNorm = mat3(transpose(inverse(constants.view * constants.model))) * inNorm;
|
|
||||||
fragUV = inUV;
|
|
||||||
vec3 lightPos = vec3(-500.0, 500.0, 40.0);
|
|
||||||
fragLightPos = vec3(constants.view * vec4(lightPos, 1.0));
|
|
||||||
}
|
|
11
res/engine/shaders/showUVs.frag
Normal file
11
res/engine/shaders/showUVs.frag
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#version 450
|
||||||
|
|
||||||
|
layout(location = 0) in vec2 fragUV;
|
||||||
|
|
||||||
|
layout(location = 0) out vec4 outColor;
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
vec3 baseColor = vec3(fragUV, 0.0);
|
||||||
|
outColor = vec4(baseColor, 1.0);
|
||||||
|
}
|
||||||
|
|
21
res/engine/shaders/showUVs.vert
Normal file
21
res/engine/shaders/showUVs.vert
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#version 450
|
||||||
|
|
||||||
|
layout(binding = 0) uniform UBO {
|
||||||
|
mat4 proj;
|
||||||
|
} ubo;
|
||||||
|
|
||||||
|
layout( push_constant ) uniform Constants {
|
||||||
|
mat4 model;
|
||||||
|
mat4 view;
|
||||||
|
} constants;
|
||||||
|
|
||||||
|
layout(location = 0) in vec3 inPosition;
|
||||||
|
layout(location = 1) in vec3 inNorm;
|
||||||
|
layout(location = 2) in vec2 inUV;
|
||||||
|
|
||||||
|
layout(location = 0) out vec2 fragUV;
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
gl_Position = ubo.proj * constants.view * constants.model * vec4(inPosition, 1.0);
|
||||||
|
fragUV = inUV;
|
||||||
|
}
|
@ -20,9 +20,11 @@ layout(location = 3) out vec3 fragLightPos;
|
|||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
gl_Position = ubo.proj * constants.view * constants.model * vec4(inPosition, 1.0);
|
gl_Position = ubo.proj * constants.view * constants.model * vec4(inPosition, 1.0);
|
||||||
|
|
||||||
fragPos = vec3(constants.view * constants.model * vec4(inPosition, 1.0));
|
fragPos = vec3(constants.view * constants.model * vec4(inPosition, 1.0));
|
||||||
fragNorm = mat3(transpose(inverse(constants.view * constants.model))) * inNorm;
|
fragNorm = mat3(transpose(inverse(constants.view * constants.model))) * inNorm;
|
||||||
fragUV = inUV;
|
fragUV = inUV;
|
||||||
|
|
||||||
vec3 lightPos = vec3(-10.0, 10.0, 10.0);
|
vec3 lightPos = vec3(-10.0, 10.0, 10.0);
|
||||||
fragLightPos = vec3(constants.view * vec4(lightPos, 1.0));
|
fragLightPos = vec3(constants.view * vec4(lightPos, 1.0));
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,11 @@
|
|||||||
|
|
||||||
#include "scene.hpp"
|
#include "scene.hpp"
|
||||||
|
|
||||||
|
#include "resources/mesh.hpp"
|
||||||
|
#include "resources/material.hpp"
|
||||||
|
#include "resources/shader.hpp"
|
||||||
|
#include "resources/texture.hpp"
|
||||||
|
|
||||||
// To allow the FPS-limiter to put the thread to sleep
|
// To allow the FPS-limiter to put the thread to sleep
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
@ -60,6 +65,13 @@ namespace engine {
|
|||||||
|
|
||||||
// get base path for resources
|
// get base path for resources
|
||||||
m_resourcesPath = getResourcesPath();
|
m_resourcesPath = getResourcesPath();
|
||||||
|
|
||||||
|
// initialise some basic resources
|
||||||
|
registerResourceManager<engine::resources::Mesh>();
|
||||||
|
registerResourceManager<engine::resources::Material>();
|
||||||
|
registerResourceManager<engine::resources::Shader>();
|
||||||
|
registerResourceManager<engine::resources::Texture>();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Application::~Application() {}
|
Application::~Application() {}
|
||||||
|
@ -140,10 +140,12 @@ namespace engine {
|
|||||||
static VkFormat getVertexAttribFormat(gfx::VertexAttribFormat fmt)
|
static VkFormat getVertexAttribFormat(gfx::VertexAttribFormat fmt)
|
||||||
{
|
{
|
||||||
switch (fmt) {
|
switch (fmt) {
|
||||||
case gfx::VertexAttribFormat::VEC2:
|
case gfx::VertexAttribFormat::FLOAT2:
|
||||||
return VK_FORMAT_R32G32_SFLOAT;
|
return VK_FORMAT_R32G32_SFLOAT;
|
||||||
case gfx::VertexAttribFormat::VEC3:
|
case gfx::VertexAttribFormat::FLOAT3:
|
||||||
return VK_FORMAT_R32G32B32_SFLOAT;
|
return VK_FORMAT_R32G32B32_SFLOAT;
|
||||||
|
case gfx::VertexAttribFormat::FLOAT4:
|
||||||
|
return VK_FORMAT_R32G32B32A32_SFLOAT;
|
||||||
}
|
}
|
||||||
throw std::runtime_error("Unknown vertex attribute format");
|
throw std::runtime_error("Unknown vertex attribute format");
|
||||||
}
|
}
|
||||||
|
@ -15,36 +15,24 @@ namespace engine::resources {
|
|||||||
uint32_t stride = 0;
|
uint32_t stride = 0;
|
||||||
gfx::VertexFormat vertFormat{};
|
gfx::VertexFormat vertFormat{};
|
||||||
|
|
||||||
vertFormat.attributeDescriptions.emplace_back(index++, gfx::VertexAttribFormat::VEC3, stride);
|
vertFormat.attributeDescriptions.emplace_back(index++, gfx::VertexAttribFormat::FLOAT3, stride);
|
||||||
stride += 3 * sizeof(float);
|
stride += 3 * sizeof(float);
|
||||||
|
|
||||||
if (vertexParams.hasNormal) {
|
if (vertexParams.hasNormal) {
|
||||||
vertFormat.attributeDescriptions.emplace_back(index++, gfx::VertexAttribFormat::VEC3, stride);
|
vertFormat.attributeDescriptions.emplace_back(index++, gfx::VertexAttribFormat::FLOAT3, stride);
|
||||||
stride += 3 * sizeof(float);
|
stride += 3 * sizeof(float);
|
||||||
}
|
}
|
||||||
if (vertexParams.hasUV0) {
|
|
||||||
vertFormat.attributeDescriptions.emplace_back(index++, gfx::VertexAttribFormat::VEC2, stride);
|
|
||||||
stride += 2 * sizeof(float);
|
|
||||||
}
|
|
||||||
if (vertexParams.hasUV1) {
|
|
||||||
vertFormat.attributeDescriptions.emplace_back(index++, gfx::VertexAttribFormat::VEC2, stride);
|
|
||||||
stride += 2 * sizeof(float);
|
|
||||||
}
|
|
||||||
if (vertexParams.hasUV2) {
|
|
||||||
vertFormat.attributeDescriptions.emplace_back(index++, gfx::VertexAttribFormat::VEC2, stride);
|
|
||||||
stride += 2 * sizeof(float);
|
|
||||||
}
|
|
||||||
if (vertexParams.hasUV3) {
|
|
||||||
vertFormat.attributeDescriptions.emplace_back(index++, gfx::VertexAttribFormat::VEC2, stride);
|
|
||||||
stride += 2 * sizeof(float);
|
|
||||||
}
|
|
||||||
if (vertexParams.hasTangent) {
|
if (vertexParams.hasTangent) {
|
||||||
vertFormat.attributeDescriptions.emplace_back(index++, gfx::VertexAttribFormat::VEC3, stride);
|
vertFormat.attributeDescriptions.emplace_back(index++, gfx::VertexAttribFormat::FLOAT4, stride);
|
||||||
stride += 3 * sizeof(float);
|
stride += 4 * sizeof(float);
|
||||||
}
|
}
|
||||||
if (vertexParams.hasColor) {
|
if (vertexParams.hasColor) {
|
||||||
vertFormat.attributeDescriptions.emplace_back(index++, gfx::VertexAttribFormat::VEC3, stride);
|
vertFormat.attributeDescriptions.emplace_back(index++, gfx::VertexAttribFormat::FLOAT4, stride);
|
||||||
stride += 3 * sizeof(float);
|
stride += 4 * sizeof(float);
|
||||||
|
}
|
||||||
|
if (vertexParams.hasUV0) {
|
||||||
|
vertFormat.attributeDescriptions.emplace_back(index++, gfx::VertexAttribFormat::FLOAT2, stride);
|
||||||
|
stride += 2 * sizeof(float);
|
||||||
}
|
}
|
||||||
vertFormat.stride = stride;
|
vertFormat.stride = stride;
|
||||||
|
|
||||||
|
@ -77,11 +77,11 @@ namespace engine::util {
|
|||||||
auto child = scene->createEntity("_mesh" + std::to_string(i), parentObj);
|
auto child = scene->createEntity("_mesh" + std::to_string(i), parentObj);
|
||||||
auto childRenderer = scene->addComponent<RenderableComponent>(child);
|
auto childRenderer = scene->addComponent<RenderableComponent>(child);
|
||||||
childRenderer->mesh = meshes[parentNode->mMeshes[i]];
|
childRenderer->mesh = meshes[parentNode->mMeshes[i]];
|
||||||
childRenderer->material = std::make_shared<resources::Material>(scene->getResource<resources::Shader>("theShader"));
|
childRenderer->material = std::make_shared<resources::Material>(scene->app()->getResource<resources::Shader>("engine.textured"));
|
||||||
if (textures.contains(meshTextureIndices[parentNode->mMeshes[i]])) {
|
if (textures.contains(meshTextureIndices[parentNode->mMeshes[i]])) {
|
||||||
childRenderer->material->m_texture = textures.at(meshTextureIndices[parentNode->mMeshes[i]]);
|
childRenderer->material->m_texture = textures.at(meshTextureIndices[parentNode->mMeshes[i]]);
|
||||||
} else {
|
} else {
|
||||||
childRenderer->material->m_texture = scene->getResource<resources::Texture>("whiteTexture");
|
childRenderer->material->m_texture = scene->app()->getResource<resources::Texture>("engine.white");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,7 +183,7 @@ namespace engine::util {
|
|||||||
try {
|
try {
|
||||||
textures[i] = std::make_shared<resources::Texture>(parent->app()->gfx(), absPath.string());
|
textures[i] = std::make_shared<resources::Texture>(parent->app()->gfx(), absPath.string());
|
||||||
} catch (const std::runtime_error&) {
|
} catch (const std::runtime_error&) {
|
||||||
textures[i] = parent->getResource<resources::Texture>("textures/white.png");
|
textures[i] = parent->app()->getResource<resources::Texture>("engine.white");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,9 +75,6 @@ void playGame()
|
|||||||
app.inputManager()->addInputAxis("lookx", engine::inputs::MouseAxis::X);
|
app.inputManager()->addInputAxis("lookx", engine::inputs::MouseAxis::X);
|
||||||
app.inputManager()->addInputAxis("looky", engine::inputs::MouseAxis::Y);
|
app.inputManager()->addInputAxis("looky", engine::inputs::MouseAxis::Y);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// scene setup
|
// scene setup
|
||||||
|
|
||||||
auto myScene = app.sceneManager()->createEmptyScene();
|
auto myScene = app.sceneManager()->createEmptyScene();
|
||||||
@ -88,9 +85,6 @@ void playGame()
|
|||||||
myScene->registerSystem<RotateSystem>();
|
myScene->registerSystem<RotateSystem>();
|
||||||
myScene->registerSystem<CameraControllerSystem>();
|
myScene->registerSystem<CameraControllerSystem>();
|
||||||
|
|
||||||
myScene->registerResourceManager<engine::resources::Shader>();
|
|
||||||
myScene->registerResourceManager<engine::resources::Texture>();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -115,10 +109,11 @@ void playGame()
|
|||||||
app.gfx(),
|
app.gfx(),
|
||||||
app.getResourcePath("engine/textures/white.png")
|
app.getResourcePath("engine/textures/white.png")
|
||||||
);
|
);
|
||||||
auto keepTexture = myScene->addResource<engine::resources::Texture>("whiteTexture", std::move(whiteTexture));
|
auto keepTexture = app.addResource<engine::resources::Texture>("engine.white", std::move(whiteTexture));
|
||||||
auto keepShader = myScene->addResource<engine::resources::Shader>("theShader", std::move(theShader));
|
auto keepShader = app.addResource<engine::resources::Shader>("engine.textured", std::move(theShader));
|
||||||
|
|
||||||
// uint32_t astronaut = engine::util::loadMeshFromFile(myScene, app.getResourcePath("models/astronaut/astronaut.dae"));
|
uint32_t astronaut = engine::util::loadMeshFromFile(myScene, app.getResourcePath("models/astronaut/astronaut.dae"));
|
||||||
|
(void)astronaut;
|
||||||
|
|
||||||
auto grassTexture = std::make_shared<engine::resources::Texture>(
|
auto grassTexture = std::make_shared<engine::resources::Texture>(
|
||||||
app.gfx(),
|
app.gfx(),
|
||||||
|
Loading…
Reference in New Issue
Block a user