Add a way to check if opengl is initialized or not
This commit is contained in:
parent
fa14b3dae4
commit
7a8f3117ed
2 changed files with 22 additions and 11 deletions
|
|
@ -10,7 +10,9 @@
|
|||
(:export :*major-version*
|
||||
:*minor-version*
|
||||
:*glsl-version*
|
||||
:gl-initialized-p
|
||||
:initialize
|
||||
:finalize
|
||||
:version-supported-p
|
||||
:gl-assert
|
||||
:gl-restart
|
||||
|
|
@ -21,7 +23,11 @@
|
|||
(defvar *minor-version* nil)
|
||||
(defvar *glsl-version* nil)
|
||||
|
||||
(defun initialize (version)
|
||||
(let ((initializedp))
|
||||
(defun gl-initialized-p ()
|
||||
initializedp)
|
||||
|
||||
(defun initialize (version)
|
||||
"Initialize the local opengl configuration.
|
||||
Store values like the drivers version."
|
||||
(if (/= version 0)
|
||||
|
|
@ -31,7 +37,11 @@ Store values like the drivers version."
|
|||
(setf *major-version* (gl:get-integer :major-version)
|
||||
*minor-version* (gl:get-integer :minor-version)))
|
||||
(setf *glsl-version* (with-input-from-string (in (gl:get-string :shading-language-version))
|
||||
(read in))))
|
||||
(read in)))
|
||||
(setf initializedp t))
|
||||
|
||||
(defun finalize ()
|
||||
(setf initializedp nil)))
|
||||
|
||||
(defun version-supported-p (version)
|
||||
(multiple-value-bind (maj min) (floor version 10)
|
||||
|
|
|
|||
|
|
@ -58,7 +58,8 @@ Destroy the opengl context and the related resources."
|
|||
(format t "Finalize Render module~%")
|
||||
(shader:destroy-all-shaders)
|
||||
(glop:destroy-window *window*)
|
||||
(setf *window* nil))
|
||||
(setf *window* nil)
|
||||
(gl-utils:finalize))
|
||||
|
||||
(defun update (delta-time)
|
||||
"Update the render module.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue