Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GL crashes when using version 4 #31

Closed
aodhneine opened this issue Sep 6, 2019 · 2 comments
Closed

GL crashes when using version 4 #31

aodhneine opened this issue Sep 6, 2019 · 2 comments

Comments

@aodhneine
Copy link

I am trying to run simple example and I want to use OpenGL version 4.
However, when I set :context-version-major 4 in with-window, GL crashes.
I have GLFW 3.3 installed.

Code which I'm running:

(defun main ()
  (glfw:with-init
    (glfw:with-window (:width 640 :height 480 :title "CL-GLFW3"
                       :context-version-major 4)
      (setf %gl:*gl-get-proc-address* #'glfw:get-proc-address)
      (gl:clear-color 0 0.5 1 1)
      (loop until (glfw:window-should-close-p)
            do ((lambda ()
                  (gl:clear :color-buffer)
                  (gl:color 1 1 1 1)
                  (gl:rect 0 0 1 1)))
            do (glfw:swap-buffers)
            do (glfw:poll-events)))))

Error report:

debugger invoked on a CL-OPENGL-BINDINGS:OPENGL-ERROR in thread
#<THREAD "main thread" RUNNING {10004F04C3}>:
  OpenGL signalled (1282 . INVALID-OPERATION) from COLOR-4F.

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [CONTINUE] Continue
  1: [ABORT   ] Exit debugger, returning to top level.

(CL-OPENGL-BINDINGS:CHECK-ERROR #<unavailable argument>)
   source: (RESTART-CASE (ERROR 'OPENGL-ERROR :ERROR-CODE
                                (CONS ERROR-CODE
                                      (CFFI:FOREIGN-ENUM-KEYWORD
                                       'CL-OPENGL-BINDINGS:ENUM ERROR-CODE))
                                :ERROR-CONTEXT CONTEXT)
             (CONTINUE NIL :REPORT "Continue"))
@remexre
Copy link

remexre commented Sep 7, 2019

Well, glColor was removed from OpenGL 4...

@aodhneine
Copy link
Author

Yes, stupid me. Never checked if I'm using existing functions.
After removing this it works, so not an issue.
Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants