Refactor for latest boo upgrades

This commit is contained in:
Jack Andersen 2017-03-13 21:02:24 -10:00
parent 14bcbba1de
commit 967ae18b79
5 changed files with 36 additions and 18 deletions

View File

@ -28,6 +28,22 @@ public:
zeus::CMatrix4f m_mv;
zeus::CVector3f m_uv[4];
zeus::CColor m_color;
char _dummy[48];
RenderGlyph& operator=(const RenderGlyph& other)
{
m_pos[0] = other.m_pos[0];
m_pos[1] = other.m_pos[1];
m_pos[2] = other.m_pos[2];
m_pos[3] = other.m_pos[3];
m_mv = other.m_mv;
m_uv[0] = other.m_uv[0];
m_uv[1] = other.m_uv[1];
m_uv[2] = other.m_uv[2];
m_uv[3] = other.m_uv[3];
m_color = other.m_color;
return *this;
}
RenderGlyph(int& adv, const FontAtlas::Glyph& glyph, const zeus::CColor& defaultColor);
};

View File

@ -16,7 +16,7 @@ RootView::RootView(IViewManager& viewMan, ViewResources& res, boo::IWindow* wind
{
buildResources(ctx, res);
m_splitMenuSystem.emplace(*this, ctx);
m_renderTex = ctx.newRenderTexture(rect.size[0], rect.size[1], true, false);
m_renderTex = ctx.newRenderTexture(rect.size[0], rect.size[1], 1, 2);
return true;
});
resized(rect, rect);

View File

@ -77,12 +77,12 @@ void TextView::Resources::init(boo::GLDataFactory::Context& ctx, FontCache* fcac
m_regular =
ctx.newShaderPipeline(GLSLVS, GLSLFSReg, 1, TexNames, 1, BlockNames,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
boo::Primitive::TriStrips, false, false, boo::CullMode::None);
boo::Primitive::TriStrips, boo::ZTest::None, false, true, false, boo::CullMode::None);
m_subpixel =
ctx.newShaderPipeline(GLSLVS, GLSLFSSubpixel, 1, TexNames, 1, BlockNames,
boo::BlendFactor::SrcColor1, boo::BlendFactor::InvSrcColor1,
boo::Primitive::TriStrips, false, false, boo::CullMode::None);
boo::Primitive::TriStrips, boo::ZTest::None, false, true, false, boo::CullMode::None);
}
#if _WIN32
@ -174,12 +174,12 @@ void TextView::Resources::init(boo::ID3DDataFactory::Context& ctx, FontCache* fc
m_regular =
ctx.newShaderPipeline(VS, FSReg, nullptr, nullptr, nullptr, m_vtxFmt,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
boo::Primitive::TriStrips, false, false, boo::CullMode::None);
boo::Primitive::TriStrips, boo::ZTest::None, false, boo::CullMode::None);
m_subpixel =
ctx.newShaderPipeline(VS, FSSubpixel, nullptr, nullptr, nullptr, m_vtxFmt,
boo::BlendFactor::SrcColor1, boo::BlendFactor::InvSrcColor1,
boo::Primitive::TriStrips, false, false, boo::CullMode::None);
boo::Primitive::TriStrips, boo::ZTest::None, false, boo::CullMode::None);
}
#endif
@ -256,7 +256,7 @@ void TextView::Resources::init(boo::MetalDataFactory::Context& ctx, FontCache* f
m_regular =
ctx.newShaderPipeline(VS, FSReg, m_vtxFmt, 1,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
boo::Primitive::TriStrips, false, false, boo::CullMode::None);
boo::Primitive::TriStrips, boo::ZTest::None, false, true, true, boo::CullMode::None);
}
#endif
@ -287,7 +287,7 @@ void TextView::Resources::init(boo::VulkanDataFactory::Context& ctx, FontCache*
m_regular =
ctx.newShaderPipeline(GLSLVS, GLSLFSReg, m_vtxFmt,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
boo::Primitive::TriStrips, false, false, boo::CullMode::None);
boo::Primitive::TriStrips, boo::ZTest::None, false, boo::CullMode::None);
}
#endif
@ -338,14 +338,14 @@ void TextView::_commitResources(size_t capacity)
m_shaderBinding = ctx.newShaderDataBinding(shader, m_vtxFmt,
nullptr, vBufInfo.first, nullptr, 1,
uBufs, nullptr, uBufOffs, uBufSizes,
1, texs, 0, vBufInfo.second);
1, texs, nullptr, nullptr, 0, vBufInfo.second);
}
else
{
m_shaderBinding = ctx.newShaderDataBinding(shader, res.m_textRes.m_vtxFmt,
nullptr, vBufInfo.first, nullptr, 1,
uBufs, nullptr, uBufOffs, uBufSizes,
1, texs, 0, vBufInfo.second);
1, texs, nullptr, nullptr, 0, vBufInfo.second);
}
}
return true;

