On the GL front looks like Khronos stated today that GL will run full force under Vista and may actually fun faster they say. So will Aero UI work with GL now also? This bit of info would be nice to know.
Anyway back to pull hair out... :(
Quote:Original post by DukeAtreides076
Yeah, I always though the DIP parameters were pretty bizarre. Have you tried reading through this article?
Quote:Original post by sirob
Theres a nice section about DrawIndexedPrimitive in Tom Forsyth’s blog. It's about 90% down the page, called (surprisingly) DrawIndexedPrimitive.
At least, that should get you started.
Hope this helps.
//rendering
for(unsigned long z = 0; z < (mapData.map_Z - 1) / (PATCH_SIZE - 1); ++z)
{
for(unsigned long x = 0; x < (mapData.map_X - 1) / (PATCH_SIZE - 1); ++x)
{
maxX = patch[z * ((mapData.map_X - 1) / (PATCH_SIZE - 1)) + x].maxX;
maxY = patch[z * ((mapData.map_X - 1) / (PATCH_SIZE - 1)) + x].maxY;
maxZ = patch[z * ((mapData.map_X - 1) / (PATCH_SIZE - 1)) + x].maxZ;
minX = patch[z * ((mapData.map_X - 1) / (PATCH_SIZE - 1)) + x].minX;
minY = patch[z * ((mapData.map_X - 1) / (PATCH_SIZE - 1)) + x].minY;
minZ = patch[z * ((mapData.map_X - 1) / (PATCH_SIZE - 1)) + x].minZ;
// Check to see if the corners of the patches are within the frustum.
if (!gCamera.pointInFrustum(maxX, maxY, maxZ) &&
!gCamera.pointInFrustum(minX, maxY, minZ) &&
!gCamera.pointInFrustum(minX, maxY, maxZ) &&
!gCamera.pointInFrustum(maxX, maxY, minZ) &&
!gCamera.pointInFrustum(maxX, minY, maxZ) &&
!gCamera.pointInFrustum(minX, minY, minZ) &&
!gCamera.pointInFrustum(minX, minY, maxZ) &&
!gCamera.pointInFrustum(maxX, minY, minZ))
{
indicesSum += NUM_INDICES;
continue;
}
dxApp.d3dDevice->DrawIndexedPrimitive(type, 0, 0, NUM_VERTICES, indicesSum, NUM_POLYGONS);
indicesSum += NUM_INDICES;
}
}
//IB setup
unsigned long currentIndex = 0;
unsigned long index = 0;
unsigned long index1 = 0;
unsigned long index2 = 0;
unsigned long index3 = 0;
unsigned long startx = 0;
unsigned long startz = 0;
unsigned long endx = 0;
unsigned long endz = 0;
unsigned long rows = ((mapData.map_Z - 1) / (PATCH_SIZE - 1));
unsigned long columns = ((mapData.map_X - 1) / (PATCH_SIZE - 1));
float maxX = 0.0f, maxY = 0.0f, maxZ = 0.0f;
float minX = 0.0f, minY = 0.0f, minZ = 0.0f;
CreatePatches();
// Calculate the triangle index lists for each patch
for(unsigned long z = 0; z < rows; ++z)
{
for(unsigned long x = 0; x < columns; ++x)
{
index = z * ((mapData.map_X - 1) / (PATCH_SIZE - 1)) + x;
// Calculate the extents of the chunk.
startx = x * PATCH_SIZE;
startz = z * PATCH_SIZE;
endx = startx + PATCH_SIZE;
endz = startz + PATCH_SIZE;
index1 = (startz * mapData.map_X + startx);
maxX = float(startx);
minX = float(startx);
maxY = vertices[index1].pos.y;
minY = vertices[index1].pos.y;
maxZ = float(startz);
minZ = float(startz);
// Loop through the chunk extents and create the list.
indexBuffer->Lock(0, 0, (void**)&patch[index].index_buffer, 0);
for(unsigned long zz = startz; zz < endz - 1; ++zz)
<