[TRY] trying to manage some data storage

This commit is contained in:
Lars
2021-06-11 15:56:34 +02:00
parent bce2ccf889
commit f6fad79c2e
8 changed files with 328 additions and 7 deletions

View File

@@ -1,11 +1,11 @@
#include "loading_Scene.h"
#include "../renderEngine/Renderer.h"
#include "../renderEngine/Loader.h"
#include "../renderEngine/obj_loader.h"
#include "../gui/gui_element.h"
namespace scene
{
Loading_Scene::Loading_Scene()
{
gui_shader = new shaders::GuiShader();
@@ -20,6 +20,8 @@ namespace scene
Scenes Loading_Scene::start(GLFWwindow* window)
{
render();
load_default_variables();
load_all_models();
}
@@ -27,7 +29,7 @@ namespace scene
{
render_engine::renderer::Prepare();
gui::GuiTexture loading_image = { render_engine::loader::LoadTexture("res/menu_item_start1.png"),
gui::GuiTexture loading_image = { render_engine::loader::LoadTexture("res/loading_screen.png"),
glm::vec2(0,0),glm::vec2(1,1) };
std::vector<gui::GuiTexture*> image_list;
@@ -44,4 +46,22 @@ namespace scene
void Loading_Scene::onKey(GLFWwindow* window, int key, int scancode, int action, int mods)
{
}
void Loading_Scene::load_default_variables()
{
models::RawModel raw_model = render_engine::LoadObjModel("res/HouseNew.obj");
models::ModelTexture default_texture = { render_engine::loader::LoadTexture("res/Texture.png") };
default_texture.shine_damper = 10;
models::TexturedModel house = { raw_model, default_texture };
singleton::Model_Storage::get_instance()->set_default_texture(default_texture);
singleton::Model_Storage::get_instance()->set_house_model(house);
}
void Loading_Scene::load_all_models()
{
}
}

View File

@@ -1,8 +1,8 @@
#pragma once
#pragma once
#include "scene.h"
#include "../gui/gui_element.h"
#include "../shaders/gui_shader.h"
#include "../model_Storage.h"
namespace scene
{
@@ -17,9 +17,13 @@ namespace scene
shaders::GuiShader* gui_shader;
private:
void load_default_variables();
void load_all_models();
public:
/**
* @brief Constructor of the class Startup_Scene
* @brief Constructor of the class Loading_Scene
*
*/
Loading_Scene();