From 560d5cc6be4751cf0c1c0530ed5796d3825effc8 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sun, 15 Apr 2012 00:23:20 +0000 Subject: [PATCH] gpu: fix the core scene renderer. --- src/gpu/vertexbuffer.cpp | 2 -- src/gpu/vertexbuffer.h | 2 +- src/scene.cpp | 11 +++++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/gpu/vertexbuffer.cpp b/src/gpu/vertexbuffer.cpp index 3b622598..e8c586c2 100644 --- a/src/gpu/vertexbuffer.cpp +++ b/src/gpu/vertexbuffer.cpp @@ -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, diff --git a/src/gpu/vertexbuffer.h b/src/gpu/vertexbuffer.h index 7b29f973..2545c157 100644 --- a/src/gpu/vertexbuffer.h +++ b/src/gpu/vertexbuffer.h @@ -44,7 +44,7 @@ struct VertexUsage BlendWeight, BlendIndices, Normal, - PSize, + PointSize, TexCoord, Tangent, Binormal, diff --git a/src/scene.cpp b/src/scene.cpp index 1886bcc8..1c08050a 100644 --- a/src/scene.cpp +++ b/src/scene.cpp @@ -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 }