-
Notifications
You must be signed in to change notification settings - Fork 0
/
Windows.pas
72 lines (56 loc) · 1.54 KB
/
Windows.pas
1
unit Windows;interface uses QDOffscreen, Globals, Graphics, Dialogs;{----------------------------} procedure SetUpScreen; procedure SetUpWindow;{----------------------------}implementation procedure SetUpScreen; begin with gameScreen do begin ScreenRes(gameScreen.resolution.hRes, gameScreen.resolution.vRes); screenRect := screenBits.bounds; with screenBits.bounds do SetRect(dragRect, 4, 24, right - 4, bottom - 4); end;{ default window sizing } if gColorQdAvailable then gameMenus.windowSelection := 2 else gameMenus.windowSelection := 1; end;{----------------------------} procedure SetUpWindow; begin with gameWindow do begin if gameMenus.windowSelection = 1 then begin windowPtr := GetNewWindow(smallWindowID, @windowRecord, pointer(-1)); SetPort(windowPtr); end else if gameMenus.windowSelection = 2 then begin windowPtr := GetNewCWindow(mediumWindowID, @windowRecord, pointer(-1)); cWindowPtr := Pointer(windowPtr); SetPort(windowPtr); end else if gameMenus.windowSelection = 3 then begin windowPtr := GetNewCWindow(largeWindowID, @windowRecord, pointer(-1)); cWindowPtr := Pointer(windowPtr); SetPort(windowPtr); end else AlertWithMessage('Error - (SetUpWindow) Invalid windowSelection'); windowRect := windowPtr^.portRect; width := windowRect.right - windowRect.left; height := windowRect.bottom - windowRect.top; end; InitGraphics; end;{----------------------------}end.