GL3: Implement mapTextureStageToUV

--HG--
branch : opengl3
hg/feature/opengl3
kaetemi 11 years ago
parent 09db5b352c
commit 5a4dd538f1

@ -436,7 +436,7 @@ public:
virtual bool activeIndexBuffer(CIndexBuffer& IB); virtual bool activeIndexBuffer(CIndexBuffer& IB);
virtual void mapTextureStageToUV(uint stage, uint uv) {} virtual void mapTextureStageToUV(uint stage, uint uv);
virtual bool renderLines(CMaterial& mat, uint32 firstIndex, uint32 nlines); virtual bool renderLines(CMaterial& mat, uint32 firstIndex, uint32 nlines);
virtual bool renderTriangles(CMaterial& Mat, uint32 firstIndex, uint32 ntris); virtual bool renderTriangles(CMaterial& Mat, uint32 firstIndex, uint32 ntris);

@ -415,6 +415,21 @@ void CDriverGL3::setupGlArrays(CVertexBufferInfo &vb)
} }
} }
// ***************************************************************************
void CDriverGL3::mapTextureStageToUV(uint stage, uint uvId)
{
H_AUTO_OGL(CDriverGL3_mapTextureStageToUV)
// Just call it for last VertexBuffer setuped... (hack)
CVertexBufferInfo &VB = _LastVB;
if (VB.VertexFormat & (CVertexBuffer::TexCoord0Flag<<uvId))
{
CVertexBuffer::TType uvType = VB.Type[CVertexBuffer::TexCoord0 + uvId];
nglVertexAttribPointer(GLVertexAttribIndex[CVertexBuffer::TexCoord0 + stage], NumCoordinatesType[uvType], GLType[uvType],
false, VB.VertexSize, VB.ValuePtr[CVertexBuffer::TexCoord0 + uvId]);
}
}
// *************************************************************************** // ***************************************************************************
void CVertexBufferInfo::setupVertexBuffer(CVertexBuffer &vb) void CVertexBufferInfo::setupVertexBuffer(CVertexBuffer &vb)

Loading…
Cancel
Save