Jump to content

Header file(s) for LE3


Roland
 Share

Recommended Posts

It would be nice if the header file(s) for LE3 would be free from all weird macros.

The format should be in normal format like

 

extern "C"
{
    int somefunction( int arg1, const std::string& arg2 ) ;
    ...
    ...
}

 

and not some strange typedefs'

 

Why then?

The reason is that if you have standard notation, the header files can be brought into PInvoke-Toolkit and

converted to C# files just with a click.

Roland Strålberg
Website: https://rstralberg.com

Link to comment
Share on other sites

There's basically 2 ways to use DLL, so, DyLib: implicit or explicit linking.

In LE 2 we had to use explicit linking (typedefs, LoadLibrary), because it was created with BlitzMax.

In LE 3 we can also use implicit linking (drag and drop lib file, DLL loads automatically), but we still need also an explicit linked DLL for other languages which don't support this. At least C, C++ and C# supports this, perhaps also Delphi.

http://msdn.microsoft.com/en-us/library/9yd93633.aspx

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

There's basically 2 ways to use DLL, so, DyLib: implicit or explicit linking.

In LE 2 we had to use explicit linking (typedefs, LoadLibrary), because it was created with BlitzMax.

In LE 3 we can also use implicit linking (drag and drop lib file, DLL loads automatically), but we still need also an explicit linked DLL for other languages which don't support this. At least C, C++ and C# supports this, perhaps also Delphi.

http://msdn.microsoft.com/en-us/library/9yd93633.aspx

Yes Lumooja. I know the reason why the engine.h looks like it does in LE2.x. It could not have been done another way, just reminding that it would be nice to have clean headers in LE3

Roland Strålberg
Website: https://rstralberg.com

Link to comment
Share on other sites

Basically, you add the lib to your library dependancies, and then at build time, all the functions and variables in the lib are built into your exe. But like a standard cpp source file, if those functions have not been declared, then nothing can use them. Whilst users could declare the functions for themselves, it's not ideal.

 

Including a header file with the lib is the best way because otherwise anyone who uses the lib has to declare the functions themselves, which first means that they must know the name of each function, its parameter list and return type. Without access to the source code, most people are not going to know this information.

LE Version: 2.50 (Eventually)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...