set-camera
camera-look
load-font
- render-text))
+ render-text)
+ #:export-syntax (glmatrix-block)
+ #:re-export (glPushMatrix
+ glPopMatrix))
+
;;; Screen
(define flags 0)
(define* (init-video width height bpp #:key (mode '2d) (title "") (fps 20))
- (cond ((not screen)
- (SDL_Init SDL_INIT_VIDEO)
- (let ((info (SDL_GetVideoInfo)))
- (SDL_GL_SetAttribute SDL_GL_DOUBLEBUFFER 1)
- (set! flags (+ SDL_OPENGL SDL_GL_DOUBLEBUFFER SDL_HWPALETTE SDL_RESIZABLE
- (if (= (assoc-ref info 'hw_available) 0) SDL_SWSURFACE SDL_HWSURFACE)
- (if (= (assoc-ref info 'blit_hw) 0) 0 SDL_HWACCEL)))
- (set! screen (SDL_SetVideoMode width height bpp flags))
- (set-screen-title! title)
- (set-frames-per-second! fps)
- (init-gl)
- (if (eq? mode '3d) (set-3d-mode) (set-2d-mode))))))
+ (SDL_Init SDL_INIT_VIDEO)
+ (let ((info (SDL_GetVideoInfo)))
+ (SDL_GL_SetAttribute SDL_GL_DOUBLEBUFFER 1)
+ (set! flags (+ SDL_OPENGL SDL_GL_DOUBLEBUFFER SDL_HWPALETTE SDL_RESIZABLE
+ (if (= (assoc-ref info 'hw_available) 0) SDL_SWSURFACE SDL_HWSURFACE)
+ (if (= (assoc-ref info 'blit_hw) 0) 0 SDL_HWACCEL)))
+ (set! screen (SDL_SetVideoMode width height bpp flags))
+ (set-screen-title! title)
+ (set-frames-per-second! fps)
+ (init-gl)
+ (if (eq? mode '3d) (set-3d-mode) (set-2d-mode))))
(define (get-screen-height)
(surface-h screen))
(glLoadIdentity)
(cond ((3d-mode?) (camera-look))))
+(define-macro (glmatrix-block . code)
+ `(let ((result #f))
+ (glPushMatrix)
+ (set! result (begin ,@code))
+ (glPopMatrix)
+ result))
+
;;; Lights