Changeset 30707 in project


Ignore:
Timestamp:
04/14/14 21:28:03 (7 years ago)
Author:
acharlton
Message:

Update example to take advantage of new glfw3 features

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/opengl-glew

    r30705 r30707  
    4848(use (prefix glfw3 glfw:) (prefix opengl-glew gl:))
    4949
    50 (glfw:init)
    51 (define *window* (glfw:create-window 640 480 "Example" #f #f))
    52 (glfw:make-context-current *window*)
    53 (gl:init)
    54 
    55 (print (gl:is-supported "GL_ARB_framebuffer_object"))
    56 
    57 (define *vertex* (gl:make-shader gl:+vertex-shader+
     50(define *vertex*
    5851#<<END
    5952#version 330
     
    6861}
    6962END
    70 ))
     63)
    7164
    72 (define *fragment* (gl:make-shader gl:+fragment-shader+
     65(define *fragment*
    7366#<<END
    7467#version 330
     
    7972}
    8073END
    81 ))
     74)
    8275
    83 ;If this is not zero, then everything is working
    84 (print
    85  (gl:make-program (list *vertex* *fragment*)))
     76(glfw:with-window (640 480 "Example" resizable: #f)
     77  (print (gl:supported? "GL_ARB_framebuffer_object"))
    8678
    87 (glfw:destroy-window *window*)
    88 (glfw:terminate)
     79  (set! *vertex* (gl:make-shader gl:+vertex-shader+ *vertex*))
     80  (set! *fragment* (gl:make-shader gl:+fragment-shader+ *fragment*))
     81
     82  ;;If this is not zero, then everything is working:
     83  (print (gl:make-program (list *vertex* *fragment*))))
    8984</enscript>
    9085
Note: See TracChangeset for help on using the changeset viewer.