16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 03:29:19 +02:00

merge manul

This commit is contained in:
WLs50
2025-03-09 15:36:11 +01:00
parent a687f551a2
commit a5f6397eca
1211 changed files with 483542 additions and 58643 deletions

View File

@@ -10,11 +10,17 @@ http://mozilla.org/MPL/2.0/.
#pragma once
#include "geometrybank.h"
#include "material.h"
#include "interfaces/IMaterial.h"
#include "interfaces/ITexture.h"
#include "Globals.h"
struct lighting_data;
namespace gl
{
class program;
}
class gfx_renderer {
public:
@@ -49,15 +55,15 @@ public:
// material methods
virtual auto Fetch_Material( std::string const &Filename, bool const Loadnow = true ) -> material_handle = 0;
virtual void Bind_Material( material_handle const Material, TSubModel const *sm = nullptr, lighting_data const *lighting = nullptr ) = 0;
virtual auto Material( material_handle const Material ) const -> opengl_material const & = 0;
virtual auto Material( material_handle const Material ) const -> IMaterial const * = 0;
// shader methods
virtual auto Fetch_Shader( std::string const &name ) -> std::shared_ptr<gl::program> = 0;
// texture methods
virtual auto Fetch_Texture( std::string const &Filename, bool const Loadnow = true, GLint format_hint = GL_SRGB_ALPHA ) -> texture_handle = 0;
virtual void Bind_Texture( texture_handle const Texture ) = 0;
virtual void Bind_Texture( std::size_t const Unit, texture_handle const Texture ) = 0;
virtual auto Texture( texture_handle const Texture ) -> opengl_texture & = 0;
virtual auto Texture( texture_handle const Texture ) const -> opengl_texture const & = 0;
virtual auto Texture( texture_handle const Texture ) -> ITexture & = 0;
virtual auto Texture( texture_handle const Texture ) const -> ITexture const & = 0;
// utility methods
virtual void Pick_Control_Callback( std::function<void( TSubModel const *, const glm::vec2 )> Callback ) = 0;
virtual void Pick_Node_Callback( std::function<void( scene::basic_node * )> Callback ) = 0;
@@ -74,6 +80,9 @@ public:
// debug methods
virtual auto info_times() const -> std::string const & = 0;
virtual auto info_stats() const -> std::string const & = 0;
// imgui renderer
virtual class imgui_renderer *GetImguiRenderer() = 0;
virtual void MakeScreenshot() = 0;
};
class gfx_renderer_factory
@@ -91,6 +100,14 @@ private:
static gfx_renderer_factory *instance;
};
class imgui_renderer
{
public:
virtual bool Init() = 0;
virtual void Shutdown() = 0;
virtual void BeginFrame() = 0;
virtual void Render() = 0;
};
extern std::unique_ptr<gfx_renderer> GfxRenderer;