Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Werbeanzeige
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 |
// Load the mesh from the specified file if( FAILED(hResult = D3DXLoadMeshFromX( pchSource, D3DXMESH_SYSTEMMEM, wmGraphic3D::GetD3DDevice(), &AdjacencyBuffer, NULL, NULL, &this->dwNumMaterials, &pMesh ) ) ) { WM_ERROR_DIRECTX("Konnte Mesh nicht laden; Datei nicht vorhanden", hResult, wmGraphic_ERROR); } |
C-/C++-Quelltext |
|
1 2 3 4 5 |
// Optimieren if (FAILED(hResult = this->pMesh->OptimizeInplace(D3DXMESHOPT_ATTRSORT, (DWORD*)AdjacencyBuffer->GetBufferPointer(), NULL, NULL, NULL))) { WM_ERROR_DIRECTX("OptimizeInplace", hResult, wmGraphic_ERROR); } |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 |
// VertexBuffer besorgen if (FAILED (hResult = this->pMesh->GetVertexBuffer(&pD3DVertexBuffer))) WM_ERROR_DIRECTX("Konnte VertexBuffer des Mehses nicht abrufen", hResult, wmGraphic_ERROR); // wird nochmal benutzt pD3DVertexBuffer->AddRef(); // VertexBuffer init. if (pVertexBuffer->InitVertexBuffer(pD3DVertexBuffer, this->pMesh->GetNumBytesPerVertex(), this->pMesh->GetNumVertices()) == wmGraphic_ERROR) WM_ERROR("Konnte VertexBuffer nicht init.", wmGraphic_ERROR); |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
wmGraphic_Result wmXReader::GenerateWmIndexBuffer(wmIndexBuffer *pIndexBuffer, int iMaterial) { // vars LPDIRECT3DINDEXBUFFER9 pD3DIndexBuffer = NULL; DWORD dwNumIndices; HRESULT hResult; hResult = D3DXConvertMeshSubsetToSingleStrip (this->pMesh, iMaterial, 0, &pD3DIndexBuffer, &dwNumIndices); // Failure control if( FAILED(hResult) ) { WM_ERROR_DIRECTX("GetAttributeTable()", hResult, wmGraphic_ERROR); } // IntexBuffer init. if (pIndexBuffer->InitIndexBuffer(pD3DIndexBuffer, sizeof(unsigned short), dwNumIndices) == wmGraphic_ERROR) WM_ERROR("Konnte IndexBuffer nicht init.", wmGraphic_ERROR); // - THE END - return wmGraphic_OK; } |
Phili
unregistriert
Phili
unregistriert
Zitat
Es ist ein Konvertor
C-/C++-Quelltext |
|
1 |
pMesh->GetAttributeTable() |
Werbeanzeige