Gamestudio Links
Zorro Links
Newest Posts
Stooq now requires an API key
by k_ivan. 06/10/26 14:39
Z9 getting Error 058
by k_ivan. 06/10/26 14:38
ZorroGPT
by TipmyPip. 06/10/26 13:07
Z12 live performance
by alx. 06/09/26 20:42
Lapsa's very own thread
by Lapsa. 06/08/26 22:41
Zorro 3.01 recoded MMI function issue
by TipmyPip. 06/04/26 05:44
SGT_FW
by Aku_Aku. 05/31/26 11:05
Issues resuming trades on Demo account
by Martin_HH. 05/22/26 13:31
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (Grant), 6,529 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Student_64151, Koti, curry, DeepxKalsi, Samed
19219 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Accessing PhysX in VC++, Exporting to DLL #340216
09/01/10 22:19
09/01/10 22:19
Joined: Jul 2010
Posts: 13
Z
Zergling103 Offline OP
Newbie
Zergling103  Offline OP
Newbie
Z

Joined: Jul 2010
Posts: 13
Hey,

I wanted to do most of the intensive physics-related programming in Visual C++ 08 since it is what I am most familiar with. VC++ also compiles in a more optimized way than Lite-C does. I also want to use features of C++ like classes and namespaces that I'm not sure are included in Lite-C.

Anyway, from what I understand so far, here is how I'd go about writing a DLL in VC++ 08 that accesses the PhysX functions you'd normally use in Lite-C:

- Start a DLL project in VC++ 08, and write:
#define DLL_USE
#include "var.h" // (only when var class is used)
#include "adll.h"
#include <ackphysx.h>

BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved )
{
engine_bind();
return TRUE;
}


- Write the needed functions, compile.

- Start a project in A8. Add the DLL to the Plugins folder.

- Add handlers for using the functions embedded inside the DLL, which I think is just writing a function header in Lite-C that is similar to the one in the DLL source file:
// DLL Source:
DLLFUNC var myFunc(var arg) { ... }

// Lite-C Source:
function myFunc(arg);

- Use the functions in the Lite-C script like you would any other function.

Is this accurate?

Thanks,

-Steve

Last edited by Zergling103; 09/01/10 22:22.
Re: Accessing PhysX in VC++, Exporting to DLL [Re: Zergling103] #340225
09/02/10 00:35
09/02/10 00:35
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
maybe you should start your project first, then add your files, now compile, create your lite-c file in the output folder (don't copy it to the plugins folder before it's finished!), then create your header

the function definition is the same as in normal c:
//CPP Source:
DLLFUNC var myFunc(var arg) { ... }
// Lite-C Source:
var myFunc(var arg);

i don't know if you can use the physics out of any DLL because the physics are also localted in the ackphysx.dll (don't know the name)

but you can try it!
custom plugins are really cool wink


Visit my site: www.masterq32.de

Moderated by  HeelX, Spirit 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1