Recent

Author Topic: Several questions about ptcGraph  (Read 6353 times)

Roland57

  • Hero Member
  • *****
  • Posts: 586
    • msegui.net
SetActivePage and SetVisualPage example
« Reply #15 on: August 03, 2025, 11:33:05 am »
That's not how the Graph system works. It's geared to be as compatible as the TP Graph unit as possible. Caching draws is explicitly not part of this.

Hello PascalDragon (and other).

Monthes later, I remember this discussion and I realize that what I was looking for, is simply SetActivePage and SetVisualPage functions. I made a simple example that I attach here, in case someone has the same question.

@Brizeux
Sorry, I didn't see your messages. Fortunately TRon answered to you.
« Last Edit: August 03, 2025, 11:35:42 am by Roland57 »
My projects are on Codeberg.

Brizeux

  • New Member
  • *
  • Posts: 28
  • Fond of PASCAL TP7 and UCSD
Re: Several questions about ptcGraph
« Reply #16 on: August 03, 2025, 01:15:10 pm »
Merci Roland57. FPC-PASCAL 3.2.2 est excellent pour le calcul scientifique. Il remplace EXACTEMENT l'ancien FORTRAN II de nos IBM-1130 de 1966. Question simplicité il est préférable à ADA, PL/1, Modula pour des calculs purs et durs.

Roland57

  • Hero Member
  • *****
  • Posts: 586
    • msegui.net
Re: Several questions about ptcGraph
« Reply #17 on: August 03, 2025, 01:25:48 pm »
Merci Roland57. FPC-PASCAL 3.2.2 est excellent pour le calcul scientifique. Il remplace EXACTEMENT l'ancien FORTRAN II de nos IBM-1130 de 1966. Question simplicité il est préférable à ADA, PL/1, Modula pour des calculs purs et durs.

Intéressant. N'hésitez pas à partager des exemples de code sur le forum.  ;)
My projects are on Codeberg.

TBMan

  • Sr. Member
  • ****
  • Posts: 350
Re: Several questions about ptcGraph
« Reply #18 on: August 04, 2025, 02:54:21 pm »
In one of my units I have the following code:

Code: Pascal  [Select][+][-]
  1. unit general;
  2. interface
  3. type
  4.   VideoPages = (Page0, Page1);
  5.  
  6. var
  7.  Page: VideoPages = Page0;
  8.  
  9.  procedure Nextactivepage;
  10.  procedure NextVisualPage;          
  11.  
  12. implementation
  13. uses ptcgraph;
  14.  
  15. procedure Nextactivepage;
  16.   begin
  17.     if page = page0 then page := page1
  18.     else
  19.       page := page0;
  20.  
  21.       SetactivePage(Ord(Page));
  22.   end;
  23.  
  24. procedure NextVisualPage;
  25.   begin
  26.     SetVisualpage(Ord(Page));
  27.   end;                          
  28.  
  29.  

To see the next visual page, nextactivepage has to be called first. So calling NextVisualPage doesn't change the page variable.

Code: Pascal  [Select][+][-]
  1. NextActivePage;           // set next page for drawing
  2. MyDrawingRoutine;      // do my screen writes
  3. NextVisualPage;          // show the page
  4.  
« Last Edit: August 04, 2025, 03:09:15 pm by TBMan »
Barry

Newest game (clone),
Missile Commander:
https://www.youtube.com/watch?v=tgKz0cxog-k

 

TinyPortal © 2005-2018