mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-29 07:22:07 +00:00
- use model vertex buffer to render voxels.
This commit is contained in:
parent
f710518903
commit
5ee626459d
1 changed files with 3 additions and 9 deletions
|
@ -305,7 +305,7 @@ void FVoxelModel::AddFace(int x1, int y1, int z1, int x2, int y2, int z2, int x3
|
|||
|
||||
mIndices.Push(indx[0]);
|
||||
mIndices.Push(indx[1]);
|
||||
mIndices.Push(indx[2]);
|
||||
mIndices.Push(indx[3]);
|
||||
mIndices.Push(indx[1]);
|
||||
mIndices.Push(indx[3]);
|
||||
mIndices.Push(indx[2]);
|
||||
|
@ -420,13 +420,7 @@ void FVoxelModel::RenderFrame(FTexture * skin, int frame, int frame2, double int
|
|||
tex->Bind(0, translation);
|
||||
|
||||
gl_RenderState.Apply();
|
||||
glBegin(GL_TRIANGLES);
|
||||
for (unsigned i = 0; i < mIndices.Size(); i++)
|
||||
{
|
||||
FModelVertex *vert = &mVertices[mIndices[i]];
|
||||
glTexCoord2fv(&vert->u);
|
||||
glVertex3fv(&vert->x);
|
||||
}
|
||||
glEnd();
|
||||
GLRenderer->mModelVBO->SetupFrame(vindex, vindex, 0.f);
|
||||
glDrawElements(GL_TRIANGLES, mIndices.Size(), GL_UNSIGNED_INT, (void*)(intptr_t)(iindex * sizeof(unsigned int)));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue