mirror of
https://github.com/rabbibotton/clog.git
synced 2025-12-06 02:30:42 -08:00
More work on webgl
This commit is contained in:
parent
2ac40e7603
commit
00446e4f83
2 changed files with 30 additions and 0 deletions
|
|
@ -78,7 +78,9 @@
|
|||
(bind-attribute-location generic-function)
|
||||
(program-parameter generic-function)
|
||||
(attribute-location generic-function)
|
||||
(uniform-location generic-function)
|
||||
(active-attribute generic-function)
|
||||
(active-uniform generic-function)
|
||||
(program-info-log generic-function)
|
||||
(link-program generic-function)
|
||||
(use-program generic-function)
|
||||
|
|
@ -620,10 +622,20 @@ For :GLENUM values"))
|
|||
(script-id obj)
|
||||
(script-id (gl obj)) glenum-param)))
|
||||
|
||||
(defgeneric attribute-location (clog-webgl-program name)
|
||||
(:documentation "Returns the location of an attribute variable in clog-program"))
|
||||
|
||||
(defmethod attribute-location ((obj clog-webgl-program) name)
|
||||
(query (gl obj) (format nil "getAttribLocation(~A, '~A')"
|
||||
(script-id obj) name)))
|
||||
|
||||
(defgeneric uniform-location (clog-webgl-program name)
|
||||
(:documentation "Returns the location of an uniform variable in clog-program"))
|
||||
|
||||
(defmethod uniform-location ((obj clog-webgl-program) name)
|
||||
(query (gl obj) (format nil "getUniformLocation(~A, '~A')"
|
||||
(script-id obj) name)))
|
||||
|
||||
(defmethod program-info-log ((obj clog-webgl-program))
|
||||
(query (gl obj) (format nil "getProgramInfoLog(~A)"
|
||||
(script-id obj))))
|
||||
|
|
@ -640,6 +652,20 @@ For :GLENUM values"))
|
|||
:connection-id (clog::connection-id obj)
|
||||
:html-id web-id)))
|
||||
|
||||
(defgeneric active-uniform (clog-webgl-program index)
|
||||
(:documentation "Query about unknown uniforms"))
|
||||
|
||||
(defmethod active-uniform ((obj clog-webgl-program) index)
|
||||
(let ((web-id (clog-connection:generate-id)))
|
||||
(js-execute obj (format nil "clog['~A']=~A.getActiveUniform(~A,~A)"
|
||||
web-id
|
||||
(script-id (gl obj)) (script-id obj) index))
|
||||
(make-instance 'clog-webgl-active-info
|
||||
:connection-id (clog::connection-id obj)
|
||||
:html-id web-id)))
|
||||
|
||||
;; WebGLRenderingContext.getAttachedShaders()
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Methods - clog-webgl-program
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
|
|
|||
|
|
@ -51,6 +51,10 @@ void main() {
|
|||
(let ((obj (active-attribute program n)))
|
||||
(format t "~A : Active Attribute - ~A ~A ~A"
|
||||
n (info-name obj) (info-size obj) (info-type obj))))
|
||||
(dotimes (n (parse-integer (program-parameter program :ACTIVE_UNIFORMS)))
|
||||
(let ((obj (active-uniform program n)))
|
||||
(format t "~A : Active Uniform - ~A ~A ~A"
|
||||
n (info-name obj) (info-size obj) (info-type obj))))
|
||||
(print (drawing-buffer-width gl))
|
||||
(print (drawing-buffer-height gl))
|
||||
(bind-buffer pos-buffer :ARRAY_BUFFER)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue