Skip to main content
GameDev.net gamedev.net
🔒 Locked

direct3d device creation

Started by ramy Aug 9, 2005 at 3:15 PM 4 replies 400+ views
Original Post
ramy
ramy
hey guys, i have a question, i have done a library in native c++ to create and render a 3d device using direct3d. if i want to use that under C#, i know i have to wrap the c++ library i did, but my question is, wat do i pass from C# to c++ for the HWND, to create the device in c++? any ideas? thx
intrest86
intrest86
Use the "Handle" property of your form, it holds the HWnd.
Turring Machines are better than C++ any day ^_~
ramy
ramy
ok did that.

the native c++ library is compiled with CLR option. now, when i come and wrap it under managed C++, it reads the library , but it brings some linking errors, some of these r from the std library like GetDC() that are available in the native C++ library that i have my direct3d device in.

how do i solve the linking errors in the managed library?
ramy
ramy
Quote:
Original post by intrest86
Use the "Handle" property of your form, it holds the HWnd.


could you please tell me how to send it to native c++, cause im having a hard time doing it. thx
intrest86
intrest86
I have never wrapped anything myself, but can't you compile your library as it is, unmanaged, and then add then add it to your managed wrapper? I'd assume that you use the library functions just as you usually do when using libraries. But never done it before, so YMMV.

On the other hand, does your library really do much? Is there a reason you aren't using DirectX directly from your managed code?
Turring Machines are better than C++ any day ^_~
ramy
ramy
cause i have a whole library for Direct3d of my own implementation in native. i dont want to rewrite it under managed.
i thought of doing a wrapper easier than rewritting the whole thing.
plus, in the future, i might be using the library for xbox games, cause the xbox uses native DirectX i heard.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.