View File

@ -81,11 +81,13 @@ void View::Resources::init(boo::GLDataFactory::Context& ctx, const IThemeData& t
{
m_solidShader = ctx.newShaderPipeline(GLSLSolidVS, GLSLSolidFS, 0, nullptr, 1, BlockNames,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
boo::Primitive::TriStrips, false, false, boo::CullMode::None);
boo::Primitive::TriStrips, boo::ZTest::None, false, true, false,
boo::CullMode::None);
m_texShader = ctx.newShaderPipeline(GLSLTexVS, GLSLTexFS, 1, TexNames, 1, BlockNames,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
boo::Primitive::TriStrips, false, false, boo::CullMode::None);
boo::Primitive::TriStrips, boo::ZTest::None, false, true, false,
boo::CullMode::None);
}
#if _WIN32
@ -270,7 +272,7 @@ void View::Resources::init(boo::MetalDataFactory::Context& ctx, const IThemeData
m_solidShader = ctx.newShaderPipeline(SolidVS, SolidFS, m_solidVtxFmt, 1,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
boo::Primitive::TriStrips, false, false, boo::CullMode::None);
boo::Primitive::TriStrips, boo::ZTest::None, false, true, true, boo::CullMode::None);
boo::VertexElementDescriptor texvdescs[] =
{
@ -281,7 +283,7 @@ void View::Resources::init(boo::MetalDataFactory::Context& ctx, const IThemeData
m_texShader = ctx.newShaderPipeline(TexVS, TexFS, m_texVtxFmt, 1,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
boo::Primitive::TriStrips, false, false, boo::CullMode::None);
boo::Primitive::TriStrips, boo::ZTest::None, false, true, true, boo::CullMode::None);
}
#endif
@ -402,7 +404,7 @@ void View::VertexBufferBindingSolid::init(boo::IGraphicsDataFactory::Context& ct
m_shaderBinding = ctx.newShaderDataBinding(res.m_viewRes.m_solidShader,
m_vtxFmt, vBufInfo.first, nullptr,
nullptr, 1, bufs, nullptr, bufOffs,
bufSizes, 0, nullptr, vBufInfo.second);
bufSizes, 0, nullptr, nullptr, nullptr, vBufInfo.second);
}
else
{
@ -410,7 +412,7 @@ void View::VertexBufferBindingSolid::init(boo::IGraphicsDataFactory::Context& ct
res.m_viewRes.m_solidVtxFmt,
vBufInfo.first, nullptr,
nullptr, 1, bufs, nullptr, bufOffs,
bufSizes, 0, nullptr, vBufInfo.second);
bufSizes, 0, nullptr, nullptr, nullptr, vBufInfo.second);
}
}
@ -439,7 +441,7 @@ void View::VertexBufferBindingTex::init(boo::IGraphicsDataFactory::Context& ctx,
m_shaderBinding = ctx.newShaderDataBinding(res.m_viewRes.m_texShader,
m_vtxFmt, vBufInfo.first, nullptr,
nullptr, 1, bufs, nullptr, bufOffs,
bufSizes, 1, tex, vBufInfo.second);
bufSizes, 1, tex, nullptr, nullptr, vBufInfo.second);
}
else
{
@ -447,7 +449,7 @@ void View::VertexBufferBindingTex::init(boo::IGraphicsDataFactory::Context& ctx,
res.m_viewRes.m_texVtxFmt,
vBufInfo.first, nullptr,
nullptr, 1, bufs, nullptr, bufOffs,
bufSizes, 1, tex, vBufInfo.second);
bufSizes, 1, tex, nullptr, nullptr, vBufInfo.second);
}
}

@ -1 +1 @@
Subproject commit 5e008737e0a5bfaa84ddf422e2feb5ac3b2537e2
Subproject commit f1e3db1c504ccdc7fc5ab62d9b64e1ff6692087a