Recent

Author Topic: Fast Canvas Library V1.052  (Read 23343 times)

Gigatron

  • Sr. Member
  • ****
  • Posts: 354
  • Amiga Rulez !!
    • Gigatron Shader Network Demo
Re: Fast Canvas Library V1.052
« Reply #75 on: November 26, 2025, 02:11:15 pm »
I removed the windows dependencies of NativeFastCanvas, so I could test it on Linux.

Just replace the unit in any of the test projects that have been uploaded and they should work on Linux and Mac (though I didn't test it on MacOS). Should work on Windows too.

I made a long trip over several weeks, I will see to continue some projects on lazarus pascal. That said, you have done an excellent job, thank you very much, I hope that all W.,L.M users will enjoy it.

Regards GTR
Coding faster than Light !

indydev

  • Full Member
  • ***
  • Posts: 131
Re: Fast Canvas Library V1.052
« Reply #76 on: November 27, 2025, 10:35:48 am »

...you have done an excellent job, thank you very much, I hope that all W.,L.M users will enjoy it.

Regards GTR
:-[ Thanks for the kind words.

I wondered if using the GTKWidgets directly would improve the speed on Linux, but I couldn't get that to work. Not sure how this version compares on Windows to your original, but I always try to find the most fpc friendly methodology if possible.

elkhalafy

  • Newbie
  • Posts: 5
Re: Fast Canvas Library V1.052
« Reply #77 on: December 19, 2025, 07:40:13 am »
Create GitHub page for your projects with latest updates, Downloads, better.

Thank you

Gigatron

  • Sr. Member
  • ****
  • Posts: 354
  • Amiga Rulez !!
    • Gigatron Shader Network Demo
Re: Fast Canvas Library V1.052
« Reply #78 on: December 31, 2025, 11:58:34 pm »
Create GitHub page for your projects with latest updates, Downloads, better.

Thank you

Hi , Sorry for the late answer but sure no time with github, consider the latest version is included in latest demo... Like here;

This is the bugfixed and added some internal shader version of glCanvas of 2025. Some Shaders are copyrighted so use them for non commercial usage.

Code: Pascal  [Select][+][-]
  1. PlasmaFBMShader: GLuint = 0;  free
  2.  PlasmaShader: GLuint    = 0;   free
  3.  PlanetShader: GLuint    = 0;  not free
  4.  FlagShader: GLuint      = 0;   free
  5.  GlowShader: GLuint      = 0;  free
  6.  PhongBallShader: GLuint = 0; free
  7.  PulstarShader: GLuint   = 0;   free
  8.  StarNestShader: GLuint  = 0;  not free
  9.  CounterShader: GLuint   = 0; modifyed partial free
  10.  

New year demo live exemple; https://www.youtube.com/watch?v=oJjeNA3-JhY
 
« Last Edit: January 03, 2026, 10:57:43 pm by Gigatron »
Coding faster than Light !

Gigatron

  • Sr. Member
  • ****
  • Posts: 354
  • Amiga Rulez !!
    • Gigatron Shader Network Demo
Re: Fast Canvas Library V1.052
« Reply #79 on: January 08, 2026, 06:57:51 pm »
Hi

Added Bitmap font demo + Amiga (fake  :)) Decruncher please see demo simple code.

Regards
Coding faster than Light !

Gigatron

  • Sr. Member
  • ****
  • Posts: 354
  • Amiga Rulez !!
    • Gigatron Shader Network Demo
Re: Fast Canvas Library V1.052
« Reply #80 on: January 11, 2026, 12:19:50 am »
Hi ,

Time really flies when you’re coding 🙂

I’m sharing a debugged version of glCanvas with a nice demo included.

Code under 100 lines;
Code: Pascal  [Select][+][-]
  1. unit Unit1;
  2. {$mode objfpc}{$H+}
  3.  
  4. interface
  5.  
  6. uses
  7.   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls,
  8.   OpenGLContext, glcanvas, gl, Math;
  9.  
  10. type
  11.   { TForm1 }
  12.   TForm1 = class(TForm)
  13.     OpenGLControl1: TOpenGLControl;
  14.     Timer1: TTimer;
  15.     procedure FormCreate(Sender: TObject);
  16.     procedure OpenGLControl1Paint(Sender: TObject);
  17.     procedure Timer1Timer(Sender: TObject);
  18.   private
  19.   public
  20.   end;
  21.  
  22. var
  23.   Form1: TForm1;
  24.   tmr, rr,gg,bb : Single;
  25.   counter : integer;
  26.   tex , fond : GLuint;
  27.   tex_w, tex_h, fond_w, fond_h : integer;
  28.  
  29. implementation
  30.  
  31. {$R *.lfm}
  32.  
  33. procedure TForm1.FormCreate(Sender: TObject);
  34. begin
  35.   glInit(OpenGLControl1);
  36.   glEnableVSync(True);
  37.   Randomize;
  38.   tmr := 0.0; // float
  39.   rr := random(); gg := random(); bb := random();
  40.   counter := 0;
  41.   tex  :=  glLoadPNGToTexture('gfx/laz.png',tex_w,tex_h);
  42.   fond :=  glLoadPNGToTexture('gfx/lazh.png',fond_w,fond_h);
  43. end;
  44.  
  45. procedure TForm1.OpenGLControl1Paint(Sender: TObject);
  46. var
  47.   i,j : integer;
  48. begin
  49.   glFillScreen(OpenGLControl1, 0.3, 0.3, 0.3, 1.0);
  50.  
  51.     for i:=0 to 6 do
  52.       for j:=0 to 4 do
  53.     begin
  54.     glDrawTexture2DScroll(j*416,i*150,fond_w,fond_h,fond,(tmr/30.0)*float(1.+i),0.0, // cast i ; H-scrolling
  55.                           1.0,1.0,1.0,1.0,0.0,
  56.                           rr,gg,bb,1.0,false,false); // color + H & V Flip = false
  57.     end;
  58.  
  59.   glTubeShader(500,200,tex_w,tex_h,tex,tmr,30,1.2,0.02); // new tubeShader; negate -tmr to inverse movement !
  60.  
  61.   OpenGLControl1.SwapBuffers;
  62. end;
  63.  
  64. procedure TForm1.Timer1Timer(Sender: TObject);
  65. begin
  66.   tmr := tmr + 0.1;
  67.   counter := (counter + 1) mod 100; // reset counter
  68.  
  69.   if (counter>=99) then  // reset rgb
  70.   begin
  71.     rr := random(); gg := random(); bb := random();
  72.   end;
  73.  
  74.   OpenGLControl1.Invalidate;
  75. end;
  76.  
  77. end.

Regards GTR
Coding faster than Light !

Roland57

  • Hero Member
  • *****
  • Posts: 544
    • msegui.net
Re: Fast Canvas Library V1.052
« Reply #81 on: January 11, 2026, 05:40:12 am »
@Gigatron

Tested successfully your latest (beautiful) demos under Linux.

I don't why, when I open any of the projects, I get this warning:

Unable to find the component class "TOpenGLControl".

But, after that, I can compile and run the demo.  %)

