
    6.1.1 - User level error handling
    =================================
      This chapter describes default error handling provided to user. This can
      be changed by interface of library, so every interface description
      should contain description of it's error handling or note that it uses
      default error handling.
      
      After calling any TG2D procedure, user should check value of eax
      register for value -1. If it contains error, then value of dword
      "tg2d.error' is nonzero and specifies error. Common (platform
      independant) errors are enumrated from 1 upwards. Platform (=platform
      dependant) errors are enumerated from -1 downwards. For each error
      constant TG2D_ERROR_<error name> is defined.

      If some error occured then dword variable "tg2d.error.proc" contains
      pointer to common procedure in which error occured. Altough user must
      check for error after each procedure call, so he should know which
      procedure he called when error occured, this information is useful in
      case when called tg2d procedure calls another tg2d procedure. Both
      procedures can be returning same error, but with different meaning so
      this way you can differentiate.  I know this system is not 100%, it
      would require call stack of tg2d procedures to fully describe error
      placement, but in most cases this is enough and it is much easier to
      use.
      
      Values in "tg2d.error.nameA" and "tg2d.error.nameW" are pointers to
      ASCII and unicode error name. Name is same, as name in library sources,
      for example 'TG2D_ERROR_NOTINITIALIZED'.

      If you are using some 3rd party engine (like directdraw, including OS)
      which returns some errors that are not translated to TG2D_ERROR_ form,
      then you must define platform error (with negative value), like
      TG2D_ERROR_WINDOWS, which means that value of dword variable
      "tg2d.error.originial" contains error returned by 3rd party engine.
      Meaning of contents of "tg2d.error.originial" depends on TG2D_ERROR_
      value and should be described in platform documentation. In this case
      "tg2d.error.name*" variables should better contain original error name
      (like 'DDERR_INVALIDMODE'), not tg2d's (like 'TG2D_ERROR_DIRECTDRAW')

      NOTES:
        - User is responsible for handling returned error. If you call some
          procedure after error occured in previous procedure, library wouldnt
          check this case and would act is if no error occured. It's on user
          to check for error after EVERY tg2d procedure call.
        - Instead of cheking for error with (eax == -1) you can check whether
          value of tg2d.error variable is nonzero (which means error occured)
        - After tg2d error occured and wasn't handled user should call
          tg2d.Close to clean up.
        - When looking for descrption of meaning of error returned by some
          procedure, always check ALL links (and all their links etc.). Same
          error returned by one procedure can have multiple meanings (if
          procedure calls another tg2d procedure for example). You can find
          procedure which really caused error by looking at "tg2d.error.proc".
          (Sorry for links, but this way docs are much easier to maintain).
