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::CMatrix4f m_mv;
zeus::CVector3f m_uv[4]; zeus::CVector3f m_uv[4];
zeus::CColor m_color; 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); 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); buildResources(ctx, res);
m_splitMenuSystem.emplace(*this, ctx); 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; return true;
}); });
resized(rect, rect); resized(rect, rect);

View File

@ -77,12 +77,12 @@ void TextView::Resources::init(boo::GLDataFactory::Context& ctx, FontCache* fcac
m_regular = m_regular =
ctx.newShaderPipeline(GLSLVS, GLSLFSReg, 1, TexNames, 1, BlockNames, ctx.newShaderPipeline(GLSLVS, GLSLFSReg, 1, TexNames, 1, BlockNames,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, 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 = m_subpixel =
ctx.newShaderPipeline(GLSLVS, GLSLFSSubpixel, 1, TexNames, 1, BlockNames, ctx.newShaderPipeline(GLSLVS, GLSLFSSubpixel, 1, TexNames, 1, BlockNames,
boo::BlendFactor::SrcColor1, boo::BlendFactor::InvSrcColor1, 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 #if _WIN32
@ -174,12 +174,12 @@ void TextView::Resources::init(boo::ID3DDataFactory::Context& ctx, FontCache* fc
m_regular = m_regular =
ctx.newShaderPipeline(VS, FSReg, nullptr, nullptr, nullptr, m_vtxFmt, ctx.newShaderPipeline(VS, FSReg, nullptr, nullptr, nullptr, m_vtxFmt,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, 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 = m_subpixel =
ctx.newShaderPipeline(VS, FSSubpixel, nullptr, nullptr, nullptr, m_vtxFmt, ctx.newShaderPipeline(VS, FSSubpixel, nullptr, nullptr, nullptr, m_vtxFmt,
boo::BlendFactor::SrcColor1, boo::BlendFactor::InvSrcColor1, 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 #endif
@ -256,7 +256,7 @@ void TextView::Resources::init(boo::MetalDataFactory::Context& ctx, FontCache* f
m_regular = m_regular =
ctx.newShaderPipeline(VS, FSReg, m_vtxFmt, 1, ctx.newShaderPipeline(VS, FSReg, m_vtxFmt, 1,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, 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 #endif
@ -287,7 +287,7 @@ void TextView::Resources::init(boo::VulkanDataFactory::Context& ctx, FontCache*
m_regular = m_regular =
ctx.newShaderPipeline(GLSLVS, GLSLFSReg, m_vtxFmt, ctx.newShaderPipeline(GLSLVS, GLSLFSReg, m_vtxFmt,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, 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 #endif
@ -338,14 +338,14 @@ void TextView::_commitResources(size_t capacity)
m_shaderBinding = ctx.newShaderDataBinding(shader, m_vtxFmt, m_shaderBinding = ctx.newShaderDataBinding(shader, m_vtxFmt,
nullptr, vBufInfo.first, nullptr, 1, nullptr, vBufInfo.first, nullptr, 1,
uBufs, nullptr, uBufOffs, uBufSizes, uBufs, nullptr, uBufOffs, uBufSizes,
1, texs, 0, vBufInfo.second); 1, texs, nullptr, nullptr, 0, vBufInfo.second);
} }
else else
{ {
m_shaderBinding = ctx.newShaderDataBinding(shader, res.m_textRes.m_vtxFmt, m_shaderBinding = ctx.newShaderDataBinding(shader, res.m_textRes.m_vtxFmt,
nullptr, vBufInfo.first, nullptr, 1, nullptr, vBufInfo.first, nullptr, 1,
uBufs, nullptr, uBufOffs, uBufSizes, uBufs, nullptr, uBufOffs, uBufSizes,
1, texs, 0, vBufInfo.second); 1, texs, nullptr, nullptr, 0, vBufInfo.second);
} }
} }
return true; 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, m_solidShader = ctx.newShaderPipeline(GLSLSolidVS, GLSLSolidFS, 0, nullptr, 1, BlockNames,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, 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, m_texShader = ctx.newShaderPipeline(GLSLTexVS, GLSLTexFS, 1, TexNames, 1, BlockNames,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, 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 #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, m_solidShader = ctx.newShaderPipeline(SolidVS, SolidFS, m_solidVtxFmt, 1,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, 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[] = 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, m_texShader = ctx.newShaderPipeline(TexVS, TexFS, m_texVtxFmt, 1,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, 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 #endif
@ -402,7 +404,7 @@ void View::VertexBufferBindingSolid::init(boo::IGraphicsDataFactory::Context& ct
m_shaderBinding = ctx.newShaderDataBinding(res.m_viewRes.m_solidShader, m_shaderBinding = ctx.newShaderDataBinding(res.m_viewRes.m_solidShader,
m_vtxFmt, vBufInfo.first, nullptr, m_vtxFmt, vBufInfo.first, nullptr,
nullptr, 1, bufs, nullptr, bufOffs, nullptr, 1, bufs, nullptr, bufOffs,
bufSizes, 0, nullptr, vBufInfo.second); bufSizes, 0, nullptr, nullptr, nullptr, vBufInfo.second);
} }
else else
{ {
@ -410,7 +412,7 @@ void View::VertexBufferBindingSolid::init(boo::IGraphicsDataFactory::Context& ct
res.m_viewRes.m_solidVtxFmt, res.m_viewRes.m_solidVtxFmt,
vBufInfo.first, nullptr, vBufInfo.first, nullptr,
nullptr, 1, bufs, nullptr, bufOffs, 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_shaderBinding = ctx.newShaderDataBinding(res.m_viewRes.m_texShader,
m_vtxFmt, vBufInfo.first, nullptr, m_vtxFmt, vBufInfo.first, nullptr,
nullptr, 1, bufs, nullptr, bufOffs, nullptr, 1, bufs, nullptr, bufOffs,
bufSizes, 1, tex, vBufInfo.second); bufSizes, 1, tex, nullptr, nullptr, vBufInfo.second);
} }
else else
{ {
@ -447,7 +449,7 @@ void View::VertexBufferBindingTex::init(boo::IGraphicsDataFactory::Context& ctx,
res.m_viewRes.m_texVtxFmt, res.m_viewRes.m_texVtxFmt,
vBufInfo.first, nullptr, vBufInfo.first, nullptr,
nullptr, 1, bufs, nullptr, bufOffs, 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