Re: How to use DirectX using Platform Invoke?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Look at the source for the driver. My bet is that it doesn't which is why
you see that error. You need to modify the driver to add that support (and
it may or may not be trivial).


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com

"Frankie D." <FrankieD@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:2A0EB1DB-79D1-4857-BFDB-F41E9AE39BB4@xxxxxxxxxxxxxxxx
Thank you for your answer. How can I Check It?

I have Intel 855 GME.

regards,

Frankie

"Chris Tacke, eMVP" wrote:

Does your device actually support D3DM? You can't just pull in the
catalog
item and expect it to work. The display driver has to actually support
it
as well.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com

"Frankie D." <FrankieD@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:3322B1CB-2A93-4979-9A04-753788CADD63@xxxxxxxxxxxxxxxx
I am unable to create d3dm device using PLatform Invoke.
Native code is based on TUT01_CREATEDEVICE sample of PLatform Builder.
Return value of CreateDevice function signs failure. Why?

Please help!

Thanks in advance,

Frankie


Native code:

extern "C" DIRECTXNATIVE_API HRESULT InitD3DM( HWND hWnd );

...


DIRECTXNATIVE_API HRESULT InitD3DM( HWND hWnd )
{

g_pD3DM = Direct3DMobileCreate( D3DM_SDK_VERSION )


D3DMPRESENT_PARAMETERS d3dmpp;
memset( &d3dmpp, 0, sizeof(d3dmpp) );
d3dmpp.Windowed = TRUE;
d3dmpp.SwapEffect = D3DMSWAPEFFECT_DISCARD;
d3dmpp.BackBufferFormat = D3DMFMT_UNKNOWN;

// Create the Direct3D Mobile device.
UINT uAdapter;


// Use the default system D3DM driver
uAdapter = D3DMADAPTER_DEFAULT;

if( FAILED( g_pD3DM->CreateDevice( uAdapter,
D3DMDEVTYPE_DEFAULT,
hWnd, 0,
&d3dmpp, &g_pd3dmDevice ) ) )
{
OutputDebugString(TEXT("Unable to create a D3DM device.\n"));
return E_FAIL;
}

// Device state would normally be set here

return S_OK;
}

Managed Code:

#include <d3dm.h>

LPDIRECT3DMOBILE g_pD3DM = NULL; // Used to create the
D3DMDevice
LPDIRECT3DMOBILEDEVICE g_pd3dmDevice = NULL; // Our rendering device
HMODULE g_hRefDLL = NULL; // DLL handle for
d3dmref.dll
bool g_bUseRef = false; // Flag denoting use of
d3dmref

public partial class Form1 : Form
{

[DllImport("DirectXNative.dll", EntryPoint = "InitD3DM", SetLastError
=
true)]
static extern UInt32 InitD3DM( IntPtr hWnd );

public Form1()
{
InitializeComponent();
InitD3DM(this.Handle);
}

}







.



Relevant Pages