Need help with wrap DLL

Previous topic - Next topic

Neo-Bagamut

Hi everybody!

A few days ago I decided to write a Ninfa3D wrapper for GLBasic, but i don't know C/C++ and I have very little experience of writing a wrappers. I was read various articles, but they haven't helped.

The post which I have been guided:
http://www.glbasic.com/forum/index.php?topic=2129.0

This is my code:
Code (glbasic) Select
INLINE
  extern "C" {
    declare_alias(exportInitEngine, "Ninfa3DEngine.dll", InitEngine, (int, int, int, int) void);
    declare_alias(exportBeginScene, "Ninfa3DEngine.dll", BeginScene, () void);
    declare_alias(exportUpdateEngine, "Ninfa3DEngine.dll", UpdateEngine, () void);
    declare_alias(exportEndEngine, "Ninfa3DEngine.dll", EndEngine, () void);
    declare_alias(exportSetWindowTitle, "Ninfa3DEngine.dll", SetWindowTitle, (char) void);
  }
ENDINLINE

FUNCTION xInitEngine: width, height, depth, mode
  INLINE
    if (exportInitEngine) {
    return exportInitEngine(width, height, depth, mode);
    }
  ENDINLINE
ENDFUNCTION

FUNCTION xBeginScene:
  INLINE
    IF (exportBeginScene) {
    RETURN exportBeginScene();
    }
  ENDINLINE
ENDFUNCTION

FUNCTION xUpdateEngine:
  INLINE
    IF (exportUpdateEngine) {
    RETURN exportUpdateEngine();
    }
  ENDINLINE
ENDFUNCTION

FUNCTION xEndEngine:
  INLINE
    IF (exportEndEngine) {
    RETURN exportEndEngine();
    }
  ENDINLINE
ENDFUNCTION

FUNCTION xSetWindowTitle: title$
    INLINE
    IF (exportSetWindowTitle) {
    RETURN exportSetWindowTitle(title_Str.c_str());
    }
  ENDINLINE
ENDFUNCTION


Then i compile my project, compilers shows many errors.
AMD Phenom X3 8750 BE (2.4 Ghz); DDR2 1066 Mhz PC8500 (2048 Mb); MSI GeForce NX8800GT GDDR3 512 Mb | 256 bit; Windows XP SP3 x86.

Kuron

If you do not like GLBasic's 3D engine, why would you use another 3D engine with GLBasic.  You would be better off using C/C++ and the engine of your choice than trying to use another engine with GLB.  If anything, you are making it more complex this was as you still have to use inline C++ to interface GLB with the DLL.

Is GLBasic's 3D capability really that bad? 

Or is this like the nonsense in the Blitz forums where everybody throws fits asking for the latest 3D features even though they have no intentions of ever using them.  The only community that seems to have this right from the owner perspective is 3D RAD.  If you want the new features, put your money where your mouth is and pay up to have them implemented, otherwise be happy with what you have and actually try and learn how to use that before you ask for more.

Schranz0r

#2
declare_alias must be DECLARE_ALIAS

BTW:


The Engine is bad!
Its a simple wrapp of Irrlicht and Newton 2.0 ...

You can extand my little example on how to wrapp the Irrlicht engine...

http://www.glbasic.com/forum/index.php?topic=3778.msg27490#msg27490

I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

Neo-Bagamut

Quote from: Kuron on 2010-May-24
If you do not like GLBasic's 3D engine, why would you use another 3D engine with GLBasic.  You would be better off using C/C++ and the engine of your choice than trying to use another engine with GLB.  If anything, you are making it more complex this was as you still have to use inline C++ to interface GLB with the DLL.

This is a matter of principle, I only use Basic like syntax compilers. I do not know C/C++. I, like many other users of BASIC, I prefer programming in Basic than other more complex languages.

Quote from: Kuron on 2010-May-24Is GLBasic's 3D capability really that bad?

