3b / cl-opengl

cl-opengl is a set of CFFI bindings to the OpenGL, GLU and GLUT APIs.
http://common-lisp.net/project/cl-opengl/
Other
278 stars 59 forks source link

Crush in SLIME with SBCL #85

Closed komi1230 closed 4 years ago

komi1230 commented 5 years ago

When I make some program using CL-OpenGL, this program doesn't work in SLIME.

Source code looks be compiled, but the window doesn't open.

According to this page, adding (setf swank:*communication-style* :fd-handler) to swank.lisp may work.

I tried this, but does't work.

Is this SLIME bug ?

Thank you for your reading this issue :)

3b commented 5 years ago

What OS, and do you get any error messages? (either slime debugger, or messages in inferior-lisp buffer) Does it work if you run it without slime?

On MS Windows, you might need to manually tell it to show the first window you create an extra time due to some oddness in windows APIs. (with cl-glut, call (glut:show-window) after running the program, other libraries should have something similar)

On OSX, you need to create all windows in the initial thread, which is what the :fd-handler setting is trying to do. Another option is to run the program from the *inferior-lisp* buffer.

komi1230 commented 4 years ago

My environment is macOS Catalina and SBCL 1.5.7.55-ebed8766b.

My environment about SLIME is like this

~/.emacs.d
├── init.el 
└── slime
    ├── swank.lisp
    └── src/

I set (setf swank:*communication-style* :fd-handler) in this ~/.emacs.d/slime/swank.lisp.

And when I open SLIME and load (ql:quickload :cl-opengl), SLIME stops loading and crushes.

Do you have any advice ?

komi1230 commented 4 years ago

Finally I enabled SLIME to use OpenGL !

In (defstruct (connection ....) in swank.lisp, I set (communication-style :fd-handler :type (member nil :spawn :sigio :fd-handler).

And in (defun before-init (... in the bottom of swank.lisp, I set (setq *communication-style* nil).

Then, CL-OpenGL works in SLIME.

Thank you for your checking !