



GGInitialise (lines 5853-5907)
Back to List
Browsing parserm.h
5853 #Endif; ! TARGET_GLULX
5854
5855 #Ifdef TARGET_GLULX;
5856
5857 [ GGInitialise res;
5858 @gestalt 4 2 res; ! Test if this interpreter has Glk.
5859 if (res == 0) {
5860 ! Without Glk, we're entirely screwed.
5861 quit;
5862 }
5863 ! Set the VM's I/O system to be Glk.
5864 @setiosys 2 0;
5865
5866 ! First, we must go through all the Glk objects that exist, and see
5867 ! if we created any of them. One might think this strange, since the
5868 ! program has just started running, but remember that the player might
5869 ! have just typed "restart".
5870
5871 GGRecoverObjects();
5872
5873 res = InitGlkWindow(0);
5874 if (res ~= 0) return;
5875
5876 ! Now, gg_mainwin and gg_storywin might already be set. If not, set them.
5877
5878 if (gg_mainwin == 0) {
5879 ! Open the story window.
5880 res = InitGlkWindow(GG_MAINWIN_ROCK);
5881 if (res == 0)
5882 gg_mainwin = glk($0023, 0, 0, 0, 3, GG_MAINWIN_ROCK); ! window_open
5883 if (gg_mainwin == 0) {
5884 ! If we can't even open one window, there's no point in going on.
5885 quit;
5886 }
5887 }
5888 else {
5889 ! There was already a story window. We should erase it.
5890 glk($002A, gg_mainwin); ! window_clear
5891 }
5892
5893 if (gg_statuswin == 0) {
5894 res = InitGlkWindow(GG_STATUSWIN_ROCK);
5895 if (res == 0) {
5896 gg_statuswin_cursize = gg_statuswin_size;
5897 gg_statuswin = glk($0023, gg_mainwin, $12, gg_statuswin_cursize,
5898 4, GG_STATUSWIN_ROCK); ! window_open
5899 }
5900 }
5901 ! It's possible that the status window couldn't be opened, in which case
5902 ! gg_statuswin is now zero. We must allow for that later on.
5903
5904 glk($002F, gg_mainwin); ! set_window
5905
5906 InitGlkWindow(1);
5907 ];
Last updated 27 February 2004.
This site is no longer supported; information may be out of date.
Maintained as a historical archive by the Interactive Fiction Technology Foundation.
Copyright 1993-2018 IFTF, CC-BY-SA unless otherwise noted.
This page was originally managed by Graham Nelson assisted by C Knight.