Recent

Author Topic: [solved] Setting the initial window size when using ptcgraph?  (Read 403 times)

TBMan

  • New Member
  • *
  • Posts: 42
[solved] Setting the initial window size when using ptcgraph?
« on: January 15, 2025, 09:33:28 am »
I have my PacMan clone game up and running.  I "translated" the code from what I did in Borland Pascal 7.0 which ran in DOSBOX.
The one issue I see is that the default screen size isn't that big. You can maximize the game or resize the window at will, but it would be nice to have a better size on start up. I'm sure the answer is buried somewhere within 1,000's of line of code. but if anyone has ever done it please share the code. Thanks in advance.

Here's a short video of the game:

https://www.youtube.com/watch?v=0BNifISMqF8
« Last Edit: January 15, 2025, 04:22:12 pm by TBMan »

TBMan

  • New Member
  • *
  • Posts: 42
Re: [solved] Setting the initial window size when using ptcgraph?
« Reply #1 on: January 15, 2025, 04:28:08 pm »
I found the answer this morning. Now I just have to find a way to set the window position on startup, but this is working out good. Also I saw some code on YouTube on setting the window dimension ratios.

Code: Pascal  [Select][+][-]
  1. program test;
  2.  uses   ptccrt,   ptcgraph;
  3.  
  4. var
  5. GD, GM : smallint;
  6.  
  7. begin
  8.    GD := vesa;
  9.    GM := installusermode(1000,780,16,1,10000,8000);
  10.    InitGraph(GD,GM, '');
  11.    SetBkColor(Black);
  12.    ClearViewPort;
  13.     Setcolor(White);
  14.     Rectangle(100,100,200,200);
  15.     readkey;
  16.     CloseGraph;
  17. end.

 

TinyPortal © 2005-2018