mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-14 06:46:09 +00:00
Changes to support boo object tracker API
This commit is contained in:
@@ -88,15 +88,19 @@ BOO_GLSL_BINDING_HEAD
|
||||
|
||||
struct OGLLineDataBindingFactory : CLineRendererShaders::IDataBindingFactory
|
||||
{
|
||||
void BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx, CLineRenderer& renderer,
|
||||
boo::IShaderPipeline* pipeline, boo::ITexture* texture)
|
||||
void BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
|
||||
CLineRenderer& renderer,
|
||||
const boo::ObjToken<boo::IShaderPipeline>& pipeline,
|
||||
const boo::ObjToken<boo::ITexture>& texture)
|
||||
{
|
||||
boo::IVertexFormat* vtxFmt = nullptr;
|
||||
boo::ObjToken<boo::IVertexFormat> vtxFmt;
|
||||
int texCount = 0;
|
||||
boo::ITexture* textures[1];
|
||||
boo::ObjToken<boo::ITexture> textures[1];
|
||||
|
||||
std::pair<boo::IGraphicsBufferD*, hecl::VertexBufferPool<CLineRenderer::SDrawVertTex>::IndexTp> vbufInfo;
|
||||
std::pair<boo::IGraphicsBufferD*, hecl::UniformBufferPool<CLineRenderer::SDrawUniform>::IndexTp> ubufInfo =
|
||||
std::pair<boo::ObjToken<boo::IGraphicsBufferD>,
|
||||
hecl::VertexBufferPool<CLineRenderer::SDrawVertTex>::IndexTp> vbufInfo;
|
||||
std::pair<boo::ObjToken<boo::IGraphicsBufferD>,
|
||||
hecl::UniformBufferPool<CLineRenderer::SDrawUniform>::IndexTp> ubufInfo =
|
||||
renderer.m_uniformBuf.getBufferInfo();
|
||||
if (texture)
|
||||
{
|
||||
@@ -105,9 +109,9 @@ struct OGLLineDataBindingFactory : CLineRendererShaders::IDataBindingFactory
|
||||
texCount = 1;
|
||||
const boo::VertexElementDescriptor TexFmtTex[] =
|
||||
{
|
||||
{vbufInfo.first, nullptr, boo::VertexSemantic::Position4},
|
||||
{vbufInfo.first, nullptr, boo::VertexSemantic::Color},
|
||||
{vbufInfo.first, nullptr, boo::VertexSemantic::UV4}
|
||||
{vbufInfo.first.get(), nullptr, boo::VertexSemantic::Position4},
|
||||
{vbufInfo.first.get(), nullptr, boo::VertexSemantic::Color},
|
||||
{vbufInfo.first.get(), nullptr, boo::VertexSemantic::UV4}
|
||||
};
|
||||
vtxFmt = ctx.newVertexFormat(3, TexFmtTex);
|
||||
}
|
||||
@@ -116,18 +120,18 @@ struct OGLLineDataBindingFactory : CLineRendererShaders::IDataBindingFactory
|
||||
vbufInfo = renderer.m_vertBufNoTex.getBufferInfo();
|
||||
const boo::VertexElementDescriptor TexFmtNoTex[] =
|
||||
{
|
||||
{vbufInfo.first, nullptr, boo::VertexSemantic::Position4},
|
||||
{vbufInfo.first, nullptr, boo::VertexSemantic::Color}
|
||||
{vbufInfo.first.get(), nullptr, boo::VertexSemantic::Position4},
|
||||
{vbufInfo.first.get(), nullptr, boo::VertexSemantic::Color}
|
||||
};
|
||||
vtxFmt = ctx.newVertexFormat(2, TexFmtNoTex);
|
||||
}
|
||||
|
||||
boo::IGraphicsBuffer* uniforms[] = {ubufInfo.first};
|
||||
boo::ObjToken<boo::IGraphicsBuffer> uniforms[] = {ubufInfo.first.get()};
|
||||
boo::PipelineStage stages[] = {boo::PipelineStage::Vertex};
|
||||
size_t ubufOffs[] = {size_t(ubufInfo.second)};
|
||||
size_t ubufSizes[] = {sizeof(CLineRenderer::SDrawUniform)};
|
||||
|
||||
renderer.m_shaderBind = ctx.newShaderDataBinding(pipeline, vtxFmt, vbufInfo.first,
|
||||
renderer.m_shaderBind = ctx.newShaderDataBinding(pipeline, vtxFmt, vbufInfo.first.get(),
|
||||
nullptr, nullptr, 1, uniforms, stages,
|
||||
ubufOffs, ubufSizes, texCount, textures,
|
||||
nullptr, nullptr, vbufInfo.second);
|
||||
|
||||
Reference in New Issue
Block a user