Recent

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

Gigatron

  • Sr. Member
  • ****
  • Posts: 400
  • Amiga Rulez !!
    • Gigatron Shader Network Demo
Re: Fast Canvas Library V1.052
« Reply #105 on: February 20, 2026, 08:59:25 pm »
Hi

This is the last debugged version and some nice fx of the Glcanvas.

The old demos are not working with this version, (gl) was removed from uses in unit1 and
Gluint was replaced by TGLTextureID; new type def ;

So please  try this demo ; or live example on my YT channel;

https://www.youtube.com/watch?v=HCwqh8yWklk

Don't forget HeadPhone :)

Regards
« Last Edit: February 20, 2026, 10:24:51 pm by Gigatron »
Coding faster than Light !

Gigatron

  • Sr. Member
  • ****
  • Posts: 400
  • Amiga Rulez !!
    • Gigatron Shader Network Demo
Re: Fast Canvas Library V1.052
« Reply #106 on: February 24, 2026, 05:48:49 pm »
Hi

You know i'am working on glCanvas every day and make some intro to
improve and debug the library.

The latest one is  bitmap font multi sinus intro done by internal shader command.
the live example a bit different : https://www.youtube.com/watch?v=bJ_UONnhTOw

Be patient for V 1.0;

Regards
Gigatron
Coding faster than Light !

Gigatron

  • Sr. Member
  • ****
  • Posts: 400
  • Amiga Rulez !!
    • Gigatron Shader Network Demo
Re: Fast Canvas Library V1.052
« Reply #107 on: March 02, 2026, 12:15:25 am »
Nice

Try to release V1.0 beta now ;
Some new fx commands are 50000 parameters sorry :)

Demo sound fonts are included with this nice library Glcanvas;

Regards

GTR
« Last Edit: March 02, 2026, 12:18:28 am by Gigatron »
Coding faster than Light !

Seenkao

  • Hero Member
  • *****
  • Posts: 743
    • New ZenGL.
Re: Fast Canvas Library V1.052
« Reply #108 on: March 02, 2026, 03:32:17 am »
Привет, Gigatron!
Если интересно, то некоторую функциональность можно немного "упростить" и в понимании и в передаче данных.
Например можно задавать цвет либо посредством структуры или посредством LongWord. В первом варианте мы создаём структуру и можно задать данные по умолчанию:

Google translate:
Hi, Gigatron!
If you're interested, some functionality can be slightly simplified, both in terms of understanding and data transfer.
For example, you can set the color either through a structure or through LongWord. In the first option, we create a structure and can set default data:
Code: Pascal  [Select][+][-]
  1. type
  2.   myTColor = record
  3.     R, G, B, A: Single;
  4.   end;
  5. var                               // or constant
  6.   whiteColor: myTColor = (1, 1, 1, 1);
  7.   blackColor: myTColor = (0, 0, 0, 0);

Во втором варианте мы из целого числа работаем только с байтами. В этом случае число LongWord - RRGGBBAA (или AARRGGBB).
Различные варианты можно увидеть в разных движках и графических редакторах. Для передачи данных в процедуру или функцию, такие вещи проще. Просто передаём структуру или число RRGGBBAA и используем их.
Возможно ещё проще создавать объекты и все данные хранить в объектах. А все функции и процедуры уже будут работать от самих объектов (в основном).

Это только информация к размышлению! Успехов!

Eng: In the second option, we work only with bytes from the integer. In this case, the LongWord number is RRGGBBAA (or AARRGGBB).
Different options can be seen in different engines and graphic editors. Passing data to a procedure or function is simpler. We simply pass the RRGGBBAA structure or number and use it.
It might be even easier to create objects and store all data in objects. And all functions and procedures will work from the objects themselves (mostly).

This is just food for thought! Good luck!  :)
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

n7800

  • Hero Member
  • *****
  • Posts: 644
  • Lazarus IDE contributor
    • GitLab profile
Re: Fast Canvas Library V1.052
« Reply #109 on: March 02, 2026, 04:36:24 am »
And also notice that glCanvas is also not needed to be added here, nor lazopenglcontext, just this:

Code: Pascal  [Select][+][-]
  1.   Forms, Unit1; //lazopenglcontext, glCanvas, soundtracker_lib, SoundtrackerAudio;
  2.  

Notice that every file you include in project inspector will be added here and if they are not essencial for functioning (as components, for instance), they will make problems.

By the way, this is controlled by the option with the long name: "Project Options > Miscellaneous > Main unit has Uses section containing all units of project".

I'll add that some units, on the contrary, must be specified even if they are not explicitly used. For example, these are the standard cthreads and Interfaces units for a GUI application, since they have an initialization section that runs when the program starts.

Gigatron

  • Sr. Member
  • ****
  • Posts: 400
  • Amiga Rulez !!
    • Gigatron Shader Network Demo
Re: Fast Canvas Library V1.052
« Reply #110 on: March 02, 2026, 10:55:07 pm »

Google translate:
Hi, Gigatron!
If you're interested, some functionality can be slightly simplified, both in terms of understanding and data transfer.
For example, you can set the color either through a structure or through LongWord. In the first option, we create a structure and can set default data:
Code: Pascal  [Select][+][-]
  1. type
  2.   myTColor = record
  3.     R, G, B, A: Single;
  4.   end;
  5. var                               // or constant
  6.   whiteColor: myTColor = (1, 1, 1, 1);
  7.   blackColor: myTColor = (0, 0, 0, 0);

Hi thank you , i have the same color option on glCanvas;

Code: Pascal  [Select][+][-]
  1.  TglColor = record
  2.     r, g, b, a: Single;  // r,g,b,a := glmakecolor(1.0,0.0,0.0,1.0); one time
  3.   end;  

And usage is like this :

Code: Pascal  [Select][+][-]
  1. procedure TForm1.OpenGLControl1Paint(Sender: TObject);
  2. var
  3.  
  4.   mycol : TglColor;
  5. begin
  6.  
  7.   mycol := glMakeColor(1.0,0.0,0.0,1.0);
  8.  
  9.   glFillScreen(OpenGLControl1, mycol.r,mycol.g,mycol.b,mycol.a);
  10.  

Regards
Coding faster than Light !

Gigatron

  • Sr. Member
  • ****
  • Posts: 400
  • Amiga Rulez !!
    • Gigatron Shader Network Demo
Re: Fast Canvas Library V1.052
« Reply #111 on: March 02, 2026, 10:57:43 pm »
And also notice that glCanvas is also not needed to be added here, nor lazopenglcontext, just this:

Code: Pascal  [Select][+][-]
  1.   Forms, Unit1; //lazopenglcontext, glCanvas, soundtracker_lib, SoundtrackerAudio;
  2.  

Notice that every file you include in project inspector will be added here and if they are not essencial for functioning (as components, for instance), they will make problems.

By the way, this is controlled by the option with the long name: "Project Options > Miscellaneous > Main unit has Uses section containing all units of project".

I'll add that some units, on the contrary, must be specified even if they are not explicitly used. For example, these are the standard cthreads and Interfaces units for a GUI application, since they have an initialization section that runs when the program starts.

Nice, and thank you, let's let users choose this ;)
Coding faster than Light !

Seenkao

  • Hero Member
  • *****
  • Posts: 743
    • New ZenGL.
Re: Fast Canvas Library V1.052
« Reply #112 on: March 02, 2026, 11:20:43 pm »
And usage is like this :
Заранее извиняюсь. Я возьму для примера твой кусочек кода. И применю "свои" правки.

Google translate:
My apologies in advance. I'll use your code snippet as an example and apply "my" edits.

Code: Pascal  [Select][+][-]
  1. procedure glDrawText(x, y: Integer; const txt: string;
  2.                      const textColor: TglColor = whiteColor;                                              // whiteColor - const or var
  3.                      fontName: string = 'Arial'; fontSize: Integer = 14;
  4.                      fontStyle: TFontStyles = [];
  5.                      Angle: Single = 0; CenteredRotation: Boolean = False;
  6.                      CenteredText: Boolean = False);
  7. begin
  8.   ...
  9.   glColor4fv(@textColor);
  10.  
  11.   ...
  12. end.
но лично я указателями пользуюсь.
А вообще, большинство рекомендуют переходить на OpenGL 3+ или на Vulkan.  ;)

Eng:
But personally, I use pointers.
In general, most people recommend switching to OpenGL 3+ or Vulkan. ;)
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

Gigatron

  • Sr. Member
  • ****
  • Posts: 400
  • Amiga Rulez !!
    • Gigatron Shader Network Demo
Re: Fast Canvas Library V1.052
« Reply #113 on: March 03, 2026, 12:18:18 am »
Ok just made an overload procedure with pointer;

Code: Pascal  [Select][+][-]
  1. // surcharge ; avec pointeur
  2. procedure glDrawText(x, y: Integer; const txt: string;
  3.                      const textColor: TglColor  ;
  4.                      fontName: string = 'Arial'; fontSize: Integer = 14;
  5.                      fontStyle: TFontStyles = [];
  6.                      Angle: Single = 0; CenteredRotation: Boolean = False;
  7.                      CenteredText: Boolean = False); overload;  
  8.  
  9. .............
  10. glColor4fv(@textColor);
  11.  
  12. usage;
  13. glDrawText(100,100,'HELLO',glMakeColor(1.0,1.0,1.0,1.0),'Arial',32);
  14.  

Thank you



Coding faster than Light !

 

TinyPortal © 2005-2018