Fix potential crash in galaxy rendering

pull/862/head
Levin Li 2020-10-23 14:38:19 +08:00
parent 8fe5f876a3
commit 8129589490
1 changed files with 2 additions and 2 deletions

View File

@ -299,10 +299,10 @@ static void draw(const GalaxyVertex *v, size_t count, const GLushort *indices)
{
glVertexAttribPointer(CelestiaGLProgram::VertexCoordAttributeIndex,
4, GL_FLOAT, GL_FALSE,
sizeof(GalaxyVertex), &v->position);
sizeof(GalaxyVertex), v->position.data());
glVertexAttribPointer(CelestiaGLProgram::TextureCoord0AttributeIndex,
4, GL_SHORT, GL_FALSE,
sizeof(GalaxyVertex), &v->texCoord);
sizeof(GalaxyVertex), v->texCoord.data());
glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, indices);
}