Changeset 20649 in project for demonstrations


Ignore:
Timestamp:
10/04/10 22:36:16 (9 years ago)
Author:
felix
Message:

makefile, bugfixes

Location:
demonstrations/foreign-functions
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • demonstrations/foreign-functions/squares-bind.scm

    r20640 r20649  
    22
    33
    4 (use foreigners bind)
     4(use foreigners bind extras)
    55
    66
     
    2020
    2121(define-foreign-variable SDL_INIT_VIDEO int)
    22 (define-foreign-variable SDL_DOUBLEBUF int)
     22(define-foreign-variable SDL_SWSURFACE int)
    2323(define-foreign-variable SDL_QUIT int)
    2424(define-foreign-variable SDL_KEYDOWN int)
     
    5050(bind #<<EOF
    5151
    52 int SDL_init(unsigned int);
    53 SDL_Surface *SDL_SetVideoMode(int, int, int, uint32_t);
    54 void SDL_FillRect(SDL_Surface *, SDL_Rect *, uint32_t);
     52int SDL_Init(unsigned int);
     53SDL_Surface *SDL_SetVideoMode(int, int, int, unsigned int);
     54void SDL_FillRect(SDL_Surface *, SDL_Rect *, unsigned int);
    5555void SDL_Flip(SDL_Surface *);
    5656___bool SDL_PollEvent(SDL_Event *);
     57unsigned int SDL_MapRGB(SDL_PixelFormat *, int, int, int);
     58
     59EOF
     60)
    5761
    5862
     
    8993
    9094(define (main #!optional (count 100))
    91   (let ((screen (SDL_SetVideoMode 800 600 0 SDL_DOUBLEBUF)))
     95  (let ((screen (SDL_SetVideoMode 800 600 0 SDL_SWSURFACE)))
    9296    (draw screen count)))
    9397
  • demonstrations/foreign-functions/squares-plain.scm

    r20640 r20649  
    11;;;; squares-plain.scm - draw random squares
     2
     3
     4(use extras)
    25
    36
     
    1720
    1821(define-foreign-variable SDL_INIT_VIDEO int)
    19 (define-foreign-variable SDL_DOUBLEBUF int)
     22(define-foreign-variable SDL_SWSURFACE unsigned-int32)
    2023(define-foreign-variable SDL_QUIT int)
    2124(define-foreign-variable SDL_KEYDOWN int)
     
    8790  (foreign-lambda bool "SDL_PollEvent" sdl-event))
    8891
     92(define SDL_MapRGB
     93  (foreign-lambda unsigned-int32 "SDL_MapRGB" sdl-pixel-format int int int))
     94
    8995
    9096;;; initialize SDL
     
    120126
    121127(define (main #!optional (count 100))
    122   (let ((screen (SDL_SetVideoMode 800 600 0 SDL_DOUBLEBUF)))
     128  (let ((screen (SDL_SetVideoMode 800 600 0 SDL_SWSURFACE)))
    123129    (draw screen count)))
    124130
Note: See TracChangeset for help on using the changeset viewer.