Comments (1)
After further investigation, I think it might not be a problem with cl-glfw but maybe with cl-opengl, or maybe I'm doing something wrong that I can't understand.
Compiling a file with this code in it is OK (does not signal a condition):
(defun toggle-wireframe-mode ()
(if (setf *wireframe-mode* (not *wireframe-mode*))
(gl:polygon-mode :front-and-back :line)
(gl:polygon-mode :front-and-back :fill)))
(def-key-callback key-callback (window key scancode action mod)
(declare (ignore window scancode mod))
(flet ((pressedp (keysym)
(and (eq key keysym) (eq action :press))))
(when (pressedp :escape)
(set-window-should-close))
(when (pressedp :semicolon)
(toggle-wireframe-mode))))
However, this form does signal the "failed AVER" error:
(def-key-callback key-callback (window key scancode action mod)
(declare (ignore window scancode mod))
;; (format t "~&~S" (list :key key :action action :mod mod))
(flet ((pressedp (keysym)
(and (eq key keysym) (eq action :press))))
(when (pressedp :escape)
(set-window-should-close))
(when (pressedp :semicolon)
(if (setf *wireframe-mode* (not *wireframe-mode*))
(gl:polygon-mode :front-and-back :line)
(gl:polygon-mode :front-and-back :fill)))))
Further poking around shows that compiling a def-key-callback form that has any OpenGL calls it in it will signal the error at compilation time. Example:
(def-key-callback key-callback (window key scancode action mod)
(declare (ignore window scancode mod key action))
(gl:polygon-mode :front-and-back :line))
Maybe something to do with no OpenGL context being available during compilation, but I don't see why that would be a problem since compiling the macro shouldn't actually make any OpenGL calls. Error occurs in SBCL but not CCL.
Anyway, I've got no further ideas and I'm not even sure if it's a problem for this library to fix. But I can take care of it by putting all OpenGL calls in their own functions and calling those functions from my key callback.
from cl-glfw3.
Related Issues (17)
- def-key-callback mod-keys, et al HOT 1
- Mac Issues HOT 16
- cffi-libffi issue on arm (Nvidia Tegra K1) HOT 1
- (ql:quickload :cl-glfw3) fails on LispWorks HOT 1
- does def callback block printing to repl? HOT 1
- Ubuntu: Floating-point-invalid-operation HOT 3
- load alternately name shared libary? HOT 1
- Just a thought about init/terminate HOT 3
- GL crashes when using version 4 HOT 2
- Window just hangs when I close it HOT 3
- window-hint is undefined outside of %glfw
- Add glfwSetWindowAttrib
- WITH-CONTEXT macro not changing the current context.
- [doubt] Do I need glew?
- the examples don't appear to be rendered as intended (example is provided)
- Does not install with Windows 7 + SBCL + quicklisp + MinGW? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cl-glfw3.