Changeset 26905 in project


Ignore:
Timestamp:
06/14/12 13:52:25 (9 years ago)
Author:
megane
Message:

sdl: added SDL_VideoInfo and SDL_GetVideoInfo

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/sdl/trunk/sdl.scm

    r26851 r26905  
    5151  sdl-surface-pixels
    5252  sdl-surface-pixels-length
     53  sdl-get-video-info
     54  sdl-video-info-hw-available
     55  sdl-video-info-wm-available
     56  sdl-video-info-blit-hw
     57  sdl-video-info-blit-hw-cc
     58  sdl-video-info-blit-hw-a
     59  sdl-video-info-blit-sw
     60  sdl-video-info-blit-sw-cc
     61  sdl-video-info-blit-sw-a
     62  sdl-video-info-blit-fill
     63  sdl-video-info-video-mem
     64  sdl-video-info-vfmt
     65  sdl-video-info-current-w
     66  sdl-video-info-current-h
    5367  sdl-get-clip-rect!
    5468  sdl-set-clip-rect!
     
    962976     (sdl-surface-pitch s)))
    963977
     978;;
     979;; SDL_VideoInfo
     980;;
     981
     982(define-record sdl-video-info pointer)
     983
     984(define-record-printer (sdl-video-info o out)
     985  (for-each (lambda (x) (display x out))
     986            (list "#<sdl-video-info "
     987                  (sdl-video-info-hw-available o) " "
     988                  (sdl-video-info-wm-available o) " "
     989                  (sdl-video-info-blit-hw o) " "
     990                  (sdl-video-info-blit-hw-cc o) " "
     991                  (sdl-video-info-blit-hw-a o) " "
     992                  (sdl-video-info-blit-sw o) " "
     993                  (sdl-video-info-blit-sw-cc o) " "
     994                  (sdl-video-info-blit-sw-a o) " "
     995                  (sdl-video-info-blit-fill o) " "
     996                  (sdl-video-info-video-mem o) " "
     997                  (sdl-video-info-vfmt o) " "
     998                  (sdl-video-info-current-w o) " "
     999                  (sdl-video-info-current-h o)
     1000                  ">")))
     1001
     1002(define-foreign-type SDL_VideoInfo (c-pointer "SDL_VideoInfo")
     1003  sdl-video-info-pointer
     1004  (pointer-to-record-lambda sdl-video-info))
     1005
     1006(define sdl-video-info-hw-available
     1007  (foreign-lambda* unsigned-integer ((SDL_VideoInfo vi))
     1008                   "return(vi->hw_available);"))
     1009(define sdl-video-info-wm-available
     1010  (foreign-lambda* unsigned-integer ((SDL_VideoInfo vi))
     1011                   "return(vi->wm_available);"))
     1012(define sdl-video-info-blit-hw
     1013  (foreign-lambda* unsigned-integer ((SDL_VideoInfo vi))
     1014                   "return(vi->blit_hw);"))
     1015(define sdl-video-info-blit-hw-cc
     1016  (foreign-lambda* unsigned-integer ((SDL_VideoInfo vi))
     1017                   "return(vi->blit_hw_CC);"))
     1018(define sdl-video-info-blit-hw-a
     1019  (foreign-lambda* unsigned-integer ((SDL_VideoInfo vi))
     1020                   "return(vi->blit_hw_A);"))
     1021(define sdl-video-info-blit-sw
     1022  (foreign-lambda* unsigned-integer ((SDL_VideoInfo vi))
     1023                   "return(vi->blit_sw);"))
     1024(define sdl-video-info-blit-sw-cc
     1025  (foreign-lambda* unsigned-integer ((SDL_VideoInfo vi))
     1026                   "return(vi->blit_sw_CC);"))
     1027(define sdl-video-info-blit-sw-a
     1028  (foreign-lambda* unsigned-integer ((SDL_VideoInfo vi))
     1029                   "return(vi->blit_sw_A);"))
     1030(define sdl-video-info-blit-fill
     1031  (foreign-lambda* unsigned-integer ((SDL_VideoInfo vi))
     1032                   "return(vi->blit_fill);"))
     1033(define sdl-video-info-video-mem
     1034  (foreign-lambda* unsigned-integer ((SDL_VideoInfo vi))
     1035                   "return(vi->video_mem);"))
     1036(define sdl-video-info-vfmt
     1037  (foreign-lambda* SDL_PixelFormat ((SDL_VideoInfo vi))
     1038                   "return(vi->vfmt);"))
     1039(define sdl-video-info-current-w
     1040  (foreign-lambda* integer ((SDL_VideoInfo vi))
     1041                   "return(vi->current_w);"))
     1042(define sdl-video-info-current-h
     1043  (foreign-lambda* integer ((SDL_VideoInfo vi))
     1044                   "return(vi->current_h);"))
     1045
     1046(define sdl-get-video-info
     1047  (foreign-lambda* SDL_VideoInfo ()
     1048                   "return(SDL_GetVideoInfo());"))
     1049
     1050
     1051;---------------------------------------------------------------------------
     1052
    9641053;; Modifies its second argument.
    9651054(define sdl-get-clip-rect! (foreign-lambda void "SDL_GetClipRect" SDL_Surface SDL_Rect))
Note: See TracChangeset for help on using the changeset viewer.