瀏覽代碼

gpu: fix the core scene renderer.

legacy
Sam Hocevar sam 12 年之前
父節點
當前提交
560d5cc6be
共有 3 個文件被更改,包括 8 次插入7 次删除
  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 查看文件

@@ -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 查看文件

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


+ 7
- 4
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
}


Loading…
取消
儲存