Game Development Community

A Console app with hwnd possible?

by Andy Hawkins · in Technical Issues · 07/11/2006 (12:55 am) · 0 replies

I'm trying to make a console app that loads directx files as binary and spits them out in legacy DX8 ASCII format. I've got the console app to run, but when it comes to loading a directx file, I have to create a d3ddevice, init d3d etc and the created device function needs hwnd - however as it's a console window I don't think it has a hwnd right? How can I get the hwnd to work here...

HRESULT 	r = m_pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd,
							D3DCREATE_SOFTWARE_VERTEXPROCESSING, 
							&d3dpp, &m_pDevice );

in the end the code is typed in from the command line like...

DX2TXT -dx8 -txt my3dDirectXFile.x

So this command would set the flags for exporting a dx8 compatible ascii file using the binary directx file "my3dDirectXFile.x"

Any help would be appreciated. It needs to stay as a console app so I can spawn it from other programs such as max, lightwave and other directx windowed apps.