SchemEnginE
Check-in [42bb52ac67]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
SHA1 Hash:42bb52ac670c115eca15c38620d8cd70b340fdf9
Date: 2012-04-21 10:17:01
User: Alexander
Comment:* APPLICATION has two parameter: SETTINGS and CALLBACKS
Tags And Properties
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to schemengine.scm

    96     96           (callback width height)]
    97     97       
    98     98   
    99     99       ;; --------------------------------------------------------------------------------------------
   100    100       ;; (GRAPH:SETUP settings)
   101    101       ;; Setup the OpenGL subsystem.
   102    102       ;; --------------------------------------------------------------------------------------------
   103         -    [define (graph:setup settings)
   104         -        (let ( [on-init     (at settings 'on-init:   (lambda () #t))]
   105         -               [on-resize   (at settings 'on-resize: (lambda (width height) #t))]
   106         -               [on-draw     (at settings 'on-draw:   (lambda () #t))]
   107         -               [on-update   (at settings 'on-update: (lambda (time) #t))])
          103  +    [define (graph:setup settings callbacks)
          104  +        (let ( [on-init     (at callbacks 'on-init:   (lambda () #t))]
          105  +               [on-resize   (at callbacks 'on-resize: (lambda (width height) #t))]
          106  +               [on-draw     (at callbacks 'on-draw:   (lambda () #t))]
          107  +               [on-update   (at callbacks 'on-update: (lambda (time) #t))])
   108    108           (glut:InitDisplayMode (+ glut:RGBA glut:DEPTH glut:DOUBLE))
   109    109           (glut:CreateWindow (at settings 'title: "SchemEnginE v1.0"))
   110    110           (if (at settings 'fullscreen:) (glut:FullScreen))
   111    111           (glut:ReshapeFunc [lambda (width height) (graph:on-resize on-resize width height)])
   112    112           (glut:IdleFunc    [lambda ()             (graph:on-idle   on-update)])
   113    113           (glut:DisplayFunc [lambda ()             (graph:on-draw   on-draw)])
   114    114           (set! started-time (time->seconds (current-time)))
................................................................................
   133    133       ;; ============================================================================================
   134    134       
   135    135   
   136    136       ;; --------------------------------------------------------------------------------------------
   137    137       ;; (APPLICATION settings)
   138    138       ;; Apply SETTINGS (configure system and set callbacks) and start the application).
   139    139       ;; --------------------------------------------------------------------------------------------
   140         -    [define (application settings)
   141         -        (graph:setup settings)
          140  +    [define (application settings callbacks)
          141  +        (graph:setup settings callbacks)
   142    142           (graph:loop)]
   143    143   ]

Changes to test.scm

   115    115           (set! z-rot (+ z-rot (* time (/ 360 40000))))
   116    116           #t)])
   117    117   
   118    118   
   119    119       ;; --------------------------------------------------------------------------------------------
   120    120       ;; Application Entry
   121    121       ;; --------------------------------------------------------------------------------------------
   122         -    (application `[
   123         -        (title:      . "SchemEnginE v1.0 Test")                     ; title of the window
   124         -        (width:      . 640)                                         ; width of the window
   125         -        (height:     . 480)                                         ; height of the window
   126         -        (fullscreen: . #f)                                          ; windowed mode
   127         -        (on-init:    . ,on-init)                                    ; initialization method
   128         -        (on-resize:  . ,on-resize)                                  ; resizing method
   129         -        (on-draw:    . ,on-draw)                                    ; drawing method
   130         -        (on-update:  . ,on-update)                                  ; updating method
   131         -        ])
          122  +    (application
          123  +        `[  (title:      . "SchemEnginE v1.0 Test")                 ; title of the window
          124  +            (width:      . 640)                                     ; width of the window
          125  +            (height:     . 480)                                     ; height of the window
          126  +            (fullscreen: . #f)]                                     ; windowed mode
          127  +        `[  (on-init:    . ,on-init)                                ; initialization method
          128  +            (on-resize:  . ,on-resize)                              ; resizing method
          129  +            (on-draw:    . ,on-draw)                                ; drawing method
          130  +            (on-update:  . ,on-update)])                            ; updating method
   132    131   ]