How Can I Restore Hardware By Instantiating DirectX 9?

Recommended: ASR Pro

  • Step 1: Download and install ASR Pro
  • Step 2: Launch the program and select the system you want to scan
  • Step 3: Click on the Scan button and wait for the process to finish
  • Speed up your computer today by downloading the software here.

    In this guide, we are going to reveal some of the possible causes that might cause directx 9 hardware generation and then we are going to reveal the possible ways that you can try to fix this issue.

    Okay, I’ve been working on this for a while and here’s what I found out. It was compiled and rendered before I tried to instantiate the shader. Now it doesn’t compile and I’m also wondering how I’m doing. I just edited and the render I just got creates a simple camera to select.

    hlsl is about the same as displayedand main header fileand camera head

    /******************************************* ******** ** * ********************* TUTORIALS FOR FARTUN PRESENTED BY MORROWLAND ************** *********** * * ***************************************** *** Project name: Camera2 ** Project description: Camera movement and rotation * * Project type: DirectX 3D ** Author: Ronnie Andre Reierstad ** Website: www.morrowland.com ** Email: [email protected] com ** Version: English (UK) ** Date: 12/18/2003 ************************************ ************************ **** ** ************* / #include "main.h "HDC hDC = NULL; // Private GDI Device ContextHWND hWnd = NULL; // Contains a handle to our window HINSTANCE hInstance; // contains an application instance LPDIRECT3D9 pD3D = NULL; // DirectX 3D version 9LPDIRECT3DDEVICE9 pD3DDevice = NULL; // Device Key DirectX 3D Render[256]; // Array used for keyboard Routinebool active=TRUE; // Set window focus flagSet to TRUE by fullscreen Defaultbool fullscreen=TRUE; // Indicator set to fullscreen by default wrld[300];// Textures.LPDIRECT3DTEXTURE9 Texture = NULL;UINT uPasses; //used for exhibition passesD3DXMATRIX matTrans;D3DXMATRIX matView; D3DXMATRIX worldViewProjection;D3DXMATRIX project_matrix;D3DXMATRIX IdentityMatrix;D3DXMATRIX translation_matrix;D3DXMATRIXrotation_matrix;D3DXMATRIX modelViewProj; // Floating point cube rotation control g_fSpinY;float g_fSpinX;float g_fSpinZ;float b;int f2 = sizeof(FLOAT)*2;int f3 implies sizeof(FLOAT)*3;int f4 = sizeof(FLOAT)*4;D3DVERTEXELEMENT9 SDEC [] = 0, 0, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0, 1 // pos, f4, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0, 2 // Tex0, f4 + F2, D3DDECLTYPE_FLOAT3, D3DDECLUSAGE_TEX0, 2 // Tex0, 2 , TEXCOORD f4 + F2, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD // normal 3, f2 + f3 + F4, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TANGENT, 0, // tangential 4, f4 + F3 + F2 + F3, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BINORMAL , 0 , // binormal D3DDECCLUSAGE_BINORMAL, 0 , // binormal D3DDECLUSAGE_BINORMAL, 0 , // binormal ,// ///////////////NEW//////////// /// //////NEW////////// /// /////NEW///////////////CCera objCamera; LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); // Declaration for WndProc//////////////////////////////////////// / / / // /////// Load .X file///////////////////////////// /// // /// / ///////////////////void LoadXFile_NoTexture( char* MeshFilename, ID3DXMesh* &Mesh) //Zero Mesh and Create Buffer Mesh Equalso 0; ID3DXBuffer* MeshBuffer = 0; // Also load the optimized mesh D3DXLoadMeshFromX( MeshFilename, D3DXMESH_MANAGED, pD3DDevice, &MeshBuffer, 0, 0, 0, &Mesh); Mesh->OptimizeInplace(D3DXMESHOPT_ATTRSORT // create effect from given file and even throw error if there is void LoadEffect(char* EffectFilename, ID3DXEffect* &d3dEffect) ID3DXBuffer* d3dErrors = NULL; D3DXCreateEffectFromFile(pD3DDevice, EffectFilename ,NULL, NULL, D3DXSHADER_OPTIMIZATION3, NULL , &d3dEffect , &d3dErrors); if(d3dErrors) MB_ICONEXCLAMATION); d3dErrors->Release(); exit(-1); HRESULT hr = d3dEffect->ValidateTechnique(d3dEffect->GetTechnique(0));//end of function////////////////////////// / / / ///////////////////////////////////////// /// /// // / /////////// RESIZE D3D SCENE//////////////////// //// ////// //// ///////////////////////////// ////// //////// ////// /void ReSizeD3DScene(int width, int height) // Resizes and initializes the DX window if (height==0) // Divide by zero by height = 1; // make height equal to D3DXMatrixPerspectiveFovLH(&projection_matrix, 45.0f, (float)640/(float)480, 1.0f, 1000.0f ); pD3DDevice->SetTransform(D3DTS_PROJECTION, &(D3DMATRIX)projection_matrix); /////////////////////////////////////////// // // / / ///////////////////////////////////////// THE DIRECT3D InitD3D() init/ // / ///////////////////////////////////// /////// /// // ////////////////////////////int D3DXMatrixIdentity( &projection_matrix); D3DXMatrixPerspectiveFovLH(&projection_matrix, 45.0f, (float)640/(float)480, 0.1f, 1000.0f ); pD3DDevice->SetTransform(D3DTS_PROJECTION, &(D3DMATRIX)projection_matrix); pD3DDevice->SetRenderState(D3DRS_ZENABLE, TRUE); // Buffer Z (depth buffer) pD3DDevice->SetRenderState(D3DRS_CULLMODE, TRUE); // Disable back side elimination pD3DDevice->SetRenderState(D3DRS_LIGHTING, FALSE); // turn off the light//NEW/////////////////NEW//////////////////NEW//// // //////////NEW///////////////// // Up view position (vector) objCamera.Position_Camera(-15, 0.5f , -15 , 0 , 0.5f, 0, 0, 1, 0);//NEW////////////////////////////////// / ////NEW//////////////////NEW//////////////// LoadEffect("Instance.fx", effectShader) ; LoadxFile_Notexture("sphere.x", Cubemesh); DWORD TatTrees is 300; D3DVERTEXELEMENT9 verexelementsGeMeDe_float3, d3ddeclmethod_default, d3ddeclusage_Position, 0, 0, 12, d3ddecltype_float3, d3ddeclmet_default, d3ddeclusage_normal, 0, 0, 24, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0, 1, 0, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 1, 1, 16, D3DDECLTYPE_FLOAT4 ; gvSizegeom = D3DXGetDeclVertexSize(VertexElementsGeom, 0); gvSizeInst = D3DXGetDeclVertexSize ( VertexElementsGeom, 1);pD3DDevice->CreateVertexDeclaration(VertexElementsGeom, &ShaderDeclaration is your preferred hx-safe tree model);//if it only contains position, normal and texcoordCubeMesh->GetVertexBuffer(&VB);CubeMesh->GetIndexBuffer ( &IB) ;pD3DDevice- >CreateVertexBuffer (gvSizeInst * numTrees, D3DUSAGE_WRITEONLY, NULL, D3DPOOL _MANAGED, &gVBufferInst, NULL);D3DXVECTOR3 ppos, prot;for(int nited Kingdom = 0; k < numtrees; k++) // to large position and rotation pos .x is rand() % 1000; ppos.y = 0; ppos.z is rand() 1000; D3DXMatrixIdentity(% &wrld[k]); D3DXMatrixTranslation( &translation_matrix, ppos.x, ppos.y,ppos.z); D3DXMATRIX* pData implies 0;gVBufferInst->Lock(0, (LPVOID*)&pData, 0, 0);memcpy(pData, wrld, gvSizeInst numTrees) ;gVBufferInst->Unlock();DWORD numVert = CubeMesh->GetNumVertices();DWORD numInd implies CubeMesh->GetNumFaces(); // I'd say load the decal. if(D3DXCreateTextureFromFile(pD3DDevice, "gothic.png", &Texture) != D3D_OK) returns false; // Create a vertex declaration. //if(pD3DDevice->CreateVertexDeclaration(SDec, &ShaderDeclaration) D3D_OK) != // returns false; //CubeMesh->CloneMesh(D3DXMESH_MANAGED, SDec, pD3DDevice, &CubeMesh);//image state 1 pD3DDevice->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR); pD3DDevice->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR); pD3DDevice->SetSamplerState(0, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR); pD3DDevice->SetSamplerState(0, D3DSAMP_MAXANISOTROPY, 16); // Indicate that this particular texture is tiled. pD3DDevice->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP); pD3DDevice->SetSamplerState(0, D3DTADDRESS_WRAP); Returns d3dsamp_addressv, TRUE;//////////////////////////////////////////// ////// //////////////////////////////////// ////// // //// //////////////////////////////// /// DIRECT3D RENDERING////// // ///// /////////////////////////// ////// ////////// // ///// /////////////////////// ////int DrawD3DScene() { //NEW//////// // ///// //NEW//////////////////NEW //////// //////////NEW// // ///// //////// // Use the following function for the Direct3D target camera // Show the matrix D3DXMatrixLookAtLH(&matView, // update the matrix view &D3DXVECTOR3(objCamera.mPos.x, objCamera .mPos.y , objCamera.mPos.z) , &D3DXVECTOR3(objCamera.mView.x, objCamera.mView.y, objCamera.mView.z), &D3DXVECTOR3(objCamera.mUp.x , objCamera.mUp.y, objCamera.mUp .z) ) ; pD3DDevice->SetTransform(D3DTS_VIEW,&matView);// Apply changepD3DDevice->Clear( 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_COLORVALUE(0.0f,0.0f,0.0f,0.0f), 1.0f, 0 ); pD3DDevice->Start Scene(); // start scene D3DXMATRIX matWorld; D3DXMatrixIdentity(&matWorld); // Cube rotation control g_fSpinX = g_fSpinX + 0.5; g_fSpinY is equal to g_fSpinY + 0.5; g_fSpinZ = g_fSpinZ + 0.5; D3DXMatrixTranslation( &translation_matrix, 0, 0.0f,0 ); // defined as x,y,z rotation D3DXMatrixRotationYawPitchRoll(&rotation_matrix, D3DXToRadian(g_fSpinX), D3DXToRadian(g_fSpinY), D3DXToRadian(g_fSpinZ));

    Speed up your computer today by downloading the software here.