By the way, I don't get that warning when I open <lazarus>/examples/openglcontrol/openglcontrol_demo.lpi.
My projects are on Codeberg.

Gigatron

  • Sr. Member
  • ****
  • Posts: 354
  • Amiga Rulez !!
    • Gigatron Shader Network Demo
Re: Fast Canvas Library V1.052
« Reply #82 on: January 11, 2026, 01:35:57 pm »
@Gigatron

Tested successfully your latest (beautiful) demos under Linux.

I don't why, when I open any of the projects, I get this warning:

Unable to find the component class "TOpenGLControl".

But, after that, I can compile and run the demo.  %)

By the way, I don't get that warning when I open <lazarus>/examples/openglcontrol/openglcontrol_demo.lpi.

Hi, i can not reproduce this warning issue and i'am not on Linux , maybe it's Path problem on Linux...

Can you open project1.lpi and change this line 4:   <PathDelim Value="\"/>  To <PathDelim Value="/"/>

Save and Reload the project1 to Run. Don't know if this will fix the warning message.

** <lazarus>/examples/openglcontrol/openglcontrol_demo.lpi  ** In this .lpi the PathDelim is not present , so maybe we can delete the line <PathDelim Value="\"/>

One day i will Go to Linux :)

Regards
« Last Edit: January 11, 2026, 07:33:10 pm by Gigatron »
Coding faster than Light !

