mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-21 13:53:37 +00:00
Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run: git remote add om-historic [om-historic.git repo url] git fetch --tags om-historic git replace squashed-history historic-commits
This commit is contained in:
33
drape_frontend/screen_quad_renderer.hpp
Normal file
33
drape_frontend/screen_quad_renderer.hpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#pragma once
|
||||
|
||||
#include "drape/mesh_object.hpp"
|
||||
|
||||
#include "geometry/rect2d.hpp"
|
||||
|
||||
namespace gpu
|
||||
{
|
||||
class ProgramManager;
|
||||
} // namespace gpu
|
||||
|
||||
namespace df
|
||||
{
|
||||
class ScreenQuadRenderer : public dp::MeshObject
|
||||
{
|
||||
using Base = dp::MeshObject;
|
||||
public:
|
||||
explicit ScreenQuadRenderer(ref_ptr<dp::GraphicsContext> context);
|
||||
|
||||
void SetTextureRect(ref_ptr<dp::GraphicsContext> context, m2::RectF const & rect);
|
||||
m2::RectF const & GetTextureRect() const { return m_textureRect; }
|
||||
|
||||
// The parameter invertV is necessary, since there are some APIs (e.g. Metal) there render target
|
||||
// coordinates system is inverted by V axis.
|
||||
void RenderTexture(ref_ptr<dp::GraphicsContext> context, ref_ptr<gpu::ProgramManager> mng,
|
||||
ref_ptr<dp::Texture> texture, float opacity, bool invertV = true);
|
||||
|
||||
private:
|
||||
void Rebuild(ref_ptr<dp::GraphicsContext> context);
|
||||
|
||||
m2::RectF m_textureRect = m2::RectF(0.0f, 0.0f, 1.0f, 1.0f);
|
||||
};
|
||||
} // namespace df
|
||||
Reference in New Issue
Block a user