mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 05:13:58 +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:
51
drape/gl_gpu_program.hpp
Normal file
51
drape/gl_gpu_program.hpp
Normal file
@@ -0,0 +1,51 @@
|
||||
#pragma once
|
||||
|
||||
#include "drape/gl_constants.hpp"
|
||||
#include "drape/gpu_program.hpp"
|
||||
#include "drape/pointers.hpp"
|
||||
#include "drape/shader.hpp"
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace dp
|
||||
{
|
||||
class GLGpuProgram : public GpuProgram
|
||||
{
|
||||
public:
|
||||
GLGpuProgram(std::string const & programName,
|
||||
ref_ptr<Shader> vertexShader, ref_ptr<Shader> fragmentShader);
|
||||
~GLGpuProgram() override;
|
||||
|
||||
void Bind() override;
|
||||
void Unbind() override;
|
||||
|
||||
int8_t GetAttributeLocation(std::string const & attributeName) const;
|
||||
int8_t GetUniformLocation(std::string const & uniformName) const;
|
||||
glConst GetUniformType(std::string const & uniformName) const;
|
||||
|
||||
struct UniformInfo
|
||||
{
|
||||
int8_t m_location = -1;
|
||||
glConst m_type = gl_const::GLFloatType;
|
||||
};
|
||||
|
||||
using UniformsInfo = std::map<std::string, UniformInfo>;
|
||||
UniformsInfo const & GetUniformsInfo() const;
|
||||
uint32_t GetNumericUniformsCount() const { return m_numericUniformsCount; }
|
||||
|
||||
private:
|
||||
void LoadUniformLocations();
|
||||
uint32_t CalculateNumericUniformsCount() const;
|
||||
|
||||
uint32_t m_programID;
|
||||
|
||||
ref_ptr<Shader> m_vertexShader;
|
||||
ref_ptr<Shader> m_fragmentShader;
|
||||
|
||||
UniformsInfo m_uniforms;
|
||||
uint8_t m_textureSlotsCount = 0;
|
||||
uint32_t m_numericUniformsCount = 0;
|
||||
};
|
||||
} // namespace dp
|
||||
Reference in New Issue
Block a user