#INCLUDE "occSDL.module"
#INCLUDE "course.module"

PROC sdl.info(CHAN BYTE kyb?, scr!, err!)
  INT result:
  SEQ
    out.string("SDL INFO: from occam*c*n", 0, scr!)
    out.string("(c) 2003 Christian L. Jacobsen*c*n*n", 0, scr!)
    SDL.Init(SDL.INIT.VIDEO, result)
    IF
      result <> 0
        [100]BYTE err.str:
        INT err.len:
        SEQ
          out.string("SDL initialisation failed: ", 0, scr!)
          occ.SDL.GetError(err.str, SIZE err.str, err.len)
          out.string([err.str FOR err.len], 0, scr!)
          out.string("*c*n", 0, scr!)
      TRUE
        SKIP
    #IF FALSE
    out.string("Video driver name: ", 0, scr!)
    [100]BYTE str:
    INT len:
    SEQ
      SDL.VideoDriverName(str, len)
      out.string([str FOR len], 0, scr!)
      out.string("*c*n", 0, scr!)
    SDL.VideoInfo info:
    SEQ
      SDL.GetVideoInfo(info)
      print.VideoInfo(info, scr!)
    #ENDIF
    SDL.Quit()
:
