C
colin
Hi,
Is there an easy way to do 3d drawing using drect3d8 devices in c# ?
please dont suggest using directx9 unless there is a way to use directx9 on
devices with only direct3d8 support.
the managed directx9 such as XNA does not support devices with direct3d8
only,
the software rasterizer works but is so mind numingly slow.
Im drawing 3d objects such as surfaces with textures,
created at run time for a wire mesh/model editor.
speed isnt essential but a 3 seconds update time makes panning
with a mouse imposible.
Im trying a few samples but im running into problems,
http://sunlightd.com/Archive/Windows/DirectX.NET/Default.aspx
this one was made for directx8 before directx9 was out
but although it sugests it would work on
directx9 the directx8 sdk doesn not seem to have certian directx8 include
files
such as "d3dx8.h" i managed to get hold of a copy of directx8 sdk.
the c# sample uses a c++ library wrapper for directx8
wich is cuasing the problem :-
the c++ library seems destined for vc7,
the c++ it doesnt seem to work properly on vc8 and I only have vc8 or vc6,
the error I get with vc8 is in the section of unmanaged c++ code.
..........
#pragma unmanaged
// Helper function for calling IDirectInput8::EnumDevicesBySemantics from
managed code.
extern "C" HRESULT CallEnumDevicesBySemantics(IDirectInput8 *pDI,
LPCTSTR lpsz, DIACTIONFORMAT *pDIAF,
[MarshalAs(UnmanagedType::FunctionPtr)]
Sunlight:irectX::Input:irectInput:IEnumDevicesBySemanticsCallbackDelegate
*pd,
LPVOID pvRef, DWORD dwFlags);
// Helper function for calling IDirectInput8::ConfigureDevices from managed
code.
extern "C" HRESULT CallConfigureDevices(IDirectInput8 *pDI,
[MarshalAs(UnmanagedType::FunctionPtr)]
Sunlight:irectX::Input:irectInput:IConfigureDevicesCallbackDelegate
*pCallback,
LPDICONFIGUREDEVICESPARAMS lpdiCDParams, DWORD dwFlags, LPVOID pvRef);
#pragma managed
..............
..\DirectInput.cpp(52) : error C3821: 'FunctionPtr': managed type or function
cannot be used in an unmanaged function
..\DirectInput.cpp(56) : error C3821: 'FunctionPtr': managed type or function
cannot be used in an unmanaged function
if I comment out the pragmas it compiles but then I get link errors
.........
DirectInput.obj : error LNK2031: unable to generate p/invoke for "extern "C"
long __clrcall CallConfigureDevices(struct IDirectInput8W *,class
Sunlight:irectX::Input:irectInput:IConfigureDevicesCallbackDelegate
^,struct _DICONFIGUREDEVICESPARAMSW *,unsigned long,void *)"
(?CallConfigureDevices@@$$J0YMJPAUIDirectInput8W@@P$AAVDIConfigureDevicesCallbackDelegate@DirectInput@Input@DirectX@Sunlight@@PAU_DICONFIGUREDEVICESPARAMSW@@KPAX@Z);
calling convention missing in metadata
DirectInput.obj : error LNK2031: unable to generate p/invoke for "extern "C"
long __clrcall CallEnumDevicesBySemantics(struct IDirectInput8W *,wchar_t
const *,struct _DIACTIONFORMATW *,class
Sunlight:irectX::Input:irectInput:IEnumDevicesBySemanticsCallbackDelegate
^,void *,unsigned long)"
(?CallEnumDevicesBySemantics@@$$J0YMJPAUIDirectInput8W@@PB_WPAU_DIACTIONFORMATW@@P$AAVDIEnumDevicesBySemanticsCallbackDelegate@DirectInput@Input@DirectX@Sunlight@@PAXK@Z);
calling convention missing in metadata
...........
unfortunatly although I know c++ and mfc,
I never got into managed c++ before I moved onto c#
ive spent all day getting this far, but think this is a bit over my head
thanks
Colin =^.^=
Is there an easy way to do 3d drawing using drect3d8 devices in c# ?
please dont suggest using directx9 unless there is a way to use directx9 on
devices with only direct3d8 support.
the managed directx9 such as XNA does not support devices with direct3d8
only,
the software rasterizer works but is so mind numingly slow.
Im drawing 3d objects such as surfaces with textures,
created at run time for a wire mesh/model editor.
speed isnt essential but a 3 seconds update time makes panning
with a mouse imposible.
Im trying a few samples but im running into problems,
http://sunlightd.com/Archive/Windows/DirectX.NET/Default.aspx
this one was made for directx8 before directx9 was out
but although it sugests it would work on
directx9 the directx8 sdk doesn not seem to have certian directx8 include
files
such as "d3dx8.h" i managed to get hold of a copy of directx8 sdk.
the c# sample uses a c++ library wrapper for directx8
wich is cuasing the problem :-
the c++ library seems destined for vc7,
the c++ it doesnt seem to work properly on vc8 and I only have vc8 or vc6,
the error I get with vc8 is in the section of unmanaged c++ code.
..........
#pragma unmanaged
// Helper function for calling IDirectInput8::EnumDevicesBySemantics from
managed code.
extern "C" HRESULT CallEnumDevicesBySemantics(IDirectInput8 *pDI,
LPCTSTR lpsz, DIACTIONFORMAT *pDIAF,
[MarshalAs(UnmanagedType::FunctionPtr)]
Sunlight:irectX::Input:irectInput:IEnumDevicesBySemanticsCallbackDelegate
*pd,
LPVOID pvRef, DWORD dwFlags);
// Helper function for calling IDirectInput8::ConfigureDevices from managed
code.
extern "C" HRESULT CallConfigureDevices(IDirectInput8 *pDI,
[MarshalAs(UnmanagedType::FunctionPtr)]
Sunlight:irectX::Input:irectInput:IConfigureDevicesCallbackDelegate
*pCallback,
LPDICONFIGUREDEVICESPARAMS lpdiCDParams, DWORD dwFlags, LPVOID pvRef);
#pragma managed
..............
..\DirectInput.cpp(52) : error C3821: 'FunctionPtr': managed type or function
cannot be used in an unmanaged function
..\DirectInput.cpp(56) : error C3821: 'FunctionPtr': managed type or function
cannot be used in an unmanaged function
if I comment out the pragmas it compiles but then I get link errors
.........
DirectInput.obj : error LNK2031: unable to generate p/invoke for "extern "C"
long __clrcall CallConfigureDevices(struct IDirectInput8W *,class
Sunlight:irectX::Input:irectInput:IConfigureDevicesCallbackDelegate
^,struct _DICONFIGUREDEVICESPARAMSW *,unsigned long,void *)"
(?CallConfigureDevices@@$$J0YMJPAUIDirectInput8W@@P$AAVDIConfigureDevicesCallbackDelegate@DirectInput@Input@DirectX@Sunlight@@PAU_DICONFIGUREDEVICESPARAMSW@@KPAX@Z);
calling convention missing in metadata
DirectInput.obj : error LNK2031: unable to generate p/invoke for "extern "C"
long __clrcall CallEnumDevicesBySemantics(struct IDirectInput8W *,wchar_t
const *,struct _DIACTIONFORMATW *,class
Sunlight:irectX::Input:irectInput:IEnumDevicesBySemanticsCallbackDelegate
^,void *,unsigned long)"
(?CallEnumDevicesBySemantics@@$$J0YMJPAUIDirectInput8W@@PB_WPAU_DIACTIONFORMATW@@P$AAVDIEnumDevicesBySemanticsCallbackDelegate@DirectInput@Input@DirectX@Sunlight@@PAXK@Z);
calling convention missing in metadata
...........
unfortunatly although I know c++ and mfc,
I never got into managed c++ before I moved onto c#
ive spent all day getting this far, but think this is a bit over my head
thanks
Colin =^.^=