2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 02:27:43 +00:00

Work on CBabygoth

This commit is contained in:
Jack Andersen
2019-06-29 21:29:49 -10:00
parent d1e97dd821
commit 003146f614
12 changed files with 723 additions and 360 deletions

View File

@@ -264,13 +264,23 @@ void CNESEmulator::InitializeEmulator() {
// Nearest-neighbor FTW!
m_texture = ctx.newDynamicTexture(VISIBLE_DOTS, linesToDraw, boo::TextureFormat::RGBA8,
boo::TextureClampMode::ClampToEdgeNearest);
Vert verts[4] = {
{{-1.f, -1.f, 0.f}, {0.f, 1.f}},
{{-1.f, 1.f, 0.f}, {0.f, 0.f}},
{{1.f, -1.f, 0.f}, {1.f, 1.f}},
{{1.f, 1.f, 0.f}, {1.f, 0.f}},
};
m_vbo = ctx.newStaticBuffer(boo::BufferUse::Vertex, verts, sizeof(Vert), 4);
if (ctx.platform() == boo::IGraphicsDataFactory::Platform::OpenGL) {
Vert verts[4] = {
{{-1.f, -1.f, 0.f}, {0.f, 1.f}},
{{-1.f, 1.f, 0.f}, {0.f, 0.f}},
{{1.f, -1.f, 0.f}, {1.f, 1.f}},
{{1.f, 1.f, 0.f}, {1.f, 0.f}},
};
m_vbo = ctx.newStaticBuffer(boo::BufferUse::Vertex, verts, sizeof(Vert), 4);
} else {
Vert verts[4] = {
{{-1.f, 1.f, 0.f}, {0.f, 1.f}},
{{-1.f, -1.f, 0.f}, {0.f, 0.f}},
{{1.f, 1.f, 0.f}, {1.f, 1.f}},
{{1.f, -1.f, 0.f}, {1.f, 0.f}},
};
m_vbo = ctx.newStaticBuffer(boo::BufferUse::Vertex, verts, sizeof(Vert), 4);
}
m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(Uniform), 1);
m_shadBind = CNESShader::BuildShaderDataBinding(ctx, m_vbo, m_uniBuf, m_texture);
return true;