From 1a024a9f545e1312da044e859af996b154e13048 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 24 Apr 2018 23:39:58 +0200 Subject: [PATCH] - moved gl_material into hwrenderer/. --- src/CMakeLists.txt | 2 +- src/gl/models/gl_models.cpp | 2 +- src/gl/renderer/gl_renderstate.h | 2 +- src/gl/scene/gl_sky.cpp | 2 +- src/gl/scene/gl_walls.cpp | 2 +- src/gl/textures/gl_hwtexture.cpp | 2 +- src/gl/textures/gl_samplers.cpp | 2 +- src/gl/textures/gl_texture.cpp | 2 +- src/hwrenderer/textures/hw_ihwtexture.h | 31 +++++++++++++++++++ .../textures/hw_material.cpp} | 5 ++- .../textures/hw_material.h} | 0 11 files changed, 41 insertions(+), 11 deletions(-) create mode 100644 src/hwrenderer/textures/hw_ihwtexture.h rename src/{gl/textures/gl_material.cpp => hwrenderer/textures/hw_material.cpp} (99%) rename src/{gl/textures/gl_material.h => hwrenderer/textures/hw_material.h} (100%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b0bc95f4f..26a3608fd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1054,10 +1054,10 @@ set (PCH_SOURCES gl/system/gl_wipe.cpp gl/textures/gl_hwtexture.cpp gl/textures/gl_texture.cpp - gl/textures/gl_material.cpp gl/textures/gl_samplers.cpp hwrenderer/data/flatvertices.cpp hwrenderer/dynlights/hw_aabbtree.cpp + hwrenderer/textures/hw_material.cpp menu/joystickmenu.cpp menu/loadsavemenu.cpp diff --git a/src/gl/models/gl_models.cpp b/src/gl/models/gl_models.cpp index 364c3abcd..9bd76dd16 100644 --- a/src/gl/models/gl_models.cpp +++ b/src/gl/models/gl_models.cpp @@ -35,13 +35,13 @@ #include "d_player.h" #include "g_levellocals.h" #include "i_time.h" +#include "hwrenderer/textures/hw_material.h" #include "gl/system/gl_interface.h" #include "gl/renderer/gl_renderer.h" #include "gl/scene/gl_drawinfo.h" #include "gl/scene/gl_portal.h" #include "gl/models/gl_models.h" -#include "gl/textures/gl_material.h" #include "gl/renderer/gl_renderstate.h" #include "gl/shaders/gl_shader.h" diff --git a/src/gl/renderer/gl_renderstate.h b/src/gl/renderer/gl_renderstate.h index 8c69ff4c7..b4cdff48a 100644 --- a/src/gl/renderer/gl_renderstate.h +++ b/src/gl/renderer/gl_renderstate.h @@ -26,7 +26,7 @@ #include #include "gl/system/gl_interface.h" #include "r_data/matrix.h" -#include "gl/textures/gl_material.h" +#include "hwrenderer/textures/hw_material.h" #include "c_cvars.h" #include "r_defs.h" #include "r_data/r_translate.h" diff --git a/src/gl/scene/gl_sky.cpp b/src/gl/scene/gl_sky.cpp index c14356903..51481fc5f 100644 --- a/src/gl/scene/gl_sky.cpp +++ b/src/gl/scene/gl_sky.cpp @@ -31,7 +31,7 @@ #include "gl/renderer/gl_lightdata.h" #include "gl/scene/gl_drawinfo.h" #include "gl/scene/gl_portal.h" -#include "gl/textures/gl_material.h" +#include "hwrenderer/textures/hw_material.h" CVAR(Bool,gl_noskyboxes, false, 0) diff --git a/src/gl/scene/gl_walls.cpp b/src/gl/scene/gl_walls.cpp index 7c42202e1..611cf6b4a 100644 --- a/src/gl/scene/gl_walls.cpp +++ b/src/gl/scene/gl_walls.cpp @@ -31,6 +31,7 @@ #include "doomdata.h" #include "g_levellocals.h" #include "hwrenderer/dynlights/hw_dynlightdata.h" +#include "hwrenderer/textures/hw_material.h" #include "gl/system/gl_cvars.h" #include "gl/system/gl_interface.h" @@ -38,7 +39,6 @@ #include "gl/scene/gl_drawinfo.h" #include "gl/scene/gl_portal.h" #include "gl/scene/gl_scenedrawer.h" -#include "gl/textures/gl_material.h" #include "gl/utility/gl_clock.h" diff --git a/src/gl/textures/gl_hwtexture.cpp b/src/gl/textures/gl_hwtexture.cpp index a70354f95..5b0e07d23 100644 --- a/src/gl/textures/gl_hwtexture.cpp +++ b/src/gl/textures/gl_hwtexture.cpp @@ -29,13 +29,13 @@ #include "gl/system/gl_system.h" #include "templates.h" #include "c_cvars.h" +#include "hwrenderer/textures/hw_material.h" #include "gl/system/gl_interface.h" #include "gl/system/gl_cvars.h" #include "gl/system/gl_debug.h" #include "gl/renderer/gl_renderer.h" #include "gl/renderer/gl_colormap.h" -#include "gl/textures/gl_material.h" #include "gl/textures/gl_samplers.h" diff --git a/src/gl/textures/gl_samplers.cpp b/src/gl/textures/gl_samplers.cpp index f3169610c..d66e44261 100644 --- a/src/gl/textures/gl_samplers.cpp +++ b/src/gl/textures/gl_samplers.cpp @@ -28,7 +28,7 @@ #include "gl/system/gl_debug.h" #include "gl/renderer/gl_renderer.h" #include "gl_samplers.h" -#include "gl_material.h" +#include "hwrenderer/textures/hw_material.h" extern TexFilter_s TexFilter[]; diff --git a/src/gl/textures/gl_texture.cpp b/src/gl/textures/gl_texture.cpp index 15ba58dc0..e5e9b391f 100644 --- a/src/gl/textures/gl_texture.cpp +++ b/src/gl/textures/gl_texture.cpp @@ -32,10 +32,10 @@ #include "r_state.h" #include "actor.h" #include "textures/skyboxtexture.h" +#include "hwrenderer/textures/hw_material.h" #include "gl/system/gl_interface.h" #include "gl/renderer/gl_renderer.h" -#include "gl/textures/gl_material.h" #include "gl/textures/gl_samplers.h" #include "gl/models/gl_models.h" diff --git a/src/hwrenderer/textures/hw_ihwtexture.h b/src/hwrenderer/textures/hw_ihwtexture.h new file mode 100644 index 000000000..681d6cca6 --- /dev/null +++ b/src/hwrenderer/textures/hw_ihwtexture.h @@ -0,0 +1,31 @@ +#pragma once + +#include + +typedef TMap SpriteHits; + +class IHardwareTexture +{ +public: + enum + { + MAX_TEXTURES = 16 + }; + +public: + + +public: + IHardwareTexture() {} + virtual ~IHardwareTexture() {} + + virtual void BindToFrameBuffer(int w, int h) = 0; + virtual bool BindOrCreate(FTexture *tex, int texunit, int clampmode, int translation, int flags) = 0; + virtual void AllocateBuffer(int w, int h, int texelsize) = 0; + virtual uint8_t *MapBuffer() = 0; + virtual unsigned int CreateTexture(unsigned char * buffer, int w, int h, int texunit, bool mipmap, int translation, const char *name) = 0; + + virtual void Clean(bool all) = 0; + virtual void CleanUnused(SpriteHits &usedtranslations) = 0; +}; + diff --git a/src/gl/textures/gl_material.cpp b/src/hwrenderer/textures/hw_material.cpp similarity index 99% rename from src/gl/textures/gl_material.cpp rename to src/hwrenderer/textures/hw_material.cpp index d6446eedf..001b3d5e8 100644 --- a/src/gl/textures/gl_material.cpp +++ b/src/hwrenderer/textures/hw_material.cpp @@ -25,9 +25,8 @@ #include "sbar.h" #include "stats.h" #include "r_utility.h" -#include "hwrenderer/textures/hw_ihwtexture.h" - -#include "gl_material.h" +#include "hw_ihwtexture.h" +#include "hw_material.h" EXTERN_CVAR(Bool, gl_texture_usehires) diff --git a/src/gl/textures/gl_material.h b/src/hwrenderer/textures/hw_material.h similarity index 100% rename from src/gl/textures/gl_material.h rename to src/hwrenderer/textures/hw_material.h