Recent

Author Topic: How to maximize window using PTCGraph?  (Read 714 times)

TBMan

  • Jr. Member
  • **
  • Posts: 50
How to maximize window using PTCGraph?
« on: January 26, 2025, 05:01:13 am »
I know enough to do the following, but the initial window size is small. Is it possible to maximize the window?

Code: Pascal  [Select][+][-]
  1. gdriver := vesa;
  2. Gmode := installusermode(640, 480, 256, 1, 8000, 6000);
  3. initgraph(gdriver, gmode, '');  

TRon

  • Hero Member
  • *****
  • Posts: 3995
Re: How to maximize window using PTCGraph?
« Reply #1 on: January 26, 2025, 06:42:02 am »
I know enough to do the following, but the initial window size is small. Is it possible to maximize the window?
Perhaps you do not realize that this graph unit originates from the time were you selected a video graphics resolution. Guess what the 640 and 480 in the call to installusermode stands for  :)

The only way you are able to 'maximize' the window is the same as switching your current graphics resolution over to that video-mode. What your video-card driver does with that is up to the video-card.

You can accomplish this by invoking the following line:
Code: Pascal  [Select][+][-]
  1. FullscreenGraph := true;
  2.  
...and which must be done before the call to initgraph in order to be able to switch to that resolution.

Make sure you have a way to be able to terminate your program (there will not be a console) in order to switch back to your desktop. Alternatively alt-tab might perhaps work.

see also Display resolution standards (not all are supported/implemented by unit graph)
« Last Edit: January 26, 2025, 06:48:57 am by TRon »
I do not have to remember anything anymore thanks to total-recall.

TBMan

  • Jr. Member
  • **
  • Posts: 50
Re: How to maximize window using PTCGraph?
« Reply #2 on: January 26, 2025, 04:13:21 pm »
I know enough to do the following, but the initial window size is small. Is it possible to maximize the window?
Perhaps you do not realize that this graph unit originates from the time were you selected a video graphics resolution. Guess what the 640 and 480 in the call to installusermode stands for  :)

The only way you are able to 'maximize' the window is the same as switching your current graphics resolution over to that video-mode. What your video-card driver does with that is up to the video-card.

You can accomplish this by invoking the following line:
Code: Pascal  [Select][+][-]
  1. FullscreenGraph := true;
  2.  
...and which must be done before the call to initgraph in order to be able to switch to that resolution.

Make sure you have a way to be able to terminate your program (there will not be a console) in order to switch back to your desktop. Alternatively alt-tab might perhaps work.

see also Display resolution standards (not all are supported/implemented by unit graph)

Ok thanks, that gave me a fullscreen graphic window, but it doesn't retain the the window frame for resizing. I'd like something a little more user friendly.

TRon

  • Hero Member
  • *****
  • Posts: 3995
Re: How to maximize window using PTCGraph?
« Reply #3 on: January 27, 2025, 12:11:41 am »
Ok thanks, that gave me a fullscreen graphic window, but it doesn't retain the the window frame for resizing. I'd like something a little more user friendly.
Yes, I got that and is why I started with my reply as done  :)

The original graph unit, what ptcgraph is replacing using a modern back-end, did not cater for such a feature. To my knowledge ptcgraph also does not.

The more or less ironic part is that PTC itself is capable of scaling surfaces. But as you might be able to figure out yourself as well the 'window' in which the graphics is displayed is not part of the graph unit et all, e.g. the only things that I am aware of that are possible is switching to full-screen video-mode and setting the title of the window. I did not even figured out how to be able to catch the action for the close-button of the window.

Perhaps nickysn reads this and can share his thoughts on these kind of questions otherwise you might perhaps have more luck asking on the SF page.
I do not have to remember anything anymore thanks to total-recall.

TBMan

  • Jr. Member
  • **
  • Posts: 50
Re: How to maximize window using PTCGraph?
« Reply #4 on: January 27, 2025, 12:43:58 pm »
Ok thanks, that gave me a fullscreen graphic window, but it doesn't retain the the window frame for resizing. I'd like something a little more user friendly.
Yes, I got that and is why I started with my reply as done  :)

The original graph unit, what ptcgraph is replacing using a modern back-end, did not cater for such a feature. To my knowledge ptcgraph also does not.

The more or less ironic part is that PTC itself is capable of scaling surfaces. But as you might be able to figure out yourself as well the 'window' in which the graphics is displayed is not part of the graph unit et all, e.g. the only things that I am aware of that are possible is switching to full-screen video-mode and setting the title of the window. I did not even figured out how to be able to catch the action for the close-button of the window.

Perhaps nickysn reads this and can share his thoughts on these kind of questions otherwise you might perhaps have more luck asking on the SF page.

Thanks again!

 

TinyPortal © 2005-2018