Horde3D

Next-Generation Graphics Engine
It is currently 27.04.2024, 18:50

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 25.11.2009, 16:55 
Offline

Joined: 25.11.2009, 16:18
Posts: 1
I've been reading the code of Horde3d for a few days.
I've noticed that the glDrawRangeElements() in drawModels(),

glDrawRangeElements( GL_TRIANGLES, meshNode->getVertRStart(), meshNode->getVertREnd(),
meshNode->getBatchCount(),
curGeoRes->_16BitIndices ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT,
(char *)0 + meshNode->getBatchStart() *
(curGeoRes->_16BitIndices ? sizeof( short ) : sizeof( int )) );

How dose "(char *)0 + meshNode->getBatchStart() *(curGeoRes->_16BitIndices ? sizeof( short ) : sizeof( int ))" mean ?

Is this code get a pointer to Triangle Indices?

Thx


Top
 Profile  
Reply with quote  
PostPosted: 25.11.2009, 17:04 
Offline

Joined: 22.11.2007, 17:05
Posts: 707
Location: Boston, MA
It is an offset into the vertex buffer object containing the indices.

If one were to use vertex arrays instead, one would pass a pointer to the start of the indices, but since we use vertex buffer objects, it has to be an offset from the start of the buffer.

_________________
Tristam MacDonald - [swiftcoding]


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 18 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group