April 25, 2024, 09:52:10 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Box2D dll for IWBASIC

Started by benjamin805, September 28, 2015, 04:14:53 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

benjamin805

Hi,

I'm been searching the Internet,but I can not find a compiled Box2D dynamic link library that will work with IWBASIC or any other BASIC. Does anybody know of one? Or do I have to  try to compile my own using Visual Studio?

Ben

LarryMc

why do you need a dll?
you can't use the IWBasic 2d commands in your program?
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

benjamin805

Hi,

It's not really for drawing the graphics. Yes I can use the IWBASIC 2D commands. Box2D is a physics engine designed for 2D games. It's the engine the programmers used to make Angry Birds.  Now there is a C++, C#, Javascript and Actionscript version of Box2D, but nothing that I can find that will work with IWBASIC in a dll form. The source code has a Visual Studio project so I guess I could just try to compile my own, but I'm pretty sure it will require the user have .Net installed.

benjamin805

September 28, 2015, 07:35:59 PM #3 Last Edit: September 28, 2015, 07:37:46 PM by benjamin805
Does IWBASIC have the ability to import from a .h or .cpp file? if so then i could probably try working with it that way.

LarryMc

Quote from: benjamin805 on September 28, 2015, 07:35:59 PM
Does IWBASIC have the ability to import from a .h or .cpp file? if so then i could probably try working with it that way.
I did a quick search and it appears that this Box2D has a library file and API.
You  can use the .lib file with IWB and the $USE directive . The hardest part will be creating the DECLARE IMPORT commands for each of the library functions you want to use (converting the .h file declares to IWBasic format).  I'm not very good at that at all.  There are others here that can help you with some of that, if needed, I believe.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

ckoehn

