Пример #1
0
	/*
	====================
	Load
	====================
	*/
	VOID IndexBuffer::Load(U32 count, U32 stride, VOID* data)
	{
    CHECK(data);

    // store the info
    mCount = count;		
    mStride = stride;

    if(mObject == 0)
    {
      // generate the buffer object
      glGenBuffers(1, &mObject); CHECK(mObject);

      // bind the buffer object
      BindIndexBuffer(mObject);

      // commit the data to the gpu memory
      glBufferData(GL_ELEMENT_ARRAY_BUFFER, mCount*mStride, data, GL_STATIC_DRAW);
    }
    else
    {
      // bind the buffer object
      BindIndexBuffer(mObject);

      // commit the data to the gpu memory
      glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, mCount*mStride, data);
    }
	}
Пример #2
0
void RendererBase::PostRender()
{
    if (pimpl->bound_layout)
    {
        pimpl->bound_layout->End();
    }
    BindIndexBuffer(0);
    BindVertexBuffer(0);
    BindShaderProgram(0);
    glFlush();
}
Пример #3
0
	/*
	====================
	Bind
	====================
	*/
	VOID IndexBuffer::Bind()
	{
    // bind the buffer object
    BindIndexBuffer(mObject);
	}