Recent

Author Topic: Basic gfx graphics dll and tester.  (Read 1628 times)

BobDog

  • New Member
  • *
  • Posts: 40
Basic gfx graphics dll and tester.
« 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.







lucamar

  • Hero Member
  • *****
  • Posts: 2075
Re: Basic gfx graphics dll and tester.
« Reply #1 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...]
« Last Edit: January 23, 2019, 07:35:00 pm by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 2.0.2/2.0.4  - FPC 3.0.4 on:
(K|L)Ubuntu 12..16, Windows XP SP3, various DOSes.