mirror of https://github.com/AxioDL/boo.git
More vertex semantic adjustments
This commit is contained in:
parent
3bcfa99b5a
commit
6c83991e2a
|
@ -23,6 +23,7 @@ struct IGraphicsCommandQueue
|
|||
virtual void setShaderDataBinding(IShaderDataBinding* binding)=0;
|
||||
virtual void setRenderTarget(ITextureR* target)=0;
|
||||
virtual void setViewport(const SWindowRect& rect)=0;
|
||||
virtual void setScissor(const SWindowRect& rect)=0;
|
||||
|
||||
/**
|
||||
* @brief Which dynamic buffer slot is being populated for pending command list
|
||||
|
|
|
@ -101,10 +101,13 @@ struct IVertexFormat {};
|
|||
enum class VertexSemantic
|
||||
{
|
||||
None = 0,
|
||||
Position,
|
||||
Normal,
|
||||
Position3,
|
||||
Position4,
|
||||
Normal3,
|
||||
Normal4,
|
||||
Color,
|
||||
UV,
|
||||
ColorUNorm,
|
||||
UV2,
|
||||
UV4,
|
||||
Weight,
|
||||
ModelView,
|
||||
|
|
|
@ -554,10 +554,14 @@ static const GLint SEMANTIC_COUNT_TABLE[] =
|
|||
{
|
||||
0,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
4,
|
||||
2,
|
||||
4,
|
||||
4,
|
||||
4
|
||||
};
|
||||
|
||||
|
@ -565,10 +569,14 @@ static const size_t SEMANTIC_SIZE_TABLE[] =
|
|||
{
|
||||
0,
|
||||
12,
|
||||
16,
|
||||
12,
|
||||
16,
|
||||
16,
|
||||
4,
|
||||
8,
|
||||
16,
|
||||
16,
|
||||
16
|
||||
};
|
||||
|
||||
|
@ -577,9 +585,13 @@ static const GLenum SEMANTIC_TYPE_TABLE[] =
|
|||
GL_INVALID_ENUM,
|
||||
GL_FLOAT,
|
||||
GL_FLOAT,
|
||||
GL_FLOAT,
|
||||
GL_FLOAT,
|
||||
GL_FLOAT,
|
||||
GL_UNSIGNED_BYTE,
|
||||
GL_FLOAT,
|
||||
GL_FLOAT,
|
||||
GL_FLOAT,
|
||||
GL_FLOAT
|
||||
};
|
||||
|
||||
|
@ -596,6 +608,7 @@ struct GLCommandQueue : IGraphicsCommandQueue
|
|||
SetShaderDataBinding,
|
||||
SetRenderTarget,
|
||||
SetViewport,
|
||||
SetScissor,
|
||||
SetClearColor,
|
||||
ClearTarget,
|
||||
SetDrawPrimitive,
|
||||
|
@ -791,6 +804,16 @@ struct GLCommandQueue : IGraphicsCommandQueue
|
|||
glViewport(cmd.rect.location[0], cmd.rect.location[1],
|
||||
cmd.rect.size[0], cmd.rect.size[1]);
|
||||
break;
|
||||
case Command::Op::SetScissor:
|
||||
if (cmd.rect.size[0] == 0 && cmd.rect.size[1] == 0)
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
else
|
||||
{
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
glScissor(cmd.rect.location[0], cmd.rect.location[1],
|
||||
cmd.rect.size[0], cmd.rect.size[1]);
|
||||
}
|
||||
break;
|
||||
case Command::Op::SetClearColor:
|
||||
glClearColor(cmd.rgba[0], cmd.rgba[1], cmd.rgba[2], cmd.rgba[3]);
|
||||
break;
|
||||
|
@ -869,6 +892,13 @@ struct GLCommandQueue : IGraphicsCommandQueue
|
|||
cmds.back().rect = rect;
|
||||
}
|
||||
|
||||
void setScissor(const SWindowRect& rect)
|
||||
{
|
||||
std::vector<Command>& cmds = m_cmdBufs[m_fillBuf];
|
||||
cmds.emplace_back(Command::Op::SetScissor);
|
||||
cmds.back().rect = rect;
|
||||
}
|
||||
|
||||
int pendingDynamicSlot()
|
||||
{
|
||||
return m_fillBuf;
|
||||
|
|
|
@ -256,8 +256,8 @@ struct TestApplicationCallback : IApplicationCallback
|
|||
/* Make vertex format */
|
||||
VertexElementDescriptor descs[2] =
|
||||
{
|
||||
{vbo, nullptr, VertexSemantic::Position},
|
||||
{vbo, nullptr, VertexSemantic::UV}
|
||||
{vbo, nullptr, VertexSemantic::Position3},
|
||||
{vbo, nullptr, VertexSemantic::UV2}
|
||||
};
|
||||
IVertexFormat* vfmt = factory->newVertexFormat(2, descs);
|
||||
|
||||
|
|
Loading…
Reference in New Issue