Gigatron

  • Sr. Member
  • ****
  • Posts: 354
  • Amiga Rulez !!
    • Gigatron Shader Network Demo
Re: Fast Canvas Library V1.052
« Reply #83 on: January 13, 2026, 05:15:06 pm »
Hi

There is a nice fx on Amiga Called Candy Bar ..

You can see that fx here : https://www.youtube.com/watch?v=TZ_GZC6If3c

Or here at Thyrone  : https://www.youtube.com/watch?v=Z7HV5hqCGVQ

Or shaderform at shadertoy ; https://www.shadertoy.com/view/MtyGDR

Or pascal code in glCanvas with internal shader with no music

Live demo on my YT Channel; https://www.youtube.com/watch?v=sZoFVrm88t4

Sure Quantum Packer V5.0 is not exist and it's impossible to put shadow of the beast into
1 amiga disk 880 kb + 79 track + 4 track :) So the cracktro is fake :)


Code: Pascal  [Select][+][-]
  1. unit Unit1;
  2. {$mode objfpc}{$H+}
  3.  
  4. interface
  5.  
  6. uses
  7.   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls,
  8.   OpenGLContext,  glcanvas, gl, Math;
  9.  
  10. const
  11.  
  12.     DEMO_TEXT = 'HI AND WELCOME GIGATRON PRESENTS SHADOW OF THE BEAST CRACKED ' +
  13.               'TRAINED AND COMPACTED TO ONE DISK WITH QUANTUM DATA PACKER V 5.0 ' +
  14.               '    ENJOY TECHNOLOGY AND SEE YOU ON ANOTHER PRODUCTION BYE BYE      ';
  15.  
  16. type
  17.   { TForm1 }
  18.   TForm1 = class(TForm)
  19.     OpenGLControl1: TOpenGLControl;
  20.     Timer1: TTimer;
  21.     procedure FormCreate(Sender: TObject);
  22.     procedure OpenGLControl1Paint(Sender: TObject);
  23.     procedure Timer1Timer(Sender: TObject);
  24.   private
  25.   public
  26.   end;
  27.  
  28. var
  29.   Form1: TForm1;
  30.   tmr, rr,gg,bb : Single;
  31.   counter : integer;
  32.  
  33.   // bitmap font !
  34.   fnt: GLuint;
  35.   fnt_tmr : Single;
  36.   fnt_w, fnt_h : integer;
  37.   // Amiga decruncher & the rest
  38.     adosb,adosf : GLuint;
  39.     decrunchFinished: Boolean;
  40.     decrunchDuration: Integer;
  41.  
  42.     adosb_w,adosb_h,adosf_w,adosf_h: integer;
  43.  
  44. implementation
  45.  
  46. {$R *.lfm}
  47.  
  48. procedure TForm1.FormCreate(Sender: TObject);
  49. begin
  50.   glInit(OpenGLControl1);
  51.   glEnableVSync(True);
  52.   Randomize;
  53.   tmr := 0.0; // float
  54.   fnt_tmr := 0.0;
  55.   rr := random(); gg := random(); bb := random();
  56.   counter := 0;
  57.  
  58.   fnt   := glLoadPNGToTexture('fonts/32/025_32.png', fnt_w, fnt_h);
  59.  
  60.   adosb := glLoadPNGToTexture('gfx/amdos.png', adosb_w, adosb_h);        // AmigaDos Back
  61.   adosf := glLoadPNGToTexture('gfx/amdos2.png', adosf_w, adosf_h);      // AmigaDos Front
  62.  
  63.   // Initialiser le decrunch
  64.   decrunchFinished := False;
  65.   decrunchDuration := 0; // decrunch duration
  66.  
  67. end;
  68.  
  69. procedure TForm1.OpenGLControl1Paint(Sender: TObject);
  70. var
  71.     cw, ch: integer;
  72. begin
  73.   glFillScreen(OpenGLControl1, 0.1, 0.1, 0.1, 1.0);
  74.   cw := OpenGLControl1.Width ;
  75.   ch := OpenGLControl1.Height  ;
  76.  
  77.   if not decrunchFinished then // not finished
  78.       begin
  79.         glDecrunchBars(cw,ch, 20, decrunchDuration);
  80.         Inc(decrunchDuration);
  81.         glDrawTexture2D(600,300,adosb_w,adosb_h,adosb,2.5,2.5,0.0,1.0,1.0,1.0,1.0);
  82.         glDrawTexture2D(598,68, adosf_w,adosf_h,adosf,2.5,2.5,0.0,1.0,1.0,1.0,1.0);
  83.  
  84.         if decrunchDuration >= 250 then decrunchFinished := True;
  85.  
  86.       end
  87.   else        // decrunch end ? continue :)
  88.   begin
  89.  
  90.   glStarFieldShader(0, 0, cw, ch, tmr, 1.0, 0.0, 8, 1.0, 1.0, 1.0, 1.0);
  91.  
  92.   glDrawVectorText3DSolid(0, 40, 0,'GIGATRON',  30, 4,  // 3D Space pos x,y,z !!
  93.     2, cw, ch,180.0, -tmr*8.0, 0.0, 0.8, 1.0, 1.0, 1.0,
  94.     Cos(tmr * 0.4) * 40, Sin(tmr * 0.2) * 80, 0.8 );
  95.  
  96.   glCandyBarShader(0, 0, 1980, 130, tmr/3.0, 0.0, 20.0, 1.0, 1.0, 1.0,
  97.                    rr, gg, bb,1.0);
  98.  
  99.   glCandyBarShader(0, 884, 1980, 130, -tmr/3.0, 0.0, 20.0, 1.0, 1.0, 1.0,
  100.                    rr, gg, bb, 1.0);
  101.  
  102.   glBitmapFontText(fnt, Round(8000 - fnt_tmr  ), 710-50*abs(sin(tmr*0.48)*5.0),
  103.                        DEMO_TEXT, 32, 32, 10, 1.0, 0.0, bmMax, 6.0,6.0);
  104.   end;
  105.  
  106.   OpenGLControl1.SwapBuffers;
  107. end;
  108.  
  109. procedure TForm1.Timer1Timer(Sender: TObject);
  110. begin
  111.   tmr := tmr + 0.1;
  112.   fnt_tmr := (fnt_tmr + 15.0) mod 52000;
  113.  
  114.   counter := (counter + 1) mod 100;
  115.   if (counter >= 99) then  // reset colors
  116.   begin
  117.     rr := random();
  118.     gg := random();
  119.     bb := random();
  120.   end;
  121.   OpenGLControl1.Invalidate;
  122. end;
  123.  
  124. end.
