(setq running t)
(do () ((quit?))
(glClear (+ GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT))
- (glLoadIdentity)
-;(gluLookAt 0 0 50 0 0 0 0 1 0)
+ (to-origin)
(when (functionp game-code) (funcall game-code))
(SDL_GL_SwapBuffers)
(delay-frame)
(glRotatef rot 0 0 1))
(defun to-origin ()
- (glLoadIdentity))
+ (glLoadIdentity)
+ (cond ((3d-mode?) (camera-look))))
+
+(let ((camera-eye '(0 0 0)) (camera-center '(0 0 -100)) (camera-up '(0 1 0)))
+ (defun set-camera (&key eye center up)
+ (cond (eye (setq camera-eye eye)))
+ (cond (center (setq camera-center center)))
+ (cond (up (setq camera-up up))))
+
+ (defun camera-look ()
+ (apply #'gluLookAt (concatenate 'list camera-eye camera-center camera-up))))