1. MGRX Graphics Library - Help Please

Hello all,

I recently came across the MGRX library. A port of a graphics library called GRX. It is a graphics library that is low-level was used for DOS programming. However this new port allows Win32, Linux, ARM and a couple other platforms. I noticed it doesn't come in DLL or an easy to build for DLL form, so making a wrapper for it will take some work, but I think it would be neat.

https://www.fgrim.com/mgrx/

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.

Can someone help me? Perhaps a build this into a DLL or library file. I've tried everything and I can't get it to build.

new topic     » topic index » view message » categorize

2. Re: MGRX Graphics Library

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 message » categorize

3. Re: MGRX Graphics Library

I keep getting the error No rule to make target 'makedefs.grx' Stop

I tried compiling it using Mingw32 as it says in the readme. I could the try the other method I had mind. This was to edit the source code so it would compile as a DLL, but that would be tedious, but possible. Just annoying, heh. I might have to do that.

EDIT: After using chocolatey to install GNU make. I was able to get make to be universal across command prompts. However I now get this error when trying to build the w3w file.

'Error on line 82: expecting depeendices :'

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu