To what extent can you program using manage DX9 and still expect it to run on a machine using integrated chipset video that is only DX8 compatible?
To what extent can you program using manage DX9 and still expect it to run on a machine using integrated chipset video that is only DX8 compatible?
DX9 interfaces, using only DX8 features and shader levels supported by the chipset should work as long as you have driver support to instantiate the DX9 interfaces. It likely means programming shaders in ASM instead of HLSL too.
I found that my laptop with the really old Nvidia 420 go gpu supports DX9 fine using the fixed function pipeline. So, the limitations are more likely going to be with using vertex/pixel shaders.
> To what extent can you program using manage DX9 and still expect it to run The Direct3D 9 APIs support drivers back to DX7 I believe, so a DirectX 8 part should have no problems other than exposing a limited set of capabilities. Be sure that your code is tested on newer parts as well to ensure your capabilities bit testing is correct. HLSL will generate shaders for the older vertex and pixel shader models required for DirectX 8, although it is difficult to get complex pixel shaders to compile successfully with so few instruction slots available. In this case, you will likely need to create ASM versions for those profiles. I'd recommend starting with HLSL and dropping to ASM only for those shaders that require it. -- Chuck Walbourn SDE, Windows {*filter*} & Graphics This posting is provided "AS IS" with no warranties, and confers no rights.
1.DirectX 8.1 to DirectX 9.0 porting problem
Hi all, I am converting an existing DirectX 8.1 code to DirectX 9.0 and in doing so i am stuck in a problem. The existing code uses two functions which are not there in DirectX 9.0. 1. GetOriginalMesh 2. GenerateSkinnedMesh For the GetOgiginalMesh I am using the alternative CloneMesh()and now i can load the meshes, either skinned or non-skinned. But i have no clue, what to use as an alternative for GenerateSkinnedMesh and therefore i can not make the meshes animate. Any ideas? Saurabh Aggrawal
I would like to report a bug in the code in the Microsoft DirectX 9.0 Direct3D Tutorials created using the DirectX Sample Browser. In the tutorials (for e.g. the Textures Tutorial), the functions such as InitD3D() and InitGeometry() are used to initialize the pointers to COM interfaces such as IDirect3D9, IDirect3DDevice etc. using the D3DX utility library functions. Doing so, increments the reference count for these COM interfaces, and therefore, before the program terminates, the reference count must be decremented using the Release() method of these COM interfaces, else the memory allocated for the object will never get freed because the reference count will never become 0. According to the Tutorials, the Cleanup() function, which releases these COM interface pointers, is called while handling the WM_DESTROY message in the MsgProc() function. Now, suppose the InitD3D() or InitGeometry() function has already initialized a few of the COM interface pointers using the D3DX utility library functions. After this, suppose another COM interface pointer could not be initialized by a D3DX utility library function (for e.g. in the Textures Tutorial, if the texture file was missing). In such a case, E_FAIL will be returned by InitD3D() or InitGeometry(), and when this happens, according to the logic written in WinMain(), the dispatch of window messages to MsgProc() through the message loop will not occur. Now, if MsgProc() never gets a chance to handle the WM_DESTROY message, the Cleanup() function will not get called, and therefore the reference count of the COM interfaces which had already been incremented by InitD3D() or InitGeometry() will not get decremented. Therefore, my solution to the problem is to call the Cleanup() function just before the WinMain() returns, and not while handling the WM_DESTROY message in the MsgProc() function. Doing so will ensure that the Cleanup() function gets called always, thus releasing the initialized COM interface pointers without fail. If you like my solution, please mail me at XXXX@XXXXX.COM Regards, Dhiren Sarup, Mumbai.
hii! i have encouter some problem recently in some games like "the sim2" and "maplestory" it cant go to full screen game mode and then i run programme DxDiag and i test 3D direct and i get some error code like this Direct3D 8 test results: Failure at step 8 (Creating 3D Device): HRESULT = 0x88760827 (error code) and still some more error code similar to this please give me the soulution if u really what is going wrong...
4.directX 9.0 help with textures and sprite hnadler
hi, im creating a small 2D game using directX9. However, to first ttest it, i initialised directX and decided to display a texture on screen. To dispally it i used a sprite handler and a texture object. This is my first time using directX. For some reason the program will run and window open, but nothing will be dispalyed even tho i call draw (). I get the following error: The thread 'Win32 Thread' (0xf2c) has exited with code 0 (0x0). The code i am using is: #include <windows.h> #include <d3dx9.h> #include <d3d9.h> #pragma warning (disable : 4996) // disable deprecated warning #include <strsafe.h> #pragma warning (default : 4996) #include <dinput.h> #define KEYDOWN(name, key) (name[key] & 0x80) // the keydown macro //----------------------------------------------------------------------------- // Global variables //----------------------------------------------------------------------------- LPDIRECT3D9 D3D = NULL; // Used to create the D3DDevice LPDIRECT3DDEVICE9 d3dDevice = NULL; // Our rendering device LPDIRECTINPUT8 directInput = NULL; // collects user input LPDIRECTINPUTDEVICE8 keyboard = NULL; // the keyboard object char buffer[256]; // the buffe rthat holds ke strokes LPD3DXSPRITE sprite; LPDIRECT3DTEXTURE9 fakeTexture; //----------------------------------------------------------------------------- // Name: InitD3D() // Desc: Initializes Direct3D //----------------------------------------------------------------------------- HRESULT InitD3D (HWND hWnd, HINSTANCE hInstance) { // Create the D3D object D3D = Direct3DCreate9 (D3D_SDK_VERSION); // Set up the structure used to create the D3DDevice D3DPRESENT_PARAMETERS d3dpp; ZeroMemory (&d3dpp, sizeof (d3dpp)); d3dpp.BackBufferWidth = 800; d3dpp.BackBufferHeight = 600; d3dpp.BackBufferFormat = D3DFMT_A8R8G8B8; d3dpp.BackBufferCount = 1; d3dpp.Windowed = TRUE; d3dpp.hDeviceWindow = hWnd; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; // Create the D3DDevice if (FAILED (D3D->CreateDevice (D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &d3dDevice))) return E_FAIL; // create the direct input device if (FAILED (DirectInput8Create (hInstance, DIRECTINPUT_VERSION, IID_IDirectInput8, (void**) &directInput, NULL))) return E_FAIL; if (FAILED (directInput->CreateDevice (GUID_SysKeyboard, &keyboard, NULL))) // initialise the keyboard return E_FAIL; if (FAILED (keyboard->SetDataFormat (&c_dfDIKeyboard))) // set the input device return E_FAIL; if (FAILED (keyboard->SetCooperativeLevel (hWnd, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE))) // set the keyboard application sharing values return E_FAIL; if (FAILED (keyboard->Acquire ())) // get the input device return E_FAIL; return S_OK; // everything intialised ok } // Init3D //----------------------------------------------------------------------------- // Name: Cleanup() // Desc: Releases all previously initialized objects //----------------------------------------------------------------------------- VOID cleanUp() { if (d3dDevice != NULL) d3dDevice->Release(); if (D3D != NULL) D3D->Release(); if (fakeTexture != NULL) fakeTexture->Release (); } // CleanUp VOID checkKeyboard () { keyboard->GetDeviceState (sizeof (buffer), (LPVOID) &buffer); if (KEYDOWN (buffer, DIK_RIGHT)) { } // if if (KEYDOWN (buffer, DIK_LEFT)) { } // if if (KEYDOWN (buffer, DIK_UP)) { } // if if (KEYDOWN (buffer, DIK_DOWN)) { } // if if (KEYDOWN (buffer, DIK_SPACE)) { } // if } // checkKeyboard VOID initTextures () { D3DXCreateSprite (d3dDevice, &sprite); D3DXCreateTextureFromFile (d3dDevice, L"button.bmp", &fakeTexture); } // init2D //----------------------------------------------------------------------------- // Name: Render() // Desc: Draws the scene //----------------------------------------------------------------------------- VOID Render () { // Clear the backbuffer to a blue color d3dDevice->Clear (0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(255, 0, 0), 1.0f, 0); D3DXVECTOR3 pos; pos.x = 0; pos.y = 0; pos.z = 0; sprite->Begin (D3DXSPRITE_ALPHABLEND); sprite->Draw (fakeTexture, NULL, NULL, &pos, D3DCOLOR_XRGB (255,255,255)); sprite->End (); } // Render //----------------------------------------------------------------------------- // Name: MsgProc() // Desc: The window's message handler //----------------------------------------------------------------------------- LRESULT WINAPI MsgProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { case WM_KEYDOWN: switch (wParam) { case VK_ESCAPE: PostQuitMessage (0); break; } break; case WM_CLOSE: DestroyWindow (hWnd); break; case WM_DESTROY: PostQuitMessage (0); break; default: return DefWindowProc (hWnd, msg, wParam, lParam); break; } // switch return 0; } // MsgProc //----------------------------------------------------------------------------- // Name: wWinMain() // Desc: The application's entry point //----------------------------------------------------------------------------- INT WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE, LPWSTR, INT) { // Register the window class WNDCLASSEX winClass; HWND hWnd; MSG msg; ZeroMemory (&msg, sizeof (msg)); winClass.lpszClassName = L"MyWindowsClass"; winClass.cbSize = sizeof (WNDCLASSEX); winClass.style = CS_HREDRAW | CS_VREDRAW; winClass.lpfnWndProc = MsgProc; // callback function winClass.hInstance = hInstance; // program instance handle winClass.hIcon = LoadIcon (NULL, IDI_APPLICATION); winClass.hIconSm = LoadIcon (NULL, IDI_APPLICATION); winClass.hCursor = LoadCursor (NULL, IDC_ARROW); winClass.hbrBackground = (HBRUSH) GetStockObject(BLACK_BRUSH); // background colour winClass.lpszMenuName = NULL; // no menu winClass.cbClsExtra = 0; winClass.cbWndExtra = 0; if (RegisterClassEx (&winClass) == 0) // if window class fails to initialise return E_FAIL; // exit program hWnd = CreateWindowEx (NULL, // no variations to window allowed L"MyWindowsClass", // windows class name L"Pirate/Ninja/Cowboy/Zombie Game", // windows title WS_OVERLAPPEDWINDOW | WS_VISIBLE, // window properties (on top and always visible 10, // windows x position 10, // windows y position 800, // windows width 600, // windows height NULL, // not a child window NULL, // no menu hInstance, // program instance handler NULL); // windows creation data (none needed) // Initialize Direct3D InitD3D (hWnd, hInstance); // Show the window ShowWindow (hWnd, SW_SHOWDEFAULT); UpdateWindow (hWnd); initTextures (hWnd); // Enter the message loop while (msg.message != WM_QUIT) { if (PeekMessage (&msg, NULL, 0U, 0U, PM_REMOVE)) { TranslateMessage (&msg); DispatchMessage (&msg); } // if Render (); checkKeyboard (); } // while cleanUp (); UnregisterClass (L"D3D Tutorial", winClass.hInstance); return 0; } // wWinMain
5.Could you tell me how to get "Introduction to 3D Game Programming with DirectX 9.0 "
Where can I get the book "Introduction to 3D Game Programming with DirectX 9.0" for free~~~Thank U very much ~~~~:)~~I need it for Direct3D developing
6. MS Notice: Managed DirectX 9.0 Expiration Error
Users browsing this forum: No registered users and 7 guest