Recent

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

BobDog

  • Sr. Member
  • ****
  • Posts: 394
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: 4219
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/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

 

TinyPortal © 2005-2018