Definitely yes. I think GLBasic must have more functionality in 3D: Entity system, Particle system, More advanced Audio library (like OpenAL, 2D & 3D sound). And finaly the glbasic's DDD format is very-very large size (i convert my animated mesh with 100 frames from 3ds to ddd, the size of the file mymesh.ddd exceeds 12 megabytes).

Quote from: Kuron on 2010-May-24Or is this like the nonsense in the Blitz forums where everybody throws fits asking for the latest 3D features even though they have no intentions of ever using them.  The only community that seems to have this right from the owner perspective is 3D RAD.  If you want the new features, put your money where your mouth is and pay up to have them implemented, otherwise be happy with what you have and actually try and learn how to use that before you ask for more.

And I'm not asking a huge feature, but I believe it is necessary to improve the functional GLBasic (in terms of 3D). I am more than confident, if you add a good entity system and particles system, glbasic's users will be more at times.
AMD Phenom X3 8750 BE (2.4 Ghz); DDR2 1066 Mhz PC8500 (2048 Mb); MSI GeForce NX8800GT GDDR3 512 Mb | 256 bit; Windows XP SP3 x86.

Neo-Bagamut

Quote from: Schranz0r on 2010-May-24
You can extand my little example on how to wrapp the Irrlicht engine...

http://www.glbasic.com/forum/index.php?topic=3778.msg27490#msg27490

Thanks, but which version of the Irrlicht is based this wrapper?
AMD Phenom X3 8750 BE (2.4 Ghz); DDR2 1066 Mhz PC8500 (2048 Mb); MSI GeForce NX8800GT GDDR3 512 Mb | 256 bit; Windows XP SP3 x86.

Schranz0r

#5
http://downloads.sourceforge.net/irrlicht/irrlicht-1.6.zip

You can simply update to 1.7... there are only the realy basics at my "wrapper"...
My wrapped commands must be the same at 1.7 (hopefully :D)
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

Marmor

the only bad on the ninfa3d engine is the win32 only compability .
the rest is cool ,i used for a while to make some demos .

Kuron

FWIW, I asked because I am not a 3D guru and was trying to understand why so many are looking for alternatives to the native 3D support ;)


QuoteThis is a matter of principle, I only use Basic like syntax compilers. I do not know C/C++. I, like many other users of BASIC, I prefer programming in Basic than other more complex languages.
I do not disagree with that, but unlike other BASIC dialects, you are going to have to dig into C++ if you want to wrap another engine.  GLB just doesn't provide an easy interface for API/DLLs.


QuoteDefinitely yes. I think GLBasic must have more functionality in 3D: Entity system, Particle system, More advanced Audio library (like OpenAL, 2D & 3D sound).
A particle system is not part of a 3D engine, it is part of a game engine.  Audio engines are rarely even part of a game engine, as audio engines are usually stand-alone.  Entity systems are great for game engines, but bad for 3D engines.  Game engines are usually up to the person using the programming language and 3D engine to write.


QuoteAnd finaly the glbasic's DDD format is very-very large size (i convert my animated mesh with 100 frames from 3ds to ddd, the size of the file mymesh.ddd exceeds 12 megabytes).
Yes, it is pretty bad, but this is true of almost any language or engine that chooses to use a proprietary format instead of directly supporting standard formats.

I have spent a couple of years trying to figure out how to get my models into a format that GLB's converter supports only to find what you describe once I got the models converted.  So once again, work has stopped while I find another 3D solution.  I am even considering writing my own 3D engine.


QuoteAnd I'm not asking a huge feature, but I believe it is necessary to improve the functional GLBasic (in terms of 3D). I am more than confident, if you add a good entity system and particles system, glbasic's users will be more at times.
I would agree if the 3D users weren't in the minority.  It seems anymore al; peop;e here are interested in is iPhone development.  Heck, if Gernot dropped everything but iPhone support, he might even see a sales increase for GLB. =D

Hemlos

Hi Neo!

If im not mistaking, the only you can use the dll for is math processing.
Bing ChatGpt is pretty smart :O