Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/graphics/LOSTexture.h
Show All 14 Lines | |||||
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>. | * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>. | ||||
*/ | */ | ||||
#ifndef INCLUDED_LOSTEXTURE | #ifndef INCLUDED_LOSTEXTURE | ||||
#define INCLUDED_LOSTEXTURE | #define INCLUDED_LOSTEXTURE | ||||
#include "graphics/ShaderTechniquePtr.h" | #include "graphics/ShaderTechniquePtr.h" | ||||
#include "maths/Matrix3D.h" | #include "maths/Matrix3D.h" | ||||
#include "renderer/backend/Format.h" | |||||
#include "renderer/backend/IDeviceCommandContext.h" | #include "renderer/backend/IDeviceCommandContext.h" | ||||
#include "renderer/backend/IFramebuffer.h" | #include "renderer/backend/IFramebuffer.h" | ||||
#include "renderer/backend/ITexture.h" | #include "renderer/backend/ITexture.h" | ||||
#include <memory> | #include <memory> | ||||
class CLosQuerier; | class CLosQuerier; | ||||
class CSimulation2; | class CSimulation2; | ||||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | private: | ||||
void GenerateBitmap(const CLosQuerier& los, u8* losData, size_t w, size_t h, size_t pitch); | void GenerateBitmap(const CLosQuerier& los, u8* losData, size_t w, size_t h, size_t pitch); | ||||
CSimulation2& m_Simulation; | CSimulation2& m_Simulation; | ||||
bool m_Dirty = true; | bool m_Dirty = true; | ||||
bool m_ShaderInitialized = false; | bool m_ShaderInitialized = false; | ||||
// We need to choose the smallest format. We always use the red channel but | |||||
// R8_UNORM might be unavailable on some platforms. So we fallback to | |||||
// R8G8B8A8_UNORM. | |||||
Renderer::Backend::Format m_TextureFormat = | |||||
Renderer::Backend::Format::UNDEFINED; | |||||
size_t m_TextureFormatStride = 0; | |||||
std::unique_ptr<Renderer::Backend::ITexture> | std::unique_ptr<Renderer::Backend::ITexture> | ||||
m_Texture, m_SmoothTextures[2]; | m_Texture, m_SmoothTextures[2]; | ||||
uint32_t m_WhichTexture = 0; | uint32_t m_WhichTexture = 0; | ||||
// We update textures once a frame, so we change a Framebuffer once a frame. | // We update textures once a frame, so we change a Framebuffer once a frame. | ||||
// That allows us to use two ping-pong FBOs instead of checking completeness | // That allows us to use two ping-pong FBOs instead of checking completeness | ||||
// of Framebuffer each frame. | // of Framebuffer each frame. | ||||
Show All 11 Lines |
Wildfire Games · Phabricator