forked from borodust/bodge-glfw
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.lisp
More file actions
24 lines (22 loc) · 819 Bytes
/
Copy pathexample.lisp
File metadata and controls
24 lines (22 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
(cl:defpackage :glfw.example
(:use :cl)
(:export run))
(cl:in-package :glfw.example)
;;; Below is a short example of setting up a window and OpenGL context with GLFW
(defun run ()
;; Initialize the library
(when (= (%glfw:init) 0)
(error "Failed to init GLFW"))
;; Create a windowed mode window and its OpenGL context
(let ((window (%glfw:create-window 640 480 "Hello World" nil nil)))
(when (claw:null-pointer-p window)
(%glfw:terminate)
(error "Failed to create GLFW window"))
;; Make the window's context current
(%glfw:make-context-current window)
;; Loop until the user closes the window
(loop while (= (%glfw:window-should-close window) 0) do
(gl:clear :color-buffer-bit)
(%glfw:swap-buffers window)
(%glfw:poll-events))
(%glfw:terminate)))