Skip to content

Commit

Permalink
Corrected example to use a viewport consistent with SDL to allow for
Browse files Browse the repository at this point in the history
correctly aligned UV coordinates (no need to flip and mirror)
  • Loading branch information
Failproofshark committed Jan 20, 2016
1 parent 55b9398 commit 542fe68
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions examples/gl-example.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
(gl-make-current my-window gl-context)
(gl:viewport 0 0 300 300)
;;the texture-surface is the actual loaded image object
(let* ((vertex-color-texture-array (create-gl-array :float #(1.0 1.0 1.0 0.0 1.0
1.0 1.0 1.0 1.0 1.0
1.0 1.0 1.0 0.0 0.0
1.0 1.0 1.0 1.0 0.0)))
(let* ((vertex-color-texture-array (create-gl-array :float #(1.0 1.0 1.0 0.0 0.0
1.0 1.0 1.0 1.0 0.0
1.0 1.0 1.0 0.0 1.0
1.0 1.0 1.0 1.0 1.0)))
(element-attribute-array (create-gl-array :unsigned-short #(0 1 2 3)))
(projection-matrix (kit.math:ortho-matrix 0 300 0 300 -10 10))
(projection-matrix (kit.math:ortho-matrix 0 300 300 0 -10 10))
(translation-matrix (sb-cga:translate* 150.0 150.0 0.0))
(font (sdl2-ttf:open-font (asdf:system-relative-pathname 'sdl2-ttf-examples "examples/PROBE_10PX_OTF.otf")
10))
Expand Down Expand Up @@ -63,8 +63,8 @@
(vertex-position-array (create-gl-array :float (make-array 8
:initial-contents `(,(- width) ,(- height)
,width ,(- height)
,(- width) ,height
,width ,height)))))
,(- width) ,height
,width ,height)))))
(gl:bind-vertex-array vao)

(gl:bind-buffer :array-buffer (first buffers))
Expand Down

0 comments on commit 542fe68

Please sign in to comment.