It would be nice to have links to download these files.  I am a most horrible web searcher  :-[
I might have time toward the end of this week to look at it.

Later,
Clint

LarryMc

Clint

I was wrong, there is no .lib file.
It's  all .h and .cpp and associated files.
You can download the zip from here:  https://github.com/erincatto/Box2D/releases

and you can look at the help file here: http://box2d.org/manual.pdf

LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

benjamin805

Thanks for taking a look at it and helping figure out a direction. Yeah, if anyone is good and converting things like .h and are willing to help that would be great. From what I've seen so far they are many functions, etc in Box2D, so yeah, it might take some time, but would be so worth it if I got it done.

Ben




Quote from: LarryMc on September 29, 2015, 11:18:49 PM
Quote from: benjamin805 on September 28, 2015, 07:35:59 PM
Does IWBASIC have the ability to import from a .h or .cpp file? if so then i could probably try working with it that way.
I did a quick search and it appears that this Box2D has a library file and API.
You  can use the .lib file with IWB and the $USE directive . The hardest part will be creating the DECLARE IMPORT commands for each of the library functions you want to use (converting the .h file declares to IWBasic format).  I'm not very good at that at all.  There are others here that can help you with some of that, if needed, I believe.

ckoehn

I don't see a dll for windows anywhere.  Could someone provide that?

Later,
Clint

benjamin805

Quote from: ckoehn on October 01, 2015, 04:33:40 PM
I don't see a dll for windows anywhere.  Could someone provide that?

Later,
Clint

Hi,

I'll look, the only one's I've found require .Net and they were complied by someone else besides the guys who made Box2D. I'll post a link to one

Ben

benjamin805

Hi,

Here is one release with a compiled dll with it.

Ben

https://code.google.com/p/box2dx/downloads/detail?name=Box2DX-2.0.1.3-r175-RC-DemoSuite.zip


Quote from: ckoehn on October 01, 2015, 04:33:40 PM
I don't see a dll for windows anywhere.  Could someone provide that?

Later,
Clint

Brian

I don't see any exported functions in the DLL

Brian

ckoehn

Here is one that has a dll that has 437 exports.  Haven't had time to look at what it would take  for the DECLARE IMPORTS.

Later,
Clint

Bill-Bo

Clint,

How in the heck are you going to figure out the exports, much less the imports?

Bill

ckoehn

The 437 exports are actually DECLARE IMPORTS.  The biggest pain is in CPP that one header file calls another that calls another....

Take a look at BOX2D Header file.  All it does is load other header files.  Each file needs to be gone through and converted.  There are 4 folders that need going through and converting.

#ifndef BOX2D_H
#define BOX2D_H

/**
\mainpage Box2D API Documentation

\section intro_sec Getting Started

For documentation please see http://box2d.org/documentation.html

For discussion please visit http://box2d.org/forum
*/

// These include files constitute the main Box2D API

#include <Box2D/Common/b2Settings.h>
#include <Box2D/Common/b2Draw.h>
#include <Box2D/Common/b2Timer.h>

#include <Box2D/Collision/Shapes/b2CircleShape.h>
#include <Box2D/Collision/Shapes/b2EdgeShape.h>
#include <Box2D/Collision/Shapes/b2ChainShape.h>
#include <Box2D/Collision/Shapes/b2PolygonShape.h>

#include <Box2D/Collision/b2BroadPhase.h>
#include <Box2D/Collision/b2Distance.h>
#include <Box2D/Collision/b2DynamicTree.h>
#include <Box2D/Collision/b2TimeOfImpact.h>

#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2Fixture.h>
#include <Box2D/Dynamics/b2WorldCallbacks.h>
#include <Box2D/Dynamics/b2TimeStep.h>
#include <Box2D/Dynamics/b2World.h>

#include <Box2D/Dynamics/Contacts/b2Contact.h>

#include <Box2D/Dynamics/Joints/b2DistanceJoint.h>
#include <Box2D/Dynamics/Joints/b2FrictionJoint.h>
#include <Box2D/Dynamics/Joints/b2GearJoint.h>
#include <Box2D/Dynamics/Joints/b2MotorJoint.h>
#include <Box2D/Dynamics/Joints/b2MouseJoint.h>
#include <Box2D/Dynamics/Joints/b2PrismaticJoint.h>
#include <Box2D/Dynamics/Joints/b2PulleyJoint.h>
#include <Box2D/Dynamics/Joints/b2RevoluteJoint.h>
#include <Box2D/Dynamics/Joints/b2RopeJoint.h>
#include <Box2D/Dynamics/Joints/b2WeldJoint.h>
#include <Box2D/Dynamics/Joints/b2WheelJoint.h>

#endif

There are structures that need defining too.  It is quite time consuming.  Once again I wish Sapero was here.  He could complete it in no time.

Later,
Clint

benjamin805

I found this interesting quote about Box2D.

QuoteBox2D is compiled into a "statically linked library", meaning that when Box2D is compiled a .lib file is created. This .lib does nothing on its own, it needs to be linked into another project (yours) which calls functions/methods inside it. The .lib will become a part of the project's final .exe so you won't need the .lib after that. (Another way is to use a Dynamically Linked Library, but Box2D isn't configured for that.)

benjamin805

Quote from: ckoehn on October 04, 2015, 05:45:54 PM
The 437 exports are actually DECLARE IMPORTS.  The biggest pain is in CPP that one header file calls another that calls another....

Take a look at BOX2D Header file.  All it does is load other header files.  Each file needs to be gone through and converted.  There are 4 folders that need going through and converting.

#ifndef BOX2D_H
#define BOX2D_H

/**
\mainpage Box2D API Documentation

\section intro_sec Getting Started

For documentation please see http://box2d.org/documentation.html

For discussion please visit http://box2d.org/forum
*/

// These include files constitute the main Box2D API

#include <Box2D/Common/b2Settings.h>
#include <Box2D/Common/b2Draw.h>
#include <Box2D/Common/b2Timer.h>

#include <Box2D/Collision/Shapes/b2CircleShape.h>
#include <Box2D/Collision/Shapes/b2EdgeShape.h>
#include <Box2D/Collision/Shapes/b2ChainShape.h>
#include <Box2D/Collision/Shapes/b2PolygonShape.h>

#include <Box2D/Collision/b2BroadPhase.h>
#include <Box2D/Collision/b2Distance.h>
#include <Box2D/Collision/b2DynamicTree.h>
#include <Box2D/Collision/b2TimeOfImpact.h>

#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2Fixture.h>
#include <Box2D/Dynamics/b2WorldCallbacks.h>
#include <Box2D/Dynamics/b2TimeStep.h>
#include <Box2D/Dynamics/b2World.h>

#include <Box2D/Dynamics/Contacts/b2Contact.h>

#include <Box2D/Dynamics/Joints/b2DistanceJoint.h>
#include <Box2D/Dynamics/Joints/b2FrictionJoint.h>
#include <Box2D/Dynamics/Joints/b2GearJoint.h>
#include <Box2D/Dynamics/Joints/b2MotorJoint.h>
#include <Box2D/Dynamics/Joints/b2MouseJoint.h>
#include <Box2D/Dynamics/Joints/b2PrismaticJoint.h>
#include <Box2D/Dynamics/Joints/b2PulleyJoint.h>
#include <Box2D/Dynamics/Joints/b2RevoluteJoint.h>
#include <Box2D/Dynamics/Joints/b2RopeJoint.h>
#include <Box2D/Dynamics/Joints/b2WeldJoint.h>
#include <Box2D/Dynamics/Joints/b2WheelJoint.h>

#endif

There are structures that need defining too.  It is quite time consuming.  Once again I wish Sapero was here.  He could complete it in no time.

Later,
Clint

Hi,

Yes, I was noticing this too. It will be such a pain, because what I found out is that each file expects certain files to be in certain folders, etc. and if not you have to go one by one and correct the path for each one. I guess this can be expected since this Box2D has been around for a long time and has went through different hands at different points. It comes down to cleaning one up to work in my own compiler.

benjamin805

Quote from: ckoehn on October 04, 2015, 05:45:54 PM
The 437 exports are actually DECLARE IMPORTS.  The biggest pain is in CPP that one header file calls another that calls another....

Take a look at BOX2D Header file.  All it does is load other header files.  Each file needs to be gone through and converted.  There are 4 folders that need going through and converting.

#ifndef BOX2D_H
#define BOX2D_H

/**
\mainpage Box2D API Documentation

\section intro_sec Getting Started

For documentation please see http://box2d.org/documentation.html

For discussion please visit http://box2d.org/forum
*/

// These include files constitute the main Box2D API

#include <Box2D/Common/b2Settings.h>
#include <Box2D/Common/b2Draw.h>
#include <Box2D/Common/b2Timer.h>

#include <Box2D/Collision/Shapes/b2CircleShape.h>
#include <Box2D/Collision/Shapes/b2EdgeShape.h>
#include <Box2D/Collision/Shapes/b2ChainShape.h>
#include <Box2D/Collision/Shapes/b2PolygonShape.h>

#include <Box2D/Collision/b2BroadPhase.h>
#include <Box2D/Collision/b2Distance.h>
#include <Box2D/Collision/b2DynamicTree.h>
#include <Box2D/Collision/b2TimeOfImpact.h>

#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2Fixture.h>
#include <Box2D/Dynamics/b2WorldCallbacks.h>
#include <Box2D/Dynamics/b2TimeStep.h>
#include <Box2D/Dynamics/b2World.h>

#include <Box2D/Dynamics/Contacts/b2Contact.h>

#include <Box2D/Dynamics/Joints/b2DistanceJoint.h>
#include <Box2D/Dynamics/Joints/b2FrictionJoint.h>
#include <Box2D/Dynamics/Joints/b2GearJoint.h>
#include <Box2D/Dynamics/Joints/b2MotorJoint.h>
#include <Box2D/Dynamics/Joints/b2MouseJoint.h>
#include <Box2D/Dynamics/Joints/b2PrismaticJoint.h>
#include <Box2D/Dynamics/Joints/b2PulleyJoint.h>
#include <Box2D/Dynamics/Joints/b2RevoluteJoint.h>
#include <Box2D/Dynamics/Joints/b2RopeJoint.h>
#include <Box2D/Dynamics/Joints/b2WeldJoint.h>
#include <Box2D/Dynamics/Joints/b2WheelJoint.h>

#endif

There are structures that need defining too.  It is quite time consuming.  Once again I wish Sapero was here.  He could complete it in no time.

Later,
Clint

Who is Sapero?

LarryMc

QuoteWho is Sapero?
Someone who was around the forums for several years who was a master at converting .h files for use with IWBasic.  And he was always solving everyone's problems.


BTW, in my opinion, a static linked library is always the way to go when you can as opposed to a dll.

LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library