[Gambas-user] Distribution of custom shared libraries

Cedron Dawg cedron at exede.net
Sun Feb 24 23:06:52 CET 2019


On Sat, 23 Feb 2019, Cedron Dawg wrote:
> I think having a gp.GamePad (or gp.GameDevice, or gp.JoystickDevice, or whatever) would make programming a lot more attractive to the young gamer crowd.  The game I wrote (still thinking of a good name for it) is meant to be a good starter template for beginning programmers to develop their own games.  I'm not a gamer at all, but I thought it was a good project for me to evaluate Gambas' capabilities.  The ease of interfacing to C code is a huge plus for me.
> 

I called it gb.joystick for two reasons: (1) that's what it was already
called on my computer and (2) it uses the Linux Joystick API.

For games, the gb.sdl2 component is probably better suited, it just has
to be developed more. I wrote my joystick component to be able to use a
gamepad for operating an image viewer I wrote, instead of keyboard and
mouse. I didn't want to load gb.sdl(2) just to get input via a gamepad
and otherwise write the application in QT. But SDL has many more things
if you actually want to develop a game, so you're more likely to just
want to use SDL for everything in that case.

> As to the original question, it would be really nice if there were a built in method through the IDE for .c shared libraries.  I would suggest that they get their own category and every library would have to be submitted with a Gambas demo program which shows how the functions are to be used.  Seeing as I only have a vague understanding of the whole packaging process, I haven't a clue how it should be done properly.

I don't know about that. Bundling shared libraries sounds out of scope
for the Gambas packager. The IDE handles Gambas projects, not C source
files. Shipping a custom native library together with a component wrapper
that makes it available to Gambas is not something I have seen someone
doing, but it may be worth looking into.

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk

========================================================================
Hi Tobi,

Awesome, awesome, awesome.

Does that mean I have to go to the gambas-daily PPA to install it?

I'm a bit reluctant to be on the "bleeding edge", but if that's what it takes, I'll do it.  Thank you, I will hold off posting my little game, until I have incorporated this new component.

I guess I'll hold off any specific implementation questions until I play with it myself.

As for the library, there are other libraries in the Package Manager that offer specific language wrappers for other languages, so I know it is possible to distribute the library that way.  I have no experience preparing a library for broad distribution, but it must be doable.  Since it is supposed to span any Gambas project, this is probably the appropriate path, but then the installation instructions from the farm package will have to include a reference to install that package.  I wonder if it wouldn't be easier, if not better, to simply include the source code with a shell script to compile it.

Ced


More information about the User mailing list