Selaa lähdekoodia

gpu: remove some crap from vertexbuffer.cpp and allow for

empty vertex declarations even though many video card
drivers do not support them — and they should.
legacy
Sam Hocevar sam 12 vuotta sitten
vanhempi
commit
7658744c44
2 muutettua tiedostoa jossa 3 lisäystä ja 21 poistoa
  1. +2
    -20
      src/gpu/vertexbuffer.cpp
  2. +1
    -1
      src/gpu/vertexbuffer.h

+ 2
- 20
src/gpu/vertexbuffer.cpp Näytä tiedosto

@@ -156,13 +156,9 @@ void VertexDeclaration::DrawElements(MeshPrimitive type, int skip, int count)
break;
}
#else
/* FIXME: this has nothing to do here! */
glFrontFace(GL_CCW);
glEnable(GL_CULL_FACE);
# if defined HAVE_GL_2X && !defined __APPLE__
/* FIXME: this has nothing to do here! */
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GEQUAL, 0.01f);
# endif
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

@@ -181,10 +177,6 @@ void VertexDeclaration::DrawElements(MeshPrimitive type, int skip, int count)
glDrawArrays(GL_POINTS, skip, count);
break;
}
# if defined HAVE_GL_2X && !defined __APPLE__
/* FIXME: this has nothing to do here! */
glDisable(GL_ALPHA_TEST);
# endif
#endif
}

@@ -228,13 +220,9 @@ void VertexDeclaration::DrawIndexedElements(MeshPrimitive type, int vbase,
break;
}
#else
/* FIXME: this has nothing to do here! */
glFrontFace(GL_CCW);
glEnable(GL_CULL_FACE);
# if defined HAVE_GL_2X && !defined __APPLE__
/* FIXME: this has nothing to do here! */
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GEQUAL, 0.01f);
# endif
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

@@ -261,10 +249,6 @@ void VertexDeclaration::DrawIndexedElements(MeshPrimitive type, int vbase,
glDrawElements(GL_POINTS, count, GL_UNSIGNED_SHORT, 0);
break;
}
# if defined HAVE_GL_2X && !defined __APPLE__
/* FIXME: this has nothing to do here! */
glDisable(GL_ALPHA_TEST);
# endif
#endif
}

@@ -294,8 +278,6 @@ void VertexDeclaration::Unbind()
}
}
glBindBuffer(GL_ARRAY_BUFFER, 0);
/* FIXME: only useful for VAOs? */
//glBindBuffer(GL_ARRAY_BUFFER, 0);
#else
/* Or even: */
glDisableClientState(GL_VERTEX_ARRAY);


+ 1
- 1
src/gpu/vertexbuffer.h Näytä tiedosto

@@ -171,7 +171,7 @@ public:
class VertexDeclaration
{
public:
VertexDeclaration(VertexStreamBase const &s1,
VertexDeclaration(VertexStreamBase const &s1 = VertexStreamBase::Empty,
VertexStreamBase const &s2 = VertexStreamBase::Empty,
VertexStreamBase const &s3 = VertexStreamBase::Empty,
VertexStreamBase const &s4 = VertexStreamBase::Empty,


Ladataan…
Peruuta
Tallenna