« Last Edit: January 13, 2026, 05:23:37 pm by Gigatron »
Coding faster than Light !

Gigatron

  • Sr. Member
  • ****
  • Posts: 354
  • Amiga Rulez !!
    • Gigatron Shader Network Demo
Re: Fast Canvas Library V1.052
« Reply #84 on: January 17, 2026, 12:44:57 am »
Hi

In the past i 've made a nice fx shader for construct2 : http://gigatron3k.free.fr/html5/C2/FX/ffill/
to replicate that quick coded demo made with gl Canvas (latest version).
some new flood fx added with playin formula with the new command
glFloodShader.

Live example on YT : https://www.youtube.com/watch?v=Ptav4ISPOwo

** Ok the project is ready, just replaced Girl by Full Contact Amiga Picture

Have Fun

Regards

« Last Edit: January 17, 2026, 05:05:24 pm by Gigatron »
Coding faster than Light !

Gigatron

  • Sr. Member
  • ****
  • Posts: 354
  • Amiga Rulez !!
    • Gigatron Shader Network Demo
Re: Fast Canvas Library V1.052
« Reply #85 on: January 17, 2026, 02:34:26 pm »
Hi

The next goal is Sampling OpenglControl1... with this post processing technic , we can add shader for all Screen this will affect all demo . Stay Tuned !

glScreenShaderCRT ... glScreenShaderRGBA ... etc

I made this for MMF fusion 2  Html version to copy normal canvas to glCanvas !

Online YT demo working on 85% .. : https://www.youtube.com/watch?v=cH6Tiv5Y5j8


Regards

Gigatron
« Last Edit: January 20, 2026, 09:28:53 pm by Gigatron »
Coding faster than Light !

 

TinyPortal © 2005-2018