File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change 290
290
(glEnable GL_LIGHTING)
291
291
(glMatrixMode GL_MODELVIEW)
292
292
(glLoadIdentity))
293
- (:2d-mode ()
293
+ (:2d-mode (&key (( :push apush) nil ) )
294
294
(glViewport 0 0 x ::width x ::height)
295
295
(glMatrixMode GL_PROJECTION)
296
+ (if apush (glPushMatrix))
296
297
(glLoadIdentity)
297
298
(glorthofv (float-vector 0 x ::width 0 x ::height -1.0 1.0 ))
298
299
(glDisable GL_DEPTH_TEST)
299
300
(glDisable GL_LIGHTING)
300
301
(glMatrixMode GL_MODELVIEW)
302
+ (if apush (glPushMatrix))
301
303
(glLoadIdentity))
304
+ (:pop-mode ()
305
+ (glMatrixMode GL_PROJECTION)
306
+ (glPopMatrix)
307
+ (glMatrixMode GL_MODELVIEW)
308
+ (glPopMatrix))
309
+
302
310
; (:clear (mask &key (color))
303
311
; (if color
304
312
; (glClearColorfv color))
331
339
332
340
(defmethod glviewsurface
333
341
(:point (x y)
334
- (send self :2d-mode )
342
+ (send self :2d-mode :push t )
335
343
(glBegin GL_POINTS)
336
344
(glVertex2fv (float-vector x (- x ::height y)))
337
345
(glEnd)
338
- (send self :3d -mode ))
346
+ (send self :pop -mode ))
339
347
(:line (x1 y1 x2 y2)
340
- (send self :2d-mode )
348
+ (send self :2d-mode :push t )
341
349
(glBegin GL_LINES)
342
350
(glvertex2fv (float-vector x1 (- x ::height y1)))
343
351
(glVertex2fv (float-vector x2 (- x ::height y2)))
344
352
(glEnd)
345
- (send self :3d -mode ))
353
+ (send self :pop -mode ))
346
354
(:3d-point (pos)
347
355
(glDisable GL_DEPTH_TEST)
348
356
(glDisable GL_LIGHTING)
365
373
(draw-face f nil nil ))
366
374
faces))
367
375
(:rectangle (x y w h)
368
- (send self :2d-mode )
376
+ (send self :2d-mode :push t )
369
377
(glBegin GL_POLYGON)
370
378
(glVertex2fv (float-vector x y))
371
379
(glVertex2fv (float-vector x (+ y h)))
372
380
(glVertex2fv (float-vector (+ x w) (+ y h)))
373
381
(glVertex2fv (float-vector (+ x w) y))
374
382
(glEnd)
375
- (send self :3d -mode ))
383
+ (send self :pop -mode ))
376
384
)
377
385
378
386
(defun geo ::default-viewsurface (&rest args)
You can’t perform that action at this time.
0 commit comments