using DirectX 9.0 on DirectX 8 chipset

Win32 Programming


  • 1. Display static 2D DXFs in Direct3D
    What would be the best way to display a 2D DXF in a rendered 3D environment? Should I use GDI to make a texture, then put that on a box? Or perhaps use DirectX7 2D functions to write to a surface? device.DrawPrimitives(PrimitiveType.LineList, 0, ....... is too slow... Any help would be greatly appreciated. Thanks
  • 2. texture blending in one stage possible ?
    hi! I am making terrain engine. I use 2 stage texture for texture blending . ( for exam, grass texture -> sand texture for different material area boundary ) smoothly changing from grass texture -> sand texture. ( sorry for short english ) but I want to know any method to blend textures in one texture stage exists. is it possible to blend textures in one stage ? if exists , let me know how to .. thanks.
  • 3. ID3DXAnimationController
    Does ID3DXAnimationController contain pointers to the bone matrices. Because the SDK says SetTime updates the bone matrices. However, ID3DXAnimationController does not provide any method to get these updated bones. So I'm guessing it has pointers to the D3DXFRAME::TransformationMatrix member. Also, is it correct to say that SetTime simply interpolates the bones based on the time, but it doesn't do the propogation multiplications? From the SDK sample it appears I'm correct since UpdateFrameMatrices does the propogation: if (m_pAnimController != NULL) m_pAnimController->SetTime(m_pAnimController->GetTime() + m_fElapsedTime); UpdateFrameMatrices(m_pFrameRoot, &matWorld);
    I'm wondering why there is a next pointer pNextMeshContainer in the D3DXMESHCONTAINER structure. Basically, I'm not understanding why it is necessary to have a linked list of mesh containers per frame node. Or am i wrong and the next pointer points to a mesh container in a different frame node?
  • 5. DX and threads
    Hi, In my engine I'm implenting some IA. On the other hand, I want to allow the possibility of using SW vertex processing (for world and for skins). Should I use a thread for dispatching time for IA and for software calculation. What is the classic way in games for such cases. thanks pb

using DirectX 9.0 on DirectX 8 chipset

Postby Sam » Thu, 29 Dec 2005 01:54:40 GMT

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? 

Re: using DirectX 9.0 on DirectX 8 chipset

Postby Phil Taylor » Thu, 29 Dec 2005 11:16:29 GMT

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 

Re: using DirectX 9.0 on DirectX 8 chipset

Postby VFBGR3VydQ » Tue, 03 Jan 2006 15:39:02 GMT

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.

Re: using DirectX 9.0 on DirectX 8 chipset

Postby Chuck Walbourn [MSFT] » Thu, 05 Jan 2006 04:40:06 GMT

> 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. 

Similar Threads:

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

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

2.Bug in the code in the Microsoft DirectX 9.0 Direct3D Tutorials created using the DirectX Sample Browser

    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 

    Dhiren Sarup,

3.directx 9.0 error code

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

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


// Name: InitD3D()
// Desc: Initializes Direct3D
    // Create the D3D object
    D3D = Direct3DCreate9 (D3D_SDK_VERSION);

    // Set up the structure used to create the D3DDevice
    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, 
        return E_FAIL;
	// create the direct input device
    if (FAILED (DirectInput8Create (hInstance, 
						(void**) &directInput, 
		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 
		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) 

    if (D3D != NULL)       

	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->Draw (fakeTexture, NULL, NULL, &pos, D3DCOLOR_XRGB (255,255,255));
	sprite->End ();
} // Render

// Name: MsgProc()
// Desc: The window's message handler
    switch (msg)
        case WM_KEYDOWN:
            switch (wParam)
                case VK_ESCAPE:
                    PostQuitMessage (0);

        case WM_CLOSE:
            DestroyWindow (hWnd); break;

        case WM_DESTROY:
            PostQuitMessage (0); break;

            return DefWindowProc (hWnd, msg, wParam, lParam); break;
    } // switch
    return 0;
} // MsgProc

// Name: wWinMain()
// Desc: The application's entry point
    // Register the window class
    WNDCLASSEX winClass;
	HWND hWnd;

    MSG msg;
    ZeroMemory (&msg, sizeof (msg));
	winClass.lpszClassName = L"MyWindowsClass";
    winClass.cbSize        = sizeof (WNDCLASSEX);         = 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 
        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 
                           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

7. 3D Hidden Surface removal in DirectX 9.0

8. 10 bit per channel color with DirectX 9.0

Return to Win32 Programming


Who is online

Users browsing this forum: No registered users and 7 guest