Re: MGRX Graphics Library

new topic     » goto parent     » topic index » view thread      » older message » newer message
Icy_Viking said...

Making a DLL out of the existing C code shouldn't be too difficult, might be tedious, but should be possible. Then a wrapper for Euphoria/Phix could be made.

I found this in the readme:

  - For linux framebuffer and X11 select shared or static libraries. By 
  default only the static libraries are build (and it is the recomended 
  option). To build the shared libraries set INCLUDE_SHARED_SUPPORT=y 

So at least on Linux you should be able to build a shared library (this ends up in lib/unix/libmgrxX.so.1).

sudo apt install libjpeg-dev libpng-dev zlib1g-dev 
tar xzf mgrx134.tar.gz && cd mgrx134 
make -f makefile.x11 INCLUDE_SHARED_SUPPORT=y 

Still not sure what to do for Windows since there's no shared library option in makefile.w32.

You might be able to just bind the static library into a DLL like this, but I haven't tried it yet.

mingw32-make -f makefile.w32 
gcc -shared -o lib/win32/libmgrx.dll -Wl,--whole-archive lib/win32/libmgrx.a -Wl,--no-whole-archive -ljpeg -lpng -lz 

If you get "PIC" errors then you might need to rebuild with "CCOPT=-fPIC -D__SHARED__" added to that make command.

-Greg

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu