Recent

Author Topic: A few PTCGraph questions  (Read 536 times)

TBMan

  • Sr. Member
  • ****
  • Posts: 282
A few PTCGraph questions
« on: March 07, 2025, 11:39:41 pm »
What does this mean? What does "hooked" mean? What are the "faster" routines?
Code: Pascal  [Select][+][-]
  1.  
  2. { For significant speed improvements , is is recommended }
  3. { that these routines be hooked (otherwise the default,  }
  4. { slower routines will be used) :                        }
  5. {   HLine()                                              }
  6. {   VLine()                                              }
  7. {   PatternLine()                                        }
  8. {   ClearViewPort()                                      }
  9. {   PutImage()                                           }
  10. {   GetImage()  - ImageSize() should also be changed     }
  11. {   InternalEllipse()                                    }
  12. {   Line()                                               }
  13. {   GetScanLine()                                        }
  14.  
  15.  
  16.  
  17.  
I love programming.

Some things I've done using PTCgraph:

NFL Retro Football (almost finished):
https://www.youtube.com/watch?v=78mTtsd7ppk


Solitaire games:
https://www.youtube.com/watch?v=zmtxI7FdWuQ&list=PLa4BPpFl34iVhFwX1JZwVm3vE5ay_i3R2

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: A few PTCGraph questions
« Reply #1 on: March 08, 2025, 02:57:33 pm »
What does this mean?
It is an explanation of how things are implemented (at the back-end).

Quote
What does "hooked" mean?
The graphics unit can use different (graphic) back-ends, as such it is possible to replace existing (naive) implementation (if any) of those mentioned routines with another one (potential faster implementation because else why bother). It can be tailored especially for a specific back-end or graphics-mode to be able to reach optimal performance.

It is able to do so by declaring variables that points to the implemented procedure/function and therefor can be replaced with a custom implementation, see also reference manual. The methodology of exposing such implementation that can be replaced by a custom one is known as hooking ("one sets a hook"). You could compare it with a callback routine or event in LCL.

The different video drivers (modes) are implemented in a similar fashion so that new drivers can be added in case wanted/required.

Quote
What are the "faster" routines?
Those that perform faster/quicker than the current implementation. If not they would be called "slower" routines  :D

But on a more serious note, you could replace existing implementations by your own and that perform faster.
« Last Edit: March 08, 2025, 02:59:17 pm by TRon »
Today is tomorrow's yesterday.

TBMan

  • Sr. Member
  • ****
  • Posts: 282
Re: A few PTCGraph questions
« Reply #2 on: March 08, 2025, 08:34:05 pm »
What does this mean?
It is an explanation of how things are implemented (at the back-end).

Quote
What does "hooked" mean?
The graphics unit can use different (graphic) back-ends, as such it is possible to replace existing (naive) implementation (if any) of those mentioned routines with another one (potential faster implementation because else why bother). It can be tailored especially for a specific back-end or graphics-mode to be able to reach optimal performance.

It is able to do so by declaring variables that points to the implemented procedure/function and therefor can be replaced with a custom implementation, see also reference manual. The methodology of exposing such implementation that can be replaced by a custom one is known as hooking ("one sets a hook"). You could compare it with a callback routine or event in LCL.

The different video drivers (modes) are implemented in a similar fashion so that new drivers can be added in case wanted/required.

Quote
What are the "faster" routines?
Those that perform faster/quicker than the current implementation. If not they would be called "slower" routines  :D

But on a more serious note, you could replace existing implementations by your own and that perform faster.

OK thanks!
I love programming.

Some things I've done using PTCgraph:

NFL Retro Football (almost finished):
https://www.youtube.com/watch?v=78mTtsd7ppk


Solitaire games:
https://www.youtube.com/watch?v=zmtxI7FdWuQ&list=PLa4BPpFl34iVhFwX1JZwVm3vE5ay_i3R2

 

TinyPortal © 2005-2018