mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
something draws, now
This commit is contained in:
parent
72e227eefe
commit
fe188f9a43
2 changed files with 10 additions and 1 deletions
|
@ -97,13 +97,15 @@ void RenderablePolyVoxEntityItem::getModel() {
|
|||
mesh->setVertexBuffer(gpu::BufferView(vertexBufferPtr,
|
||||
0,
|
||||
vertexBufferPtr->getSize() - sizeof(float) * 3,
|
||||
sizeof(float) * 7,
|
||||
sizeof(float) * 3,
|
||||
// sizeof(PolyVox::PositionMaterialNormal),
|
||||
gpu::Element(gpu::VEC3, gpu::FLOAT, gpu::RAW)));
|
||||
mesh->addAttribute(gpu::Stream::NORMAL,
|
||||
gpu::BufferView(vertexBufferPtr,
|
||||
sizeof(float) * 3,
|
||||
vertexBufferPtr->getSize() - sizeof(float) * 3,
|
||||
sizeof(float) * 7,
|
||||
// sizeof(PolyVox::PositionMaterialNormal),
|
||||
gpu::Element(gpu::VEC3, gpu::FLOAT, gpu::RAW)));
|
||||
|
||||
|
||||
|
@ -138,6 +140,10 @@ void RenderablePolyVoxEntityItem::render(RenderArgs* args) {
|
|||
|
||||
gpu::Batch batch;
|
||||
|
||||
// XXX why do I need these?
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
glEnableClientState(GL_NORMAL_ARRAY);
|
||||
|
||||
auto mesh = _modelGeometry.getMesh();
|
||||
batch.setInputFormat(mesh->getVertexFormat());
|
||||
batch.setIndexBuffer(gpu::UINT32, mesh->getIndexBuffer()._buffer, 0);
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
|
||||
EntityItem* PolyVoxEntityItem::factory(const EntityItemID& entityID, const EntityItemProperties& properties) {
|
||||
qDebug() << "XXXXXXXXXXXX XXXXXXXXXXXX making PolyVoxEntityItem entity";
|
||||
EntityItem* result = new PolyVoxEntityItem(entityID, properties);
|
||||
return result;
|
||||
}
|
||||
|
@ -28,6 +29,8 @@ EntityItem* PolyVoxEntityItem::factory(const EntityItemID& entityID, const Entit
|
|||
PolyVoxEntityItem::PolyVoxEntityItem(const EntityItemID& entityItemID, const EntityItemProperties& properties) :
|
||||
EntityItem(entityItemID)
|
||||
{
|
||||
qDebug() << "XXXXXXXXXXXX XXXXXXXXXXXX making PolyVoxEntityItem entity";
|
||||
|
||||
_type = EntityTypes::PolyVox;
|
||||
_created = properties.getCreated();
|
||||
setProperties(properties);
|
||||
|
|
Loading…
Reference in a new issue