Lazarus

Programming => Graphics and Multimedia => Graphics => Topic started by: BobDog on January 23, 2019, 07:12:50 pm

Title: Basic gfx graphics dll and tester.
Post by: BobDog on January 23, 2019, 07:12:50 pm

From FreeBASIC I have taken some gfx graphical functions and procedures and set them in a .dll
Both 32 and 64 bit dlls.
Also a .pas test file and compiled .exe files, which you will probably want to overwrite with your own pascal compilers.
Also the FreeBASIC source code is there.

I have put the declaration (dll calls) into a seperate file (gfx.inc) and used {$include  gfx.inc} in the .pas files.
(I don't know if this is standard pascal procedure, I am a bit new to pascal)

files;
https://www.mediafire.com/file/wqgt642w93a6va9/gfxgraphics.zip/file




Note: for a bit of fun only.






Title: Re: Basic gfx graphics dll and tester.
Post by: lucamar on January 23, 2019, 07:27:59 pm
I have put the declaration (dll calls) into a seperate file (gfx.inc) and used {$include  gfx.inc} in the .pas files.
(I don't know if this is standard pascal procedure, I am a bit new to pascal)

There is no "standard" but the "usual" way to do it is to put the declarations into their own unit (p.e. fbgfx.pas) and then "use" that unit wherever you need it.

For example:
Code: Pascal  [Select][+][-]
  1. unit fbgfx;
  2.  
  3. interface
  4.  
  5.   function  screen_mode(x: integer; y: integer; xres: integer; yres: integer; b: integer): integer; cdecl external 'gfx.DLL';
  6.   function  rgbcolor(red: integer; green: integer; blue: integer; alpha: integer = 255): longword ; cdecl external 'gfx.DLL';
  7.  
  8. [...etc...]
  9.  
  10. implementation
  11.  
  12. end.

And in the program:

Code: Pascal  [Select][+][-]
  1. program whatever;
  2.  
  3. uses
  4.   fbgfx;
  5.  
  6. [...etc...]
TinyPortal © 2005-2018