Explorar el Código

gpu: activate backface culling on OpenGL to remain consistent with

the Direct3D backend.
legacy
Sam Hocevar sam hace 12 años
padre
commit
d452194326
Se han modificado 3 ficheros con 15 adiciones y 13 borrados
  1. +2
    -0
      src/gpu/vertexbuffer.cpp
  2. +1
    -1
      src/gradient.cpp
  3. +12
    -12
      src/tileset.cpp

+ 2
- 0
src/gpu/vertexbuffer.cpp Ver fichero

@@ -136,6 +136,8 @@ void VertexDeclaration::DrawElements(MeshPrimitive type, int skip, int count)
break;
}
#else
glFrontFace(GL_CCW);
glEnable(GL_CULL_FACE);
# if defined HAVE_GL_2X && !defined __APPLE__
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GEQUAL, 0.01f);


+ 1
- 1
src/gradient.cpp Ver fichero

@@ -63,8 +63,8 @@ void Gradient::TickDraw(float seconds)
float const vertex[] = { 0.0f, 0.0f, 0.0f,
640.0f, 0.0f, 0.0f,
0.0f, 480.0f, 0.0f,
0.0f, 480.0f, 0.0f,
640.0f, 480.0f, 0.0f,
0.0f, 480.0f, 0.0f,
640.0f, 0.0f, 0.0f, };

float const color[] = { 0.73f, 0.85f, 0.85f, 1.0f,


+ 12
- 12
src/tileset.cpp Ver fichero

@@ -278,36 +278,36 @@ void TileSet::BlitTile(uint32_t id, vec3 pos, int o, vec2 scale,
{
float tmp[10];

*vertex++ = tmp[0] = pos.x;
*vertex++ = tmp[1] = pos.y + dy;
*vertex++ = tmp[2] = pos.z + dz;
*texture++ = tmp[3] = tx;
*texture++ = tmp[4] = ty;

*vertex++ = pos.x + dx;
*vertex++ = pos.y + dy;
*vertex++ = pos.z + dz;
*texture++ = tx + data->tx;
*texture++ = ty;

*vertex++ = tmp[0] = pos.x;
*vertex++ = tmp[1] = pos.y + dy;
*vertex++ = tmp[2] = pos.z + dz;
*texture++ = tmp[3] = tx;
*texture++ = tmp[4] = ty;

*vertex++ = tmp[5] = pos.x + dx;
*vertex++ = tmp[6] = pos.y;
*vertex++ = tmp[7] = pos.z;
*texture++ = tmp[8] = tx + data->tx;
*texture++ = tmp[9] = ty + data->ty;

*vertex++ = tmp[0];
*vertex++ = tmp[1];
*vertex++ = tmp[2];
*texture++ = tmp[3];
*texture++ = tmp[4];

*vertex++ = tmp[5];
*vertex++ = tmp[6];
*vertex++ = tmp[7];
*texture++ = tmp[8];
*texture++ = tmp[9];

*vertex++ = tmp[0];
*vertex++ = tmp[1];
*vertex++ = tmp[2];
*texture++ = tmp[3];
*texture++ = tmp[4];

*vertex++ = pos.x;
*vertex++ = pos.y;
*vertex++ = pos.z;


Cargando…
Cancelar
Guardar