home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tolkit45.zip / os2tk45 / samples / mm / fsdive / gamesrvr.doc < prev    next >
Text File  |  1999-05-11  |  5KB  |  135 lines

  1. GAMESRVR.DLL -- Full-screen support for DIVE game applications           
  2.  
  3. Overview: 
  4. ---------
  5.  
  6. The purpose of the GameSrvr is to support games in video modes other
  7. than that used by the OS/2 desktop.  The reason for this is quite
  8. simple:  SPEED.
  9.  
  10. Most games on the market today use the 320x200x256 VGA mode.  There are
  11. a number of reasons for using this mode that outweigh the mediocre
  12. resolution of 320 by 200 pels in 256 colors.
  13.  
  14.   Compatibility:  This mode exists on all VGA and SuperVGA cards.
  15.  
  16.   Ease of Use:  This mode uses a flat frame buffer and exactly one byte
  17.      per pel.  This greatly simplifies the coding of graphics routines,
  18.      since hardware registers and bit packing can be ignored.
  19.  
  20.   Speed:  Not only are the graphics algorithms faster due to their
  21.      simplicity, but the buffer is only 64000 bytes.  Compare this to a
  22.      typical desktop resolution of 1024x768x256 with a frame buffer of
  23.      786432 bytes, more than 12 times larger and slower.  If the
  24.      resolution or number of colors is increased, this will only get
  25.      worse.
  26.  
  27. By using the functions provided by the GameSrvr, PM programs can be
  28. written to use the full screen without paying the penalty of a large
  29. frame buffer.
  30.  
  31. Installation and Use: 
  32. ---------------------
  33.  
  34. NOTE:  These installation instructions are only applicable on an OS/2
  35.        Warp Version 3 system.
  36.  
  37. To install the GameSrvr, run GSRVINST.EXE to perform the following
  38. steps:
  39.  
  40.   Copy GAMESRVR.DLL and DIVE.DLL to d:\OS2\DLL, where d is the boot
  41.   drive.
  42.  
  43.   Add the GAMESRVR key to the PM_ED_HOOKS application in OS2.INI with
  44.   the key value of d:\OS2\DLL\GAMESRVR.DLL, where d is the boot drive.
  45.  
  46.   If SVGADATA.PMI exists in the d:\OS2 directory, copy SVGA.EXE to
  47.   d:\OS2, then execute SVGA ON INIT to rebuild the SVGADATA.PMI file,
  48.   adding the 320x200x256 mode.
  49.  
  50. Depending on the video card that you have installed, the installation may
  51. end in the full-screen DOS session where SVGA.EXE was executed.  If so,
  52. you should type EXIT to return to your OS/2 session.
  53.  
  54. The system will have to be rebooted to allow these changes to take
  55. effect.  Applications written to use the GameSrvr will automatically
  56. take advantage of its presence.
  57.  
  58. Once an application has initialized with GameSrvr, the user can switch
  59. to full screen mode by hitting "ALT + HOME" ( Only the home key on the
  60. key pad will work ). This mechanism is supported by GameSrvr directly.
  61. An application can also provide a user interface that takes advantage
  62. of GameSrvr APIs to switch to full screen mode.
  63.  
  64.  
  65.  
  66.  
  67. Programming: 
  68. ------------
  69.  
  70. The GameSrvr is loaded at execution time by performing a DosLoadModule
  71. on GAMESRVR.  If this is successful, the address of the
  72. InitGameFrameProc routine my be queried using DosQueryProcAddr.  When
  73. you call this routine with the handle of the frame window of the
  74. application, it subclasses the frame window procedure.  This allows the
  75. GameSrvr to process all messages sent to the application, especially
  76. focus change messages which may require restoration of the original
  77. desktop mode.
  78.  
  79. Communication with the GameSrvr is through the following three messages:
  80.  
  81.   WM_SetVideoMode (0x04A0)
  82.  
  83.     This message uses mp1 to select either one of the preset game window
  84.     styles or a specific video mode, as extracted from the table of
  85.     supported video modes.
  86.  
  87.     mp1 == 0 restores the original mode of the desktop, as well as the
  88.              original size and location of the application's window.
  89.  
  90.     mp1 == 1 restores the original mode of the desktop, but expands the
  91.              size of the client window so that only the client window
  92.              and the command bar are visible.
  93.  
  94.     mp1 == 2 expands the client window to fill the screen, then sets the
  95.              video mode to the standard 320x200x256 game mode.
  96.  
  97.     mp1 > 2 expands the client window to fill the screen, then sets the
  98.              video mode defined by the VIDEOMODEINFO structure addressed
  99.              by mp1.
  100.  
  101.     The return value from this message is 1, if successful, otherwise 0.
  102.  
  103.   WM_NotifyVideoModeChange (0x04A1)
  104.  
  105.     This message is generated by the GameSrvr to notify the application
  106.     immediately before and again immediately after a video mode change.
  107.  
  108.     mp1 == 0 indicates that the video mode is about to change.
  109.  
  110.     mp1 == 1 indicates that the video mode change is complete.
  111.  
  112.     In both cases, mp2 contains the address of the VIDEOMODEINFO
  113.     structure which describes the video mode or 0 or 1, as described for
  114.     the WM_SetVideoMode message.  The value of 2 will never be returned.
  115.     Instead it is transformed into a pointer to a VIDEOMODEINFO
  116.     structure.
  117.  
  118.     The return value of this message is ignored.
  119.  
  120.   WM_GetVideoModeTable (0x04A2)
  121.  
  122.     This message is used only if you wish to select a video mode other
  123.     than the standard 320x200x256 mode.
  124.  
  125.     mp1 is the address of a PVOID to receive the address of an array of
  126.              VIDEOMODEINFO structures describing all of the modes
  127.              supported by the current display card.  This array is
  128.              allocated for you.  You may delete it yourself or allow it
  129.              to be automatically deleted at process termination.
  130.  
  131.     mp2 is the address of a ULONG to receive the number of structures in
  132.              the array that was allocated.
  133.  
  134.     The return value from this message is 1, if successful, otherwise 0.
  135.