Explorar el Código

gpu: fix the core scene renderer.

legacy
Sam Hocevar sam hace 12 años
padre
commit
560d5cc6be
Se han modificado 3 ficheros con 8 adiciones y 7 borrados
  1. +0
    -2
      src/gpu/vertexbuffer.cpp
  2. +1
    -1
      src/gpu/vertexbuffer.h
  3. +7
    -4
      src/scene.cpp

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

@@ -231,8 +231,6 @@ void VertexDeclaration::SetStream(VertexBuffer *vb, ShaderAttrib attr1,
int type_index = m_streams[attr_index].stream_type;
if (type_index < 0 || type_index >= sizeof(tlut) / sizeof(*tlut))
type_index = 0;
Log::Error("Size %d Type %d Stride %d offset %d\n", tlut[type_index].size,
tlut[type_index].type,stride,offset);

glVertexAttribPointer((GLint)reg, tlut[type_index].size,
tlut[type_index].type, GL_FALSE,


+ 1
- 1
src/gpu/vertexbuffer.h Ver fichero

@@ -44,7 +44,7 @@ struct VertexUsage
BlendWeight,
BlendIndices,
Normal,
PSize,
PointSize,
TexCoord,
Tangent,
Binormal,


+ 7
- 4
src/scene.cpp Ver fichero

@@ -380,6 +380,9 @@ void Scene::Render() // XXX: rename to Blit()
vertex + 18 * (j - i), texture + 12 * (j - i));
}

data->bufs[buf]->Unlock();
data->bufs[buf + 1]->Unlock();

stdshader->Bind();

/* Bind texture */
@@ -391,17 +394,17 @@ void Scene::Render() // XXX: rename to Blit()

/* Draw arrays */
#if defined USE_D3D9 || defined _XBOX
g_d3ddevice->DrawPrimitive(D3DPT_TRIANGLELIST, 0, (n - i) * 6);
g_d3ddevice->DrawPrimitive(D3DPT_TRIANGLELIST, 0, (n - i) * 2);
#else
glDrawArrays(GL_TRIANGLES, 0, (n - i) * 6);

# if defined HAVE_GL_2X && !defined __APPLE__
glBindVertexArray(0);
//glBindVertexArray(0);
# endif
# if !defined __CELLOS_LV2__ // Use cgGLEnableClientState etc.
# else
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
//glDisableClientState(GL_VERTEX_ARRAY);
//glDisableClientState(GL_TEXTURE_COORD_ARRAY);
# endif
#endif
}


Cargando…
Cancelar
Guardar