39 lines
1004 B
C++

// Copyright (c) 2023 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "UIShader.hpp"
#include "util/macro.hpp"
#define FONT_SHADER_PARTS_MAX 8
#define FONT_SHADER_QUADS_MAX 1024
#define FONT_SHADER_TEXTURE_MAX 4
namespace Dawn {
#pragma pack(push, 4)
struct FontShaderBufferData {
int32_t fontQuadMappings[FONT_SHADER_QUADS_MAX];
int32_t textures[FONT_SHADER_PARTS_MAX];
struct Color colors[FONT_SHADER_PARTS_MAX];
};
#pragma pack(pop)
class FontShaderBuffer : public ShaderParameterBuffer<struct FontShaderBufferData> {
};
class FontShader : public Shader {
public:
shaderparameter_t paramModel;
shaderparameter_t paramTexture0;
shaderparameter_t paramTexture1;
shaderparameter_t paramTexture2;
shaderparameter_t paramTexture3;
shaderbufferlocation_t bufferUiCanvas;
shaderbufferlocation_t bufferFont;
void compile() override;
};
}