id
int64 0
45.1k
| file_name
stringlengths 4
68
| file_path
stringlengths 14
193
| content
stringlengths 32
9.62M
| size
int64 32
9.62M
| language
stringclasses 1
value | extension
stringclasses 6
values | total_lines
int64 1
136k
| avg_line_length
float64 3
903k
| max_line_length
int64 3
4.51M
| alphanum_fraction
float64 0
1
| repo_name
stringclasses 779
values | repo_stars
int64 0
882
| repo_forks
int64 0
108
| repo_open_issues
int64 0
90
| repo_license
stringclasses 8
values | repo_extraction_date
stringclasses 146
values | sha
stringlengths 64
64
| __index_level_0__
int64 0
45.1k
| exdup_ids_cmlisp_stkv2
sequencelengths 1
47
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
21,705 | cairo.lisp | rheaplex_minara/lib/cl-cairo2/cairo.lisp | (in-package :cl-cairo2)
;; is this really needed? OS should set this up properly
#+darwin (pushnew "/usr/local/lib/" *foreign-library-directories*)
#+darwin (pushnew "/opt/local/lib/" *foreign-library-directories*)
;;;; The library search order should look like below because on Mac both
;;;; 'darwin' and 'unix' are defined in *feature* and we want to load .dylib
;;;; version of library.
(define-foreign-library :libcairo
(cffi-features:darwin "libcairo.dylib")
(cffi-features:unix "libcairo.so")
(cffi-features:windows "libcairo-2.dll"))
(load-foreign-library :libcairo)
(defun deg-to-rad (deg)
"Convert degrees to radians."
(* deg (/ pi 180.0d0)))
(defgeneric destroy (object)
(:documentation "Destroys Cairo object."))
(export 'destroy)
;;;;
;;;; commonly used macros/functions
;;;;
(defun prepend-intern (prefix name &key (replace-dash t) (suffix ""))
"Create and intern symbol PREFIXNAME from NAME, optionally
replacing dashes in name. PREFIX is converted to upper case.
If given, suffix is appended at the end."
(let ((name-as-string (symbol-name name)))
(when replace-dash
(setf name-as-string (substitute #\_ #\- name-as-string))
suffix (substitute #\_ #\- suffix))
(intern (concatenate 'string (string-upcase prefix)
name-as-string (string-upcase suffix)))))
(defun copy-double-vector-to-pointer (vector pointer)
"Copies vector of double-floats to a memory location."
(dotimes (i (length vector))
(setf (mem-aref pointer :double i) (coerce (aref vector i) 'double-float))))
(defun copy-pointer-to-double-vector (length pointer)
"Copies the contents of a memory location to a vector of a double-floats."
(let ((vector (make-array length)))
(dotimes (i length vector)
(setf (aref vector i) (mem-aref pointer :double i)))))
| 1,817 | Common Lisp | .lisp | 40 | 42.35 | 80 | 0.715014 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 1c72e85820a1866dbc5793a41549934618f0c9a9cdd03f3158b84ba209c8870b | 21,705 | [
-1
] |
21,706 | xlib-context.lisp | rheaplex_minara/lib/cl-cairo2/xlib-context.lisp | (in-package :cl-cairo2)
;; constants for communicating with the signal window
(defconstant +destroy-message+ 4072) ; just some random constant
(defconstant +refresh-message+ 2495) ; ditto
(defvar *xlib-context-count* 0 "window counter for autogenerating names")
(defun next-xlib-context-name ()
"Return an autogenerated window name using *xlib-context-count*."
(format nil "cl-cairo2 ~a" (incf *xlib-context-count*)))
;; code to make threads, please extend with your own Lisp if needed
;; testing is welcome, I only tested cmucl and sbcl
(defun start-thread (function name)
#+allegro (mp:process-run-function name function)
#+armedbear (ext:make-thread function :name name)
#+cmu (mp:make-process function :name name)
#+lispworks (mp:process-run-function name nil function)
#+openmcl (ccl:process-run-function name function)
#+sbcl (sb-thread:make-thread function :name name))
;; we create this definition manually, SWIG just messes things up
(defcfun ("cairo_xlib_surface_create" cairo_xlib_surface_create) cairo_surface_t
(display display)
(drawable drawable)
(visual visual)
(width :int)
(height :int))
;; The class for an x11 context. Each context has a separate display
;; queue, window and an event loop in a separate thread. Once the
;; event loop is started, communication with the thread is done via
;; X11 ClientNotify events (see wacky constants above).
(defclass xlib-context (context)
((display :initarg :display)
(wm-delete-window)
(window)
(signal-window)
(pixmap)
(graphics-context)
(thread)
(sync-counter :initform 0 :accessor sync-counter)))
(defun refresh-xlib-context (xlib-context)
"Copy the contents of the pixmap to the window. This function is
meant for internal use in the cl-cairo2 package."
(with-slots (display width height window pixmap graphics-context) xlib-context
(xcopyarea display pixmap window graphics-context
0 0 width height 0 0)
(xsync display 1)))
(defun create-xlib-context (width height &key
(display-name nil)
(window-name (next-xlib-context-name)))
(let ((display (xopendisplay (if display-name display-name (null-pointer)))))
(when (null-pointer-p display)
(error "couldn't open display ~a" display-name))
(let ((xlib-context (make-instance 'xlib-context
:display display
:width width
:height height)))
(flet ((event-loop ()
(with-slots (display (this-window window) signal-window
pixmap
wm-delete-window graphics-context)
xlib-context
(let ((wm-protocols (xinternatom display "WM_PROTOCOLS" 1)))
(with-foreign-object (xev :long 24)
(do ((got-close-signal nil))
(got-close-signal)
;; get next event
(xnextevent display xev)
;; decipher structure, at least partially
(with-foreign-slots ((type window serial) xev xanyevent)
;; action based on event type
(cond
;; expose events
((and (= type 12) (= window this-window))
(refresh-xlib-context xlib-context))
;; clientnotify event
((= type 33)
(with-foreign-slots ((message-type data0) xev
xclientmessageevent)
(cond
((or (and (= window signal-window)
(= data0 +destroy-message+))
(and (= window this-window)
(= message-type wm-protocols)
(= data0 wm-delete-window)))
(setf got-close-signal t))
((and (= window signal-window)
(= data0 +refresh-message+))
(refresh-xlib-context xlib-context)))))))))))
;; close down everything
(with-slots (display pixmap window signal-window pointer)
xlib-context
(xsynchronize display 1)
(let ((saved-pointer pointer))
(setf pointer nil) ; invalidate first so it can't be used
;; (cairo_destroy saved-pointer)
)
(xfreepixmap display pixmap)
(xdestroywindow display window)
(xdestroywindow display signal-window)
(xclosedisplay display))))
;; initialize
(xsynchronize display 1)
(let* ((screen (xdefaultscreen display))
(root (xdefaultrootwindow display))
(visual (xdefaultvisual display screen))
(depth (xdefaultdepth display screen))
(whitepixel (xwhitepixel display screen)))
(with-slots (window pixmap signal-window thread wm-delete-window
pointer graphics-context) xlib-context
;; create signal window and window
(setf window
(create-window display root width height 'inputoutput visual
whitepixel
(logior exposuremask
structurenotifymask)
t))
(setf signal-window
(create-window display root 1 1 'inputonly visual
whitepixel 0 nil))
;; create pixmap
(setf pixmap
(xcreatepixmap display window width height depth))
;; create graphics-context
(setf graphics-context
(xcreategc display pixmap 0 (null-pointer)))
;; set size hints on window (most window managers will respect this)
(let ((hints (xallocsizehints)))
(with-foreign-slots ((flags x y min-width min-height
max-width max-height)
hints
xsizehints)
;; we only set the first four values because old WM's might
;; get confused if we don't, they should be ignored
(setf flags (logior pminsize pmaxsize)
x 0
y 0
(foreign-slot-value hints 'xsizehints 'width) width
(foreign-slot-value hints 'xsizehints 'height) height
min-width width
max-width width
min-height height
max-height height)
(xsetwmnormalhints display window hints)
(xfree hints)))
;; intern atom for window closing, set protocol on window
(setf wm-delete-window
(xinternatom display "WM_DELETE_WINDOW" 1))
(with-foreign-object (prot 'xatom)
(setf (mem-aref prot 'xatom) wm-delete-window)
(xsetwmprotocols display window prot 1))
;; store name
(xstorename display window window-name)
;; create cairo context
(let ((surface (cairo_xlib_surface_create display pixmap visual
width height)))
(setf pointer (cairo_create surface))
;; !!! error checking
(cairo_surface_destroy surface))
;; map window
(xmapwindow display window)
;; end of synchronizing
(xsynchronize display 0)
;; start thread
(setf thread
(start-thread
#'event-loop
(format nil "thread for display ~a" display-name))))))
;; return context
xlib-context)))
(defun send-message-to-signal-window (xlib-context message)
"Send the desired message to the context window."
(with-slots (pointer (display-pointer display) signal-window) xlib-context
(unless pointer
(warn "context is not active, can't send message to window")
(return-from send-message-to-signal-window))
(with-foreign-object (xev :long 24)
(with-foreign-slots
((type display window message-type format data0)
xev xclientmessageevent)
(setf type 33) ; clientnotify
(setf display display-pointer)
(setf window signal-window)
(setf message-type 0)
(setf format 32)
(setf data0 message)
(xsendevent display-pointer signal-window 0 0 xev))
(xsync display-pointer 1))))
(defmethod destroy ((object xlib-context))
(send-message-to-signal-window object +destroy-message+))
(defmethod sync ((object xlib-context))
(when (zerop (sync-counter object))
(send-message-to-signal-window object +refresh-message+)))
(defmethod sync-lock ((object xlib-context))
(incf (sync-counter object)))
(defmethod sync-unlock ((object xlib-context))
(with-slots (sync-counter) object
(when (plusp sync-counter)
(decf sync-counter)))
(sync object))
(defmethod sync-reset ((object xlib-context))
(setf (sync-counter object) 0)
(sync object))
| 7,759 | Common Lisp | .lisp | 200 | 33.42 | 80 | 0.692787 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 0d15a81c0243b6cac41c58de6bfe3188a1d2af7d4d7699dafa27c00aed72f281 | 21,706 | [
-1
] |
21,707 | surface.lisp | rheaplex_minara/lib/cl-cairo2/surface.lisp | (in-package :cl-cairo2)
;;;;
;;;; Notes
;;;; - functions that write to/read from streams are not implemented
;;;;
;;;; class cairo-object
;;;;
(defgeneric get-width (object)
(:documentation "return the width of an object"))
(defgeneric get-height (object)
(:documentation "return the height of an object"))
(defgeneric pixel-based-p (object)
(:documentation "return t iff the object uses a pixel-based backend"))
(defclass cairo-object ()
((pointer :initarg :pointer :initform nil :reader get-pointer)))
;;;;
;;
;; the following two functions serve as wrappers for cairo's status and destroy functions.
;; they are needed by the general-purpose macros below and implemented by the surface,
;; context and pattern classes.
;;
(defgeneric lowlevel-status (object)
(:documentation "calls the approriate cairo function for getting this object's status and looks it up"))
(defgeneric lowlevel-destroy (object)
(:documentation "calls the approriate cairo function for destroying this object"))
(defmacro with-alive-object ((object pointer) &body body)
"Execute body with pointer pointing to cairo object, if nil,
signal error."
(let ((pointer-name pointer))
`(with-slots ((,pointer-name pointer)) ,object
(if ,pointer-name
(progn ,@body)
(warn "surface is not alive")))))
(defmacro with-checked-status (object &body body)
"Check status of cairo-object after executing body."
(let ((status (gensym)))
`(multiple-value-prog1 (progn ,@body)
(let ((,status (lowlevel-status ,object)))
(unless (eq ,status :success)
(warn "function returned with status ~a." ,status))))))
(defmacro with-cairo-object ((object pointer) &body body)
"Execute body with pointer pointing to surface, and check status."
`(with-alive-object (,object ,pointer)
(with-checked-status ,object
,@body)))
(defmethod destroy ((object cairo-object))
(with-alive-object (object pointer)
(lowlevel-destroy object)
(setf pointer nil))
;; deregister finalizer
(tg:cancel-finalization object))
;;;;
;;;; class surface
;;;;
;;;;
(defclass surface (cairo-object)
((width :initarg :width :reader get-width)
(height :initarg :height :reader get-height)
(pixel-based-p :initarg :pixel-based-p :reader pixel-based-p)))
(defmethod lowlevel-destroy ((surface surface))
(cairo_surface_destroy (get-pointer surface)))
(defmethod lowlevel-status ((surface surface))
(with-alive-object (surface pointer)
(lookup-cairo-enum (cairo_surface_status (get-pointer surface)) table-status)))
(defun new-surface-with-check (pointer width height &optional (pixel-based-p nil))
"Check if the creation of new surface was successful, if so, return new class."
(let ((surface (make-instance 'surface :width width :height height
:pixel-based-p pixel-based-p)))
(with-checked-status surface
(setf (slot-value surface 'pointer) pointer)
;; register finalizer
(tg:finalize surface #'(lambda () (lowlevel-destroy surface)))
;; return surface
surface)))
;;;;
;;;; Macros to create surfaces (that are written into files) and
;;;; direct creation of contexts for these surfaces.
;;;;
(defmacro define-create-surface (type)
"Define the function create-<type>-surface."
`(defun ,(prepend-intern "create-" type :replace-dash nil :suffix "-surface")
(filename width height)
(new-surface-with-check
(,(prepend-intern "cairo_" type :replace-dash nil
:suffix "_surface_create")
filename width height)
width height)))
;;;;
;;;; PDF surface
;;;;
(define-create-surface pdf)
;;;;
;;;; PostScript surface
;;;;
(define-create-surface ps)
;;;;
;;;; SVG surface
;;;;
(define-create-surface svg)
;;;;
;;;; image surface
;;;;
(defun create-image-surface (format width height)
(new-surface-with-check
(cairo_image_surface_create (lookup-enum format table-format)
width height)
width height t))
(defun create-image-surface-for-data (data format width height stride)
(new-surface-with-check
(cairo_image_surface_create_for_data data (lookup-enum format table-format)
width height stride)
width height t))
(defun get-bytes-per-pixel (format)
(case format
(format-argb32 4)
(format-rgb24 3)
(format-a8 1)
(otherwise (error (format nil "unknown format: ~a" format))))) ;todo: how does format-a1 fit in here?
(defun image-surface-get-data (surface &key (pointer-only nil))
"get the pointer referencing the image data directly. Then return it immediately when pointer-only is t.
Otherwise, return the copy of the image data along with the pointer."
(with-cairo-object (surface pointer)
(let ((data-pointer (cairo_image_surface_get_data pointer)))
#+sbcl
(when (sb-sys:sap= data-pointer (sb-sys:int-sap 0))
(warn "null surface data pointer returned."))
(if pointer-only
data-pointer
(let* ((width (image-surface-get-width surface))
(height (image-surface-get-height surface))
(bytes-per-pixel (get-bytes-per-pixel (image-surface-get-format surface)))
(buffer (make-array (* width height bytes-per-pixel) :element-type '(unsigned-byte 8) :fill-pointer 0)))
(loop for i from 0 below (* width height bytes-per-pixel) do
(vector-push-extend (cffi:mem-ref data-pointer :uint8 i) buffer))
(values buffer data-pointer))))))
(defun image-surface-get-format (surface)
(with-cairo-object (surface pointer)
(lookup-cairo-enum (cairo_image_surface_get_format pointer) table-format)))
(defun image-surface-get-width (surface)
(with-cairo-object (surface pointer)
(cairo_image_surface_get_width pointer)))
(defun image-surface-get-height (surface)
(with-cairo-object (surface pointer)
(cairo_image_surface_get_height pointer)))
(defun image-surface-get-stride (surface)
(with-cairo-object (surface pointer)
(cairo_image_surface_get_stride pointer)))
;;;;
;;;; PNG surfaces
;;;;
(defun image-surface-create-from-png (filename)
(let ((surface
(new-surface-with-check (cairo_image_surface_create_from_png filename)
0 0)))
(with-slots (width height) surface
(setf width (image-surface-get-width surface)
height (image-surface-get-height surface))
surface)))
(defun surface-write-to-png (surface filename)
(with-cairo-object (surface pointer)
(let ((status (cairo_surface_write_to_png pointer filename)))
(unless (eq (lookup-cairo-enum status table-status) :success)
(warn "function returned with status ~a." status)))))
(defmacro with-png-surface ((png-file surface-name) &body body)
`(let ((,surface-name (image-surface-create-from-png ,png-file)))
(unwind-protect (progn ,@body)
(destroy ,surface-name))))
| 6,697 | Common Lisp | .lisp | 167 | 36.658683 | 109 | 0.717019 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 68be315c926590f3e46edbdd4d78be6002f673c938c3c33cc035bbe7bc37891a | 21,707 | [
-1
] |
21,708 | cl-cairo2-swig.lisp | rheaplex_minara/lib/cl-cairo2/cl-cairo2-swig.lisp |
(in-package :cl-cairo2)
;; typedefs: we don't want to create all of them automatically,
;; because typedefs for structures confuse with-foreign-slots
;; the ones we don't want are commented out
(cffi:defctype cairo_bool_t :int)
(cffi:defctype cairo_t :pointer)
(cffi:defctype cairo_surface_t :pointer)
;; (cffi:defctype cairo_matrix_t :pointer)
(cffi:defctype cairo_pattern_t :pointer)
(cffi:defctype cairo_destroy_func_t :pointer)
(cffi:defctype cairo_user_data_key_t :pointer)
(cffi:defctype cairo_write_func_t :pointer)
(cffi:defctype cairo_read_func_t :pointer)
;; (cffi:defctype cairo_rectangle_t :pointer)
(cffi:defctype cairo_rectangle_list_t :pointer)
(cffi:defctype cairo_scaled_font_t :pointer)
(cffi:defctype cairo_font_face_t :pointer)
(cffi:defctype cairo_font_options_t :pointer)
(cffi:defctype cairo_path_data_t :pointer)
(cffi:defctype cairo_path_t :pointer)
;;;SWIG wrapper code starts here
(cl:defmacro defanonenum (&body enums)
"Converts anonymous enums to defconstants."
`(cl:progn ,@(cl:loop for value in enums
for index = 0 then (cl:1+ index)
when (cl:listp value) do (cl:setf index (cl:second value)
value (cl:first value))
collect `(cl:defconstant ,value ,index))))
(cl:eval-when (:compile-toplevel :load-toplevel)
(cl:unless (cl:fboundp 'swig-lispify)
(cl:defun swig-lispify (name flag cl:&optional (package cl:*package*))
(cl:labels ((helper (lst last rest cl:&aux (c (cl:car lst)))
(cl:cond
((cl:null lst)
rest)
((cl:upper-case-p c)
(helper (cl:cdr lst) 'upper
(cl:case last
((lower digit) (cl:list* c #\- rest))
(cl:t (cl:cons c rest)))))
((cl:lower-case-p c)
(helper (cl:cdr lst) 'lower (cl:cons (cl:char-upcase c) rest)))
((cl:digit-char-p c)
(helper (cl:cdr lst) 'digit
(cl:case last
((upper lower) (cl:list* c #\- rest))
(cl:t (cl:cons c rest)))))
((cl:char-equal c #\_)
(helper (cl:cdr lst) '_ (cl:cons #\- rest)))
(cl:t
(cl:error "Invalid character: ~A" c)))))
(cl:let ((fix (cl:case flag
((constant enumvalue) "+")
(variable "*")
(cl:t ""))))
(cl:intern
(cl:concatenate
'cl:string
fix
(cl:nreverse (helper (cl:concatenate 'cl:list name) cl:nil cl:nil))
fix)
package))))))
;;;SWIG wrapper code ends here
(cl:defconstant CAIRO_VERSION_MAJOR 1)
(cl:defconstant CAIRO_VERSION_MINOR 6)
(cl:defconstant CAIRO_VERSION_MICRO 4)
(cl:defconstant CAIRO_HAS_SVG_SURFACE 1)
(cl:defconstant CAIRO_HAS_PDF_SURFACE 1)
(cl:defconstant CAIRO_HAS_PS_SURFACE 1)
(cl:defconstant CAIRO_HAS_PNG_FUNCTIONS 1)
(cl:defconstant CAIRO_FORMAT_RGB16_565 4)
(cffi:defcfun ("cairo_version" cairo_version) :int)
(cffi:defcfun ("cairo_version_string" cairo_version_string) :string)
(cffi:defcstruct cairo_matrix_t
(xx my-double)
(yx my-double)
(xy my-double)
(yy my-double)
(x0 my-double)
(y0 my-double))
(cffi:defcstruct cairo_user_data_key_t
(unused :int))
(cffi:defcenum cairo_status_t
(:CAIRO_STATUS_SUCCESS 0)
:CAIRO_STATUS_NO_MEMORY
:CAIRO_STATUS_INVALID_RESTORE
:CAIRO_STATUS_INVALID_POP_GROUP
:CAIRO_STATUS_NO_CURRENT_POINT
:CAIRO_STATUS_INVALID_MATRIX
:CAIRO_STATUS_INVALID_STATUS
:CAIRO_STATUS_NULL_POINTER
:CAIRO_STATUS_INVALID_STRING
:CAIRO_STATUS_INVALID_PATH_DATA
:CAIRO_STATUS_READ_ERROR
:CAIRO_STATUS_WRITE_ERROR
:CAIRO_STATUS_SURFACE_FINISHED
:CAIRO_STATUS_SURFACE_TYPE_MISMATCH
:CAIRO_STATUS_PATTERN_TYPE_MISMATCH
:CAIRO_STATUS_INVALID_CONTENT
:CAIRO_STATUS_INVALID_FORMAT
:CAIRO_STATUS_INVALID_VISUAL
:CAIRO_STATUS_FILE_NOT_FOUND
:CAIRO_STATUS_INVALID_DASH
:CAIRO_STATUS_INVALID_DSC_COMMENT
:CAIRO_STATUS_INVALID_INDEX
:CAIRO_STATUS_CLIP_NOT_REPRESENTABLE
:CAIRO_STATUS_TEMP_FILE_ERROR
:CAIRO_STATUS_INVALID_STRIDE)
(cffi:defcenum cairo_content_t
(:CAIRO_CONTENT_COLOR #x1000)
(:CAIRO_CONTENT_ALPHA #x2000)
(:CAIRO_CONTENT_COLOR_ALPHA #x3000))
(cffi:defcfun ("cairo_create" cairo_create) :pointer
(target :pointer))
(cffi:defcfun ("cairo_reference" cairo_reference) :pointer
(cr :pointer))
(cffi:defcfun ("cairo_destroy" cairo_destroy) :void
(cr :pointer))
(cffi:defcfun ("cairo_get_reference_count" cairo_get_reference_count) :unsigned-int
(cr :pointer))
(cffi:defcfun ("cairo_get_user_data" cairo_get_user_data) :pointer
(cr :pointer)
(key :pointer))
(cffi:defcfun ("cairo_set_user_data" cairo_set_user_data) cairo_status_t
(cr :pointer)
(key :pointer)
(user_data :pointer)
(destroy :pointer))
(cffi:defcfun ("cairo_save" cairo_save) :void
(cr :pointer))
(cffi:defcfun ("cairo_restore" cairo_restore) :void
(cr :pointer))
(cffi:defcfun ("cairo_push_group" cairo_push_group) :void
(cr :pointer))
(cffi:defcfun ("cairo_push_group_with_content" cairo_push_group_with_content) :void
(cr :pointer)
(content cairo_content_t))
(cffi:defcfun ("cairo_pop_group" cairo_pop_group) :pointer
(cr :pointer))
(cffi:defcfun ("cairo_pop_group_to_source" cairo_pop_group_to_source) :void
(cr :pointer))
(cffi:defcenum cairo_operator_t
:CAIRO_OPERATOR_CLEAR
:CAIRO_OPERATOR_SOURCE
:CAIRO_OPERATOR_OVER
:CAIRO_OPERATOR_IN
:CAIRO_OPERATOR_OUT
:CAIRO_OPERATOR_ATOP
:CAIRO_OPERATOR_DEST
:CAIRO_OPERATOR_DEST_OVER
:CAIRO_OPERATOR_DEST_IN
:CAIRO_OPERATOR_DEST_OUT
:CAIRO_OPERATOR_DEST_ATOP
:CAIRO_OPERATOR_XOR
:CAIRO_OPERATOR_ADD
:CAIRO_OPERATOR_SATURATE)
(cffi:defcfun ("cairo_set_operator" cairo_set_operator) :void
(cr :pointer)
(op cairo_operator_t))
(cffi:defcfun ("cairo_set_source" cairo_set_source) :void
(cr :pointer)
(source :pointer))
(cffi:defcfun ("cairo_set_source_rgb" cairo_set_source_rgb) :void
(cr :pointer)
(red my-double)
(green my-double)
(blue my-double))
(cffi:defcfun ("cairo_set_source_rgba" cairo_set_source_rgba) :void
(cr :pointer)
(red my-double)
(green my-double)
(blue my-double)
(alpha my-double))
(cffi:defcfun ("cairo_set_source_surface" cairo_set_source_surface) :void
(cr :pointer)
(surface :pointer)
(x my-double)
(y my-double))
(cffi:defcfun ("cairo_set_tolerance" cairo_set_tolerance) :void
(cr :pointer)
(tolerance my-double))
(cffi:defcenum cairo_antialias_t
:CAIRO_ANTIALIAS_DEFAULT
:CAIRO_ANTIALIAS_NONE
:CAIRO_ANTIALIAS_GRAY
:CAIRO_ANTIALIAS_SUBPIXEL)
(cffi:defcfun ("cairo_set_antialias" cairo_set_antialias) :void
(cr :pointer)
(antialias cairo_antialias_t))
(cffi:defcenum cairo_fill_rule_t
:CAIRO_FILL_RULE_WINDING
:CAIRO_FILL_RULE_EVEN_ODD)
(cffi:defcfun ("cairo_set_fill_rule" cairo_set_fill_rule) :void
(cr :pointer)
(fill_rule cairo_fill_rule_t))
(cffi:defcfun ("cairo_set_line_width" cairo_set_line_width) :void
(cr :pointer)
(width my-double))
(cffi:defcenum cairo_line_cap_t
:CAIRO_LINE_CAP_BUTT
:CAIRO_LINE_CAP_ROUND
:CAIRO_LINE_CAP_SQUARE)
(cffi:defcfun ("cairo_set_line_cap" cairo_set_line_cap) :void
(cr :pointer)
(line_cap cairo_line_cap_t))
(cffi:defcenum cairo_line_join_t
:CAIRO_LINE_JOIN_MITER
:CAIRO_LINE_JOIN_ROUND
:CAIRO_LINE_JOIN_BEVEL)
(cffi:defcfun ("cairo_set_line_join" cairo_set_line_join) :void
(cr :pointer)
(line_join cairo_line_join_t))
(cffi:defcfun ("cairo_set_dash" cairo_set_dash) :void
(cr :pointer)
(dashes :pointer)
(num_dashes :int)
(offset my-double))
(cffi:defcfun ("cairo_set_miter_limit" cairo_set_miter_limit) :void
(cr :pointer)
(limit my-double))
(cffi:defcfun ("cairo_translate" cairo_translate) :void
(cr :pointer)
(tx my-double)
(ty my-double))
(cffi:defcfun ("cairo_scale" cairo_scale) :void
(cr :pointer)
(sx my-double)
(sy my-double))
(cffi:defcfun ("cairo_rotate" cairo_rotate) :void
(cr :pointer)
(angle my-double))
(cffi:defcfun ("cairo_transform" cairo_transform) :void
(cr :pointer)
(matrix :pointer))
(cffi:defcfun ("cairo_set_matrix" cairo_set_matrix) :void
(cr :pointer)
(matrix :pointer))
(cffi:defcfun ("cairo_identity_matrix" cairo_identity_matrix) :void
(cr :pointer))
(cffi:defcfun ("cairo_user_to_device" cairo_user_to_device) :void
(cr :pointer)
(x :pointer)
(y :pointer))
(cffi:defcfun ("cairo_user_to_device_distance" cairo_user_to_device_distance) :void
(cr :pointer)
(dx :pointer)
(dy :pointer))
(cffi:defcfun ("cairo_device_to_user" cairo_device_to_user) :void
(cr :pointer)
(x :pointer)
(y :pointer))
(cffi:defcfun ("cairo_device_to_user_distance" cairo_device_to_user_distance) :void
(cr :pointer)
(dx :pointer)
(dy :pointer))
(cffi:defcfun ("cairo_new_path" cairo_new_path) :void
(cr :pointer))
(cffi:defcfun ("cairo_move_to" cairo_move_to) :void
(cr :pointer)
(x my-double)
(y my-double))
(cffi:defcfun ("cairo_new_sub_path" cairo_new_sub_path) :void
(cr :pointer))
(cffi:defcfun ("cairo_line_to" cairo_line_to) :void
(cr :pointer)
(x my-double)
(y my-double))
(cffi:defcfun ("cairo_curve_to" cairo_curve_to) :void
(cr :pointer)
(x1 my-double)
(y1 my-double)
(x2 my-double)
(y2 my-double)
(x3 my-double)
(y3 my-double))
(cffi:defcfun ("cairo_arc" cairo_arc) :void
(cr :pointer)
(xc my-double)
(yc my-double)
(radius my-double)
(angle1 my-double)
(angle2 my-double))
(cffi:defcfun ("cairo_arc_negative" cairo_arc_negative) :void
(cr :pointer)
(xc my-double)
(yc my-double)
(radius my-double)
(angle1 my-double)
(angle2 my-double))
(cffi:defcfun ("cairo_rel_move_to" cairo_rel_move_to) :void
(cr :pointer)
(dx my-double)
(dy my-double))
(cffi:defcfun ("cairo_rel_line_to" cairo_rel_line_to) :void
(cr :pointer)
(dx my-double)
(dy my-double))
(cffi:defcfun ("cairo_rel_curve_to" cairo_rel_curve_to) :void
(cr :pointer)
(dx1 my-double)
(dy1 my-double)
(dx2 my-double)
(dy2 my-double)
(dx3 my-double)
(dy3 my-double))
(cffi:defcfun ("cairo_rectangle" cairo_rectangle) :void
(cr :pointer)
(x my-double)
(y my-double)
(width my-double)
(height my-double))
(cffi:defcfun ("cairo_close_path" cairo_close_path) :void
(cr :pointer))
(cffi:defcfun ("cairo_path_extents" cairo_path_extents) :void
(cr :pointer)
(x1 :pointer)
(y1 :pointer)
(x2 :pointer)
(y2 :pointer))
(cffi:defcfun ("cairo_paint" cairo_paint) :void
(cr :pointer))
(cffi:defcfun ("cairo_paint_with_alpha" cairo_paint_with_alpha) :void
(cr :pointer)
(alpha my-double))
(cffi:defcfun ("cairo_mask" cairo_mask) :void
(cr :pointer)
(pattern :pointer))
(cffi:defcfun ("cairo_mask_surface" cairo_mask_surface) :void
(cr :pointer)
(surface :pointer)
(surface_x my-double)
(surface_y my-double))
(cffi:defcfun ("cairo_stroke" cairo_stroke) :void
(cr :pointer))
(cffi:defcfun ("cairo_stroke_preserve" cairo_stroke_preserve) :void
(cr :pointer))
(cffi:defcfun ("cairo_fill" cairo_fill) :void
(cr :pointer))
(cffi:defcfun ("cairo_fill_preserve" cairo_fill_preserve) :void
(cr :pointer))
(cffi:defcfun ("cairo_copy_page" cairo_copy_page) :void
(cr :pointer))
(cffi:defcfun ("cairo_show_page" cairo_show_page) :void
(cr :pointer))
(cffi:defcfun ("cairo_in_stroke" cairo_in_stroke) :int
(cr :pointer)
(x my-double)
(y my-double))
(cffi:defcfun ("cairo_in_fill" cairo_in_fill) :int
(cr :pointer)
(x my-double)
(y my-double))
(cffi:defcfun ("cairo_stroke_extents" cairo_stroke_extents) :void
(cr :pointer)
(x1 :pointer)
(y1 :pointer)
(x2 :pointer)
(y2 :pointer))
(cffi:defcfun ("cairo_fill_extents" cairo_fill_extents) :void
(cr :pointer)
(x1 :pointer)
(y1 :pointer)
(x2 :pointer)
(y2 :pointer))
(cffi:defcfun ("cairo_reset_clip" cairo_reset_clip) :void
(cr :pointer))
(cffi:defcfun ("cairo_clip" cairo_clip) :void
(cr :pointer))
(cffi:defcfun ("cairo_clip_preserve" cairo_clip_preserve) :void
(cr :pointer))
(cffi:defcfun ("cairo_clip_extents" cairo_clip_extents) :void
(cr :pointer)
(x1 :pointer)
(y1 :pointer)
(x2 :pointer)
(y2 :pointer))
(cffi:defcstruct cairo_rectangle_t
(x my-double)
(y my-double)
(width my-double)
(height my-double))
(cffi:defcstruct cairo_rectangle_list_t
(status cairo_status_t)
(rectangles :pointer)
(num_rectangles :int))
(cffi:defcfun ("cairo_copy_clip_rectangle_list" cairo_copy_clip_rectangle_list) :pointer
(cr :pointer))
(cffi:defcfun ("cairo_rectangle_list_destroy" cairo_rectangle_list_destroy) :void
(rectangle_list :pointer))
(cffi:defcstruct cairo_glyph_t
(index :unsigned-long)
(x my-double)
(y my-double))
(cffi:defcstruct cairo_text_extents_t
(x_bearing my-double)
(y_bearing my-double)
(width my-double)
(height my-double)
(x_advance my-double)
(y_advance my-double))
(cffi:defcstruct cairo_font_extents_t
(ascent my-double)
(descent my-double)
(height my-double)
(max_x_advance my-double)
(max_y_advance my-double))
(cffi:defcenum cairo_font_slant_t
:CAIRO_FONT_SLANT_NORMAL
:CAIRO_FONT_SLANT_ITALIC
:CAIRO_FONT_SLANT_OBLIQUE)
(cffi:defcenum cairo_font_weight_t
:CAIRO_FONT_WEIGHT_NORMAL
:CAIRO_FONT_WEIGHT_BOLD)
(cffi:defcenum cairo_subpixel_order_t
:CAIRO_SUBPIXEL_ORDER_DEFAULT
:CAIRO_SUBPIXEL_ORDER_RGB
:CAIRO_SUBPIXEL_ORDER_BGR
:CAIRO_SUBPIXEL_ORDER_VRGB
:CAIRO_SUBPIXEL_ORDER_VBGR)
(cffi:defcenum cairo_hint_style_t
:CAIRO_HINT_STYLE_DEFAULT
:CAIRO_HINT_STYLE_NONE
:CAIRO_HINT_STYLE_SLIGHT
:CAIRO_HINT_STYLE_MEDIUM
:CAIRO_HINT_STYLE_FULL)
(cffi:defcenum cairo_hint_metrics_t
:CAIRO_HINT_METRICS_DEFAULT
:CAIRO_HINT_METRICS_OFF
:CAIRO_HINT_METRICS_ON)
(cffi:defcfun ("cairo_font_options_create" cairo_font_options_create) :pointer)
(cffi:defcfun ("cairo_font_options_copy" cairo_font_options_copy) :pointer
(original :pointer))
(cffi:defcfun ("cairo_font_options_destroy" cairo_font_options_destroy) :void
(options :pointer))
(cffi:defcfun ("cairo_font_options_status" cairo_font_options_status) cairo_status_t
(options :pointer))
(cffi:defcfun ("cairo_font_options_merge" cairo_font_options_merge) :void
(options :pointer)
(other :pointer))
(cffi:defcfun ("cairo_font_options_equal" cairo_font_options_equal) :int
(options :pointer)
(other :pointer))
(cffi:defcfun ("cairo_font_options_hash" cairo_font_options_hash) :unsigned-long
(options :pointer))
(cffi:defcfun ("cairo_font_options_set_antialias" cairo_font_options_set_antialias) :void
(options :pointer)
(antialias cairo_antialias_t))
(cffi:defcfun ("cairo_font_options_get_antialias" cairo_font_options_get_antialias) cairo_antialias_t
(options :pointer))
(cffi:defcfun ("cairo_font_options_set_subpixel_order" cairo_font_options_set_subpixel_order) :void
(options :pointer)
(subpixel_order cairo_subpixel_order_t))
(cffi:defcfun ("cairo_font_options_get_subpixel_order" cairo_font_options_get_subpixel_order) cairo_subpixel_order_t
(options :pointer))
(cffi:defcfun ("cairo_font_options_set_hint_style" cairo_font_options_set_hint_style) :void
(options :pointer)
(hint_style cairo_hint_style_t))
(cffi:defcfun ("cairo_font_options_get_hint_style" cairo_font_options_get_hint_style) cairo_hint_style_t
(options :pointer))
(cffi:defcfun ("cairo_font_options_set_hint_metrics" cairo_font_options_set_hint_metrics) :void
(options :pointer)
(hint_metrics cairo_hint_metrics_t))
(cffi:defcfun ("cairo_font_options_get_hint_metrics" cairo_font_options_get_hint_metrics) cairo_hint_metrics_t
(options :pointer))
(cffi:defcfun ("cairo_select_font_face" cairo_select_font_face) :void
(cr :pointer)
(family :string)
(slant cairo_font_slant_t)
(weight cairo_font_weight_t))
(cffi:defcfun ("cairo_set_font_size" cairo_set_font_size) :void
(cr :pointer)
(size my-double))
(cffi:defcfun ("cairo_set_font_matrix" cairo_set_font_matrix) :void
(cr :pointer)
(matrix :pointer))
(cffi:defcfun ("cairo_get_font_matrix" cairo_get_font_matrix) :void
(cr :pointer)
(matrix :pointer))
(cffi:defcfun ("cairo_set_font_options" cairo_set_font_options) :void
(cr :pointer)
(options :pointer))
(cffi:defcfun ("cairo_get_font_options" cairo_get_font_options) :void
(cr :pointer)
(options :pointer))
(cffi:defcfun ("cairo_set_font_face" cairo_set_font_face) :void
(cr :pointer)
(font_face :pointer))
(cffi:defcfun ("cairo_get_font_face" cairo_get_font_face) :pointer
(cr :pointer))
(cffi:defcfun ("cairo_set_scaled_font" cairo_set_scaled_font) :void
(cr :pointer)
(scaled_font :pointer))
(cffi:defcfun ("cairo_get_scaled_font" cairo_get_scaled_font) :pointer
(cr :pointer))
(cffi:defcfun ("cairo_show_text" cairo_show_text) :void
(cr :pointer)
(utf8 :string))
(cffi:defcfun ("cairo_show_glyphs" cairo_show_glyphs) :void
(cr :pointer)
(glyphs :pointer)
(num_glyphs :int))
(cffi:defcfun ("cairo_text_path" cairo_text_path) :void
(cr :pointer)
(utf8 :string))
(cffi:defcfun ("cairo_glyph_path" cairo_glyph_path) :void
(cr :pointer)
(glyphs :pointer)
(num_glyphs :int))
(cffi:defcfun ("cairo_text_extents" cairo_text_extents) :void
(cr :pointer)
(utf8 :string)
(extents :pointer))
(cffi:defcfun ("cairo_glyph_extents" cairo_glyph_extents) :void
(cr :pointer)
(glyphs :pointer)
(num_glyphs :int)
(extents :pointer))
(cffi:defcfun ("cairo_font_extents" cairo_font_extents) :void
(cr :pointer)
(extents :pointer))
(cffi:defcfun ("cairo_font_face_reference" cairo_font_face_reference) :pointer
(font_face :pointer))
(cffi:defcfun ("cairo_font_face_destroy" cairo_font_face_destroy) :void
(font_face :pointer))
(cffi:defcfun ("cairo_font_face_get_reference_count" cairo_font_face_get_reference_count) :unsigned-int
(font_face :pointer))
(cffi:defcfun ("cairo_font_face_status" cairo_font_face_status) cairo_status_t
(font_face :pointer))
(cffi:defcenum cairo_font_type_t
:CAIRO_FONT_TYPE_TOY
:CAIRO_FONT_TYPE_FT
:CAIRO_FONT_TYPE_WIN32
:CAIRO_FONT_TYPE_QUARTZ)
(cffi:defcfun ("cairo_font_face_get_type" cairo_font_face_get_type) cairo_font_type_t
(font_face :pointer))
(cffi:defcfun ("cairo_font_face_get_user_data" cairo_font_face_get_user_data) :pointer
(font_face :pointer)
(key :pointer))
(cffi:defcfun ("cairo_font_face_set_user_data" cairo_font_face_set_user_data) cairo_status_t
(font_face :pointer)
(key :pointer)
(user_data :pointer)
(destroy :pointer))
(cffi:defcfun ("cairo_scaled_font_create" cairo_scaled_font_create) :pointer
(font_face :pointer)
(font_matrix :pointer)
(ctm :pointer)
(options :pointer))
(cffi:defcfun ("cairo_scaled_font_reference" cairo_scaled_font_reference) :pointer
(scaled_font :pointer))
(cffi:defcfun ("cairo_scaled_font_destroy" cairo_scaled_font_destroy) :void
(scaled_font :pointer))
(cffi:defcfun ("cairo_scaled_font_get_reference_count" cairo_scaled_font_get_reference_count) :unsigned-int
(scaled_font :pointer))
(cffi:defcfun ("cairo_scaled_font_status" cairo_scaled_font_status) cairo_status_t
(scaled_font :pointer))
(cffi:defcfun ("cairo_scaled_font_get_type" cairo_scaled_font_get_type) cairo_font_type_t
(scaled_font :pointer))
(cffi:defcfun ("cairo_scaled_font_get_user_data" cairo_scaled_font_get_user_data) :pointer
(scaled_font :pointer)
(key :pointer))
(cffi:defcfun ("cairo_scaled_font_set_user_data" cairo_scaled_font_set_user_data) cairo_status_t
(scaled_font :pointer)
(key :pointer)
(user_data :pointer)
(destroy :pointer))
(cffi:defcfun ("cairo_scaled_font_extents" cairo_scaled_font_extents) :void
(scaled_font :pointer)
(extents :pointer))
(cffi:defcfun ("cairo_scaled_font_text_extents" cairo_scaled_font_text_extents) :void
(scaled_font :pointer)
(utf8 :string)
(extents :pointer))
(cffi:defcfun ("cairo_scaled_font_glyph_extents" cairo_scaled_font_glyph_extents) :void
(scaled_font :pointer)
(glyphs :pointer)
(num_glyphs :int)
(extents :pointer))
(cffi:defcfun ("cairo_scaled_font_get_font_face" cairo_scaled_font_get_font_face) :pointer
(scaled_font :pointer))
(cffi:defcfun ("cairo_scaled_font_get_font_matrix" cairo_scaled_font_get_font_matrix) :void
(scaled_font :pointer)
(font_matrix :pointer))
(cffi:defcfun ("cairo_scaled_font_get_ctm" cairo_scaled_font_get_ctm) :void
(scaled_font :pointer)
(ctm :pointer))
(cffi:defcfun ("cairo_scaled_font_get_font_options" cairo_scaled_font_get_font_options) :void
(scaled_font :pointer)
(options :pointer))
(cffi:defcfun ("cairo_get_operator" cairo_get_operator) cairo_operator_t
(cr :pointer))
(cffi:defcfun ("cairo_get_source" cairo_get_source) :pointer
(cr :pointer))
(cffi:defcfun ("cairo_get_tolerance" cairo_get_tolerance) :double
(cr :pointer))
(cffi:defcfun ("cairo_get_antialias" cairo_get_antialias) cairo_antialias_t
(cr :pointer))
(cffi:defcfun ("cairo_has_current_point" cairo_has_current_point) :int
(cr :pointer))
(cffi:defcfun ("cairo_get_current_point" cairo_get_current_point) :void
(cr :pointer)
(x :pointer)
(y :pointer))
(cffi:defcfun ("cairo_get_fill_rule" cairo_get_fill_rule) cairo_fill_rule_t
(cr :pointer))
(cffi:defcfun ("cairo_get_line_width" cairo_get_line_width) :double
(cr :pointer))
(cffi:defcfun ("cairo_get_line_cap" cairo_get_line_cap) cairo_line_cap_t
(cr :pointer))
(cffi:defcfun ("cairo_get_line_join" cairo_get_line_join) cairo_line_join_t
(cr :pointer))
(cffi:defcfun ("cairo_get_miter_limit" cairo_get_miter_limit) :double
(cr :pointer))
(cffi:defcfun ("cairo_get_dash_count" cairo_get_dash_count) :int
(cr :pointer))
(cffi:defcfun ("cairo_get_dash" cairo_get_dash) :void
(cr :pointer)
(dashes :pointer)
(offset :pointer))
(cffi:defcfun ("cairo_get_matrix" cairo_get_matrix) :void
(cr :pointer)
(matrix :pointer))
(cffi:defcfun ("cairo_get_target" cairo_get_target) :pointer
(cr :pointer))
(cffi:defcfun ("cairo_get_group_target" cairo_get_group_target) :pointer
(cr :pointer))
(cffi:defcenum cairo_path_data_type_t
:CAIRO_PATH_MOVE_TO
:CAIRO_PATH_LINE_TO
:CAIRO_PATH_CURVE_TO
:CAIRO_PATH_CLOSE_PATH)
(cffi:defcunion _cairo_path_data_t
(point :pointer)
(header :pointer))
(cffi:defcstruct _cairo_path_data_t_point
(x my-double)
(y my-double))
(cffi:defcstruct _cairo_path_data_t_header
(type cairo_path_data_type_t)
(length :int))
(cffi:defcstruct cairo_path_t
(status cairo_status_t)
(data :pointer)
(num_data :int))
(cffi:defcfun ("cairo_copy_path" cairo_copy_path) :pointer
(cr :pointer))
(cffi:defcfun ("cairo_copy_path_flat" cairo_copy_path_flat) :pointer
(cr :pointer))
(cffi:defcfun ("cairo_append_path" cairo_append_path) :void
(cr :pointer)
(path :pointer))
(cffi:defcfun ("cairo_path_destroy" cairo_path_destroy) :void
(path :pointer))
(cffi:defcfun ("cairo_status" cairo_status) cairo_status_t
(cr :pointer))
(cffi:defcfun ("cairo_status_to_string" cairo_status_to_string) :string
(status cairo_status_t))
(cffi:defcfun ("cairo_surface_create_similar" cairo_surface_create_similar) :pointer
(other :pointer)
(content cairo_content_t)
(width :int)
(height :int))
(cffi:defcfun ("cairo_surface_reference" cairo_surface_reference) :pointer
(surface :pointer))
(cffi:defcfun ("cairo_surface_finish" cairo_surface_finish) :void
(surface :pointer))
(cffi:defcfun ("cairo_surface_destroy" cairo_surface_destroy) :void
(surface :pointer))
(cffi:defcfun ("cairo_surface_get_reference_count" cairo_surface_get_reference_count) :unsigned-int
(surface :pointer))
(cffi:defcfun ("cairo_surface_status" cairo_surface_status) cairo_status_t
(surface :pointer))
(cffi:defcenum cairo_surface_type_t
:CAIRO_SURFACE_TYPE_IMAGE
:CAIRO_SURFACE_TYPE_PDF
:CAIRO_SURFACE_TYPE_PS
:CAIRO_SURFACE_TYPE_XLIB
:CAIRO_SURFACE_TYPE_XCB
:CAIRO_SURFACE_TYPE_GLITZ
:CAIRO_SURFACE_TYPE_QUARTZ
:CAIRO_SURFACE_TYPE_WIN32
:CAIRO_SURFACE_TYPE_BEOS
:CAIRO_SURFACE_TYPE_DIRECTFB
:CAIRO_SURFACE_TYPE_SVG
:CAIRO_SURFACE_TYPE_OS2
:CAIRO_SURFACE_TYPE_WIN32_PRINTING
:CAIRO_SURFACE_TYPE_QUARTZ_IMAGE)
(cffi:defcfun ("cairo_surface_get_type" cairo_surface_get_type) cairo_surface_type_t
(surface :pointer))
(cffi:defcfun ("cairo_surface_get_content" cairo_surface_get_content) cairo_content_t
(surface :pointer))
(cffi:defcfun ("cairo_surface_write_to_png" cairo_surface_write_to_png) cairo_status_t
(surface :pointer)
(filename :string))
(cffi:defcfun ("cairo_surface_write_to_png_stream" cairo_surface_write_to_png_stream) cairo_status_t
(surface :pointer)
(write_func :pointer)
(closure :pointer))
(cffi:defcfun ("cairo_surface_get_user_data" cairo_surface_get_user_data) :pointer
(surface :pointer)
(key :pointer))
(cffi:defcfun ("cairo_surface_set_user_data" cairo_surface_set_user_data) cairo_status_t
(surface :pointer)
(key :pointer)
(user_data :pointer)
(destroy :pointer))
(cffi:defcfun ("cairo_surface_get_font_options" cairo_surface_get_font_options) :void
(surface :pointer)
(options :pointer))
(cffi:defcfun ("cairo_surface_flush" cairo_surface_flush) :void
(surface :pointer))
(cffi:defcfun ("cairo_surface_mark_dirty" cairo_surface_mark_dirty) :void
(surface :pointer))
(cffi:defcfun ("cairo_surface_mark_dirty_rectangle" cairo_surface_mark_dirty_rectangle) :void
(surface :pointer)
(x :int)
(y :int)
(width :int)
(height :int))
(cffi:defcfun ("cairo_surface_set_device_offset" cairo_surface_set_device_offset) :void
(surface :pointer)
(x_offset my-double)
(y_offset my-double))
(cffi:defcfun ("cairo_surface_get_device_offset" cairo_surface_get_device_offset) :void
(surface :pointer)
(x_offset :pointer)
(y_offset :pointer))
(cffi:defcfun ("cairo_surface_set_fallback_resolution" cairo_surface_set_fallback_resolution) :void
(surface :pointer)
(x_pixels_per_inch my-double)
(y_pixels_per_inch my-double))
(cffi:defcfun ("cairo_surface_copy_page" cairo_surface_copy_page) :void
(surface :pointer))
(cffi:defcfun ("cairo_surface_show_page" cairo_surface_show_page) :void
(surface :pointer))
(cffi:defcenum cairo_format_t
:CAIRO_FORMAT_ARGB32
:CAIRO_FORMAT_RGB24
:CAIRO_FORMAT_A8
:CAIRO_FORMAT_A1)
(cffi:defcfun ("cairo_image_surface_create" cairo_image_surface_create) :pointer
(format cairo_format_t)
(width :int)
(height :int))
(cffi:defcfun ("cairo_format_stride_for_width" cairo_format_stride_for_width) :int
(format cairo_format_t)
(width :int))
(cffi:defcfun ("cairo_image_surface_create_for_data" cairo_image_surface_create_for_data) :pointer
(data :pointer)
(format cairo_format_t)
(width :int)
(height :int)
(stride :int))
(cffi:defcfun ("cairo_image_surface_get_data" cairo_image_surface_get_data) :pointer
(surface :pointer))
(cffi:defcfun ("cairo_image_surface_get_format" cairo_image_surface_get_format) cairo_format_t
(surface :pointer))
(cffi:defcfun ("cairo_image_surface_get_width" cairo_image_surface_get_width) :int
(surface :pointer))
(cffi:defcfun ("cairo_image_surface_get_height" cairo_image_surface_get_height) :int
(surface :pointer))
(cffi:defcfun ("cairo_image_surface_get_stride" cairo_image_surface_get_stride) :int
(surface :pointer))
(cffi:defcfun ("cairo_image_surface_create_from_png" cairo_image_surface_create_from_png) :pointer
(filename :string))
(cffi:defcfun ("cairo_image_surface_create_from_png_stream" cairo_image_surface_create_from_png_stream) :pointer
(read_func :pointer)
(closure :pointer))
(cffi:defcfun ("cairo_pattern_create_rgb" cairo_pattern_create_rgb) :pointer
(red my-double)
(green my-double)
(blue my-double))
(cffi:defcfun ("cairo_pattern_create_rgba" cairo_pattern_create_rgba) :pointer
(red my-double)
(green my-double)
(blue my-double)
(alpha my-double))
(cffi:defcfun ("cairo_pattern_create_for_surface" cairo_pattern_create_for_surface) :pointer
(surface :pointer))
(cffi:defcfun ("cairo_pattern_create_linear" cairo_pattern_create_linear) :pointer
(x0 my-double)
(y0 my-double)
(x1 my-double)
(y1 my-double))
(cffi:defcfun ("cairo_pattern_create_radial" cairo_pattern_create_radial) :pointer
(cx0 my-double)
(cy0 my-double)
(radius0 my-double)
(cx1 my-double)
(cy1 my-double)
(radius1 my-double))
(cffi:defcfun ("cairo_pattern_reference" cairo_pattern_reference) :pointer
(pattern :pointer))
(cffi:defcfun ("cairo_pattern_destroy" cairo_pattern_destroy) :void
(pattern :pointer))
(cffi:defcfun ("cairo_pattern_get_reference_count" cairo_pattern_get_reference_count) :unsigned-int
(pattern :pointer))
(cffi:defcfun ("cairo_pattern_status" cairo_pattern_status) cairo_status_t
(pattern :pointer))
(cffi:defcfun ("cairo_pattern_get_user_data" cairo_pattern_get_user_data) :pointer
(pattern :pointer)
(key :pointer))
(cffi:defcfun ("cairo_pattern_set_user_data" cairo_pattern_set_user_data) cairo_status_t
(pattern :pointer)
(key :pointer)
(user_data :pointer)
(destroy :pointer))
(cffi:defcenum cairo_pattern_type_t
:CAIRO_PATTERN_TYPE_SOLID
:CAIRO_PATTERN_TYPE_SURFACE
:CAIRO_PATTERN_TYPE_LINEAR
:CAIRO_PATTERN_TYPE_RADIAL)
(cffi:defcfun ("cairo_pattern_get_type" cairo_pattern_get_type) cairo_pattern_type_t
(pattern :pointer))
(cffi:defcfun ("cairo_pattern_add_color_stop_rgb" cairo_pattern_add_color_stop_rgb) :void
(pattern :pointer)
(offset my-double)
(red my-double)
(green my-double)
(blue my-double))
(cffi:defcfun ("cairo_pattern_add_color_stop_rgba" cairo_pattern_add_color_stop_rgba) :void
(pattern :pointer)
(offset my-double)
(red my-double)
(green my-double)
(blue my-double)
(alpha my-double))
(cffi:defcfun ("cairo_pattern_set_matrix" cairo_pattern_set_matrix) :void
(pattern :pointer)
(matrix :pointer))
(cffi:defcfun ("cairo_pattern_get_matrix" cairo_pattern_get_matrix) :void
(pattern :pointer)
(matrix :pointer))
(cffi:defcenum cairo_extend_t
:CAIRO_EXTEND_NONE
:CAIRO_EXTEND_REPEAT
:CAIRO_EXTEND_REFLECT
:CAIRO_EXTEND_PAD)
(cffi:defcfun ("cairo_pattern_set_extend" cairo_pattern_set_extend) :void
(pattern :pointer)
(extend cairo_extend_t))
(cffi:defcfun ("cairo_pattern_get_extend" cairo_pattern_get_extend) cairo_extend_t
(pattern :pointer))
(cffi:defcenum cairo_filter_t
:CAIRO_FILTER_FAST
:CAIRO_FILTER_GOOD
:CAIRO_FILTER_BEST
:CAIRO_FILTER_NEAREST
:CAIRO_FILTER_BILINEAR
:CAIRO_FILTER_GAUSSIAN)
(cffi:defcfun ("cairo_pattern_set_filter" cairo_pattern_set_filter) :void
(pattern :pointer)
(filter cairo_filter_t))
(cffi:defcfun ("cairo_pattern_get_filter" cairo_pattern_get_filter) cairo_filter_t
(pattern :pointer))
(cffi:defcfun ("cairo_pattern_get_rgba" cairo_pattern_get_rgba) cairo_status_t
(pattern :pointer)
(red :pointer)
(green :pointer)
(blue :pointer)
(alpha :pointer))
(cffi:defcfun ("cairo_pattern_get_surface" cairo_pattern_get_surface) cairo_status_t
(pattern :pointer)
(surface :pointer))
(cffi:defcfun ("cairo_pattern_get_color_stop_rgba" cairo_pattern_get_color_stop_rgba) cairo_status_t
(pattern :pointer)
(index :int)
(offset :pointer)
(red :pointer)
(green :pointer)
(blue :pointer)
(alpha :pointer))
(cffi:defcfun ("cairo_pattern_get_color_stop_count" cairo_pattern_get_color_stop_count) cairo_status_t
(pattern :pointer)
(count :pointer))
(cffi:defcfun ("cairo_pattern_get_linear_points" cairo_pattern_get_linear_points) cairo_status_t
(pattern :pointer)
(x0 :pointer)
(y0 :pointer)
(x1 :pointer)
(y1 :pointer))
(cffi:defcfun ("cairo_pattern_get_radial_circles" cairo_pattern_get_radial_circles) cairo_status_t
(pattern :pointer)
(x0 :pointer)
(y0 :pointer)
(r0 :pointer)
(x1 :pointer)
(y1 :pointer)
(r1 :pointer))
(cffi:defcfun ("cairo_matrix_init" cairo_matrix_init) :void
(matrix :pointer)
(xx my-double)
(yx my-double)
(xy my-double)
(yy my-double)
(x0 my-double)
(y0 my-double))
(cffi:defcfun ("cairo_matrix_init_identity" cairo_matrix_init_identity) :void
(matrix :pointer))
(cffi:defcfun ("cairo_matrix_init_translate" cairo_matrix_init_translate) :void
(matrix :pointer)
(tx my-double)
(ty my-double))
(cffi:defcfun ("cairo_matrix_init_scale" cairo_matrix_init_scale) :void
(matrix :pointer)
(sx my-double)
(sy my-double))
(cffi:defcfun ("cairo_matrix_init_rotate" cairo_matrix_init_rotate) :void
(matrix :pointer)
(radians my-double))
(cffi:defcfun ("cairo_matrix_translate" cairo_matrix_translate) :void
(matrix :pointer)
(tx my-double)
(ty my-double))
(cffi:defcfun ("cairo_matrix_scale" cairo_matrix_scale) :void
(matrix :pointer)
(sx my-double)
(sy my-double))
(cffi:defcfun ("cairo_matrix_rotate" cairo_matrix_rotate) :void
(matrix :pointer)
(radians my-double))
(cffi:defcfun ("cairo_matrix_invert" cairo_matrix_invert) cairo_status_t
(matrix :pointer))
(cffi:defcfun ("cairo_matrix_multiply" cairo_matrix_multiply) :void
(result :pointer)
(a :pointer)
(b :pointer))
(cffi:defcfun ("cairo_matrix_transform_distance" cairo_matrix_transform_distance) :void
(matrix :pointer)
(dx :pointer)
(dy :pointer))
(cffi:defcfun ("cairo_matrix_transform_point" cairo_matrix_transform_point) :void
(matrix :pointer)
(x :pointer)
(y :pointer))
(cffi:defcfun ("cairo_debug_reset_static_data" cairo_debug_reset_static_data) :void)
(cffi:defcenum cairo_ps_level_t
:CAIRO_PS_LEVEL_2
:CAIRO_PS_LEVEL_3)
(cffi:defcfun ("cairo_ps_surface_create" cairo_ps_surface_create) :pointer
(filename :string)
(width_in_points my-double)
(height_in_points my-double))
(cffi:defcfun ("cairo_ps_surface_create_for_stream" cairo_ps_surface_create_for_stream) :pointer
(write_func :pointer)
(closure :pointer)
(width_in_points my-double)
(height_in_points my-double))
(cffi:defcfun ("cairo_ps_surface_restrict_to_level" cairo_ps_surface_restrict_to_level) :void
(surface :pointer)
(level cairo_ps_level_t))
(cffi:defcfun ("cairo_ps_get_levels" cairo_ps_get_levels) :void
(levels :pointer)
(num_levels :pointer))
(cffi:defcfun ("cairo_ps_level_to_string" cairo_ps_level_to_string) :string
(level cairo_ps_level_t))
(cffi:defcfun ("cairo_ps_surface_set_eps" cairo_ps_surface_set_eps) :void
(surface :pointer)
(eps :int))
(cffi:defcfun ("cairo_ps_surface_get_eps" cairo_ps_surface_get_eps) :int
(surface :pointer))
(cffi:defcfun ("cairo_ps_surface_set_size" cairo_ps_surface_set_size) :void
(surface :pointer)
(width_in_points my-double)
(height_in_points my-double))
(cffi:defcfun ("cairo_ps_surface_dsc_comment" cairo_ps_surface_dsc_comment) :void
(surface :pointer)
(comment :string))
(cffi:defcfun ("cairo_ps_surface_dsc_begin_setup" cairo_ps_surface_dsc_begin_setup) :void
(surface :pointer))
(cffi:defcfun ("cairo_ps_surface_dsc_begin_page_setup" cairo_ps_surface_dsc_begin_page_setup) :void
(surface :pointer))
(cffi:defcfun ("cairo_pdf_surface_create" cairo_pdf_surface_create) :pointer
(filename :string)
(width_in_points my-double)
(height_in_points my-double))
(cffi:defcfun ("cairo_pdf_surface_create_for_stream" cairo_pdf_surface_create_for_stream) :pointer
(write_func :pointer)
(closure :pointer)
(width_in_points my-double)
(height_in_points my-double))
(cffi:defcfun ("cairo_pdf_surface_set_size" cairo_pdf_surface_set_size) :void
(surface :pointer)
(width_in_points my-double)
(height_in_points my-double))
(cffi:defcenum cairo_svg_version_t
:CAIRO_SVG_VERSION_1_1
:CAIRO_SVG_VERSION_1_2)
(cffi:defcfun ("cairo_svg_surface_create" cairo_svg_surface_create) :pointer
(filename :string)
(width_in_points my-double)
(height_in_points my-double))
(cffi:defcfun ("cairo_svg_surface_create_for_stream" cairo_svg_surface_create_for_stream) :pointer
(write_func :pointer)
(closure :pointer)
(width_in_points my-double)
(height_in_points my-double))
(cffi:defcfun ("cairo_svg_surface_restrict_to_version" cairo_svg_surface_restrict_to_version) :void
(surface :pointer)
(version cairo_svg_version_t))
(cffi:defcfun ("cairo_svg_get_versions" cairo_svg_get_versions) :void
(versions :pointer)
(num_versions :pointer))
(cffi:defcfun ("cairo_svg_version_to_string" cairo_svg_version_to_string) :string
(version cairo_svg_version_t))
| 36,240 | Common Lisp | .lisp | 1,005 | 32.81194 | 116 | 0.722596 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | d2e70aabaca583be4ea73834b7c294e45519b2f9e320e7944c6a4e91c242e35a | 21,708 | [
-1
] |
21,709 | cl-cairo2-x11-swig.lisp | rheaplex_minara/lib/cl-cairo2/cl-cairo2-x11-swig.lisp |
(in-package :cl-cairo2)
;; typedefs: we don't want to create all of them automatically,
;; because typedefs for structures confuse with-foreign-slots
;; the ones we don't want are commented out
(cffi:defctype cairo_bool_t :int)
(cffi:defctype cairo_t :pointer)
(cffi:defctype cairo_surface_t :pointer)
;; (cffi:defctype cairo_matrix_t :pointer)
(cffi:defctype cairo_pattern_t :pointer)
(cffi:defctype cairo_destroy_func_t :pointer)
(cffi:defctype cairo_user_data_key_t :pointer)
(cffi:defctype cairo_write_func_t :pointer)
(cffi:defctype cairo_read_func_t :pointer)
;; (cffi:defctype cairo_rectangle_t :pointer)
(cffi:defctype cairo_rectangle_list_t :pointer)
(cffi:defctype cairo_scaled_font_t :pointer)
(cffi:defctype cairo_font_face_t :pointer)
(cffi:defctype cairo_font_options_t :pointer)
(cffi:defctype cairo_path_data_t :pointer)
(cffi:defctype cairo_path_t :pointer)
;;;SWIG wrapper code starts here
(cl:defmacro defanonenum (&body enums)
"Converts anonymous enums to defconstants."
`(cl:progn ,@(cl:loop for value in enums
for index = 0 then (cl:1+ index)
when (cl:listp value) do (cl:setf index (cl:second value)
value (cl:first value))
collect `(cl:defconstant ,value ,index))))
(cl:eval-when (:compile-toplevel :load-toplevel)
(cl:unless (cl:fboundp 'swig-lispify)
(cl:defun swig-lispify (name flag cl:&optional (package cl:*package*))
(cl:labels ((helper (lst last rest cl:&aux (c (cl:car lst)))
(cl:cond
((cl:null lst)
rest)
((cl:upper-case-p c)
(helper (cl:cdr lst) 'upper
(cl:case last
((lower digit) (cl:list* c #\- rest))
(cl:t (cl:cons c rest)))))
((cl:lower-case-p c)
(helper (cl:cdr lst) 'lower (cl:cons (cl:char-upcase c) rest)))
((cl:digit-char-p c)
(helper (cl:cdr lst) 'digit
(cl:case last
((upper lower) (cl:list* c #\- rest))
(cl:t (cl:cons c rest)))))
((cl:char-equal c #\_)
(helper (cl:cdr lst) '_ (cl:cons #\- rest)))
(cl:t
(cl:error "Invalid character: ~A" c)))))
(cl:let ((fix (cl:case flag
((constant enumvalue) "+")
(variable "*")
(cl:t ""))))
(cl:intern
(cl:concatenate
'cl:string
fix
(cl:nreverse (helper (cl:concatenate 'cl:list name) cl:nil cl:nil))
fix)
package))))))
;;;SWIG wrapper code ends here
(cl:defconstant CAIRO_VERSION_MAJOR 1)
(cl:defconstant CAIRO_VERSION_MINOR 6)
(cl:defconstant CAIRO_VERSION_MICRO 4)
(cl:defconstant CAIRO_HAS_SVG_SURFACE 1)
(cl:defconstant CAIRO_HAS_PDF_SURFACE 1)
(cl:defconstant CAIRO_HAS_PS_SURFACE 1)
(cl:defconstant CAIRO_HAS_FT_FONT 1)
(cl:defconstant CAIRO_HAS_PNG_FUNCTIONS 1)
(cl:defconstant CAIRO_HAS_XCB_SURFACE 1)
(cl:defconstant CAIRO_HAS_XLIB_XRENDER_SURFACE 1)
(cl:defconstant CAIRO_HAS_XLIB_SURFACE 1)
(cffi:defcfun ("cairo_xlib_surface_create_with_xrender_format" cairo_xlib_surface_create_with_xrender_format) :pointer
(dpy :pointer)
(drawable :pointer)
(screen :pointer)
(format :pointer)
(width :int)
(height :int))
(cffi:defcfun ("cairo_xlib_surface_get_xrender_format" cairo_xlib_surface_get_xrender_format) :pointer
(surface :pointer))
| 3,761 | Common Lisp | .lisp | 83 | 34.313253 | 118 | 0.580733 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 184db40e99b12001a498036010ec550aacc0bd015423cc092e09a2adbcb01406 | 21,709 | [
-1
] |
21,710 | text.lisp | rheaplex_minara/lib/cl-cairo2/text.lisp | (in-package :cl-cairo2)
;;;;
;;;; Notes
;;;;
;;;; The text interface is still preliminary. I have postponed
;;;; writing it until I have some knowledge of what people want to
;;;; use it for, for me, what is below suffices.
;;;;
;;;; The long-term solution would be integration with Pango (to
;;;; manage glyphs) and a CLOS-wrapped system for fonts.
;;;;
;;;; Need to write:
;;;;
;;;; set-font-matrix, get-font-matrix, set-font-options,
;;;; get-font-options, set-font-face, get-font-face, set-scaled-font,
;;;; get-scaled-font
;;;;
;;;; cairo_show_glyphs, cairo_glyph_extents
(define-flexible (select-font-face pointer family slant weight)
(cairo_select_font_face pointer
family
(lookup-enum slant table-font-slant)
(lookup-enum weight table-font-weight)))
(define-with-default-context set-font-size size)
(define-flexible (text-extents pointer text)
(with-foreign-pointer (extents-pointer
(foreign-type-size 'cairo_text_extents_t))
(cairo_text_extents pointer text extents-pointer)
(with-foreign-slots ((x_bearing y_bearing width height
x_advance y_advance)
extents-pointer cairo_text_extents_t)
(values x_bearing y_bearing width height x_advance y_advance))))
(define-with-default-context-sync show-text text)
;;;
;;; low level text and font support
;;;
;;; The structures, text-extents-t and font-extnts-t, are opaque to the client.
;;; shorthand accessor functions are defined to reference the member variables.
;;;
(defmacro def-extents-t-shortname (prefix struct-name slot)
(let ((shortname (intern (concatenate 'string (symbol-name prefix)
"-" (symbol-name slot))))
(longname (intern (concatenate 'string (symbol-name struct-name)
"-" (symbol-name slot)))))
`(defun ,shortname (extents-t)
(,longname extents-t))))
(defmacro defstruct-extents-t (prefix &rest slots)
(let ((struct-name (intern (concatenate 'string (symbol-name prefix)
"-EXTENTS-T"))))
`(progn
(defstruct ,struct-name ,@slots)
,@(loop for slot in slots collect
`(def-extents-t-shortname ,prefix ,struct-name ,slot)))))
(defstruct-extents-t text x-bearing y-bearing width height x-advance y-advance)
(defstruct-extents-t font ascent descent height max-x-advance max-y-advance)
(defun text-extents-t-copy-out (pointer text-extents-t)
"Copy the contents of a memory location to a text-extents-t object."
(with-foreign-slots ((x_bearing y_bearing width height x_advance
y_advance) pointer cairo_text_extents_t)
(setf (text-extents-t-x-bearing text-extents-t) x_bearing
(text-extents-t-y-bearing text-extents-t) y_bearing
(text-extents-t-width text-extents-t) width
(text-extents-t-height text-extents-t) height
(text-extents-t-x-advance text-extents-t) x_advance
(text-extents-t-y-advance text-extents-t) y_advance)))
(defmacro with-text-extents-t-out (pointer &body body)
"Execute body with pointer pointing to an uninitialized location,
then copy this to text extents and return the text extents."
(let ((extents-name (gensym)))
`(with-foreign-pointer (,pointer (foreign-type-size 'cairo_text_extents_t))
(let ((,extents-name (make-text-extents-t)))
,@body
(text-extents-t-copy-out ,pointer ,extents-name)
,extents-name))))
(define-flexible (get-text-extents ctx-pointer utf8)
(with-text-extents-t-out tet-pointer
(cairo_text_extents ctx-pointer utf8 tet-pointer)))
(defun font-extents-t-copy-out (pointer font-extents-t)
"Copy the contents of a memory location to a font-extents-t object."
(with-foreign-slots ((ascent descent height max_x_advance
max_y_advance) pointer cairo_font_extents_t)
(setf (font-extents-t-ascent font-extents-t) ascent
(font-extents-t-descent font-extents-t) descent
(font-extents-t-height font-extents-t) height
(font-extents-t-max-x-advance font-extents-t) max_x_advance
(font-extents-t-max-y-advance font-extents-t) max_y_advance)))
(defmacro with-font-extents-t-out (pointer &body body)
"Execute body with pointer pointing to an uninitialized location,
then copy this to text extents and return the text extents."
(let ((extents-name (gensym)))
`(with-foreign-pointer (,pointer (foreign-type-size 'cairo_font_extents_t))
(let ((,extents-name (make-font-extents-t)))
,@body
(font-extents-t-copy-out ,pointer ,extents-name)
,extents-name))))
(define-flexible (get-font-extents ctx-pointer)
(with-font-extents-t-out fet-pointer
(cairo_font_extents ctx-pointer fet-pointer)))
| 4,532 | Common Lisp | .lisp | 98 | 42.77551 | 79 | 0.722562 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 38982b2096890fbdb5507d9b846c073a405f1163cfd22a1304d7d490de57f3c6 | 21,710 | [
-1
] |
21,711 | cl-cairo2-win-swig.lisp | rheaplex_minara/lib/cl-cairo2/cl-cairo2-win-swig.lisp |
(in-package :cl-cairo2)
;; typedefs: we don't want to create all of them automatically,
;; because typedefs for structures confuse with-foreign-slots
;; the ones we don't want are commented out
(cffi:defctype cairo_bool_t :int)
(cffi:defctype cairo_t :pointer)
(cffi:defctype cairo_surface_t :pointer)
;; (cffi:defctype cairo_matrix_t :pointer)
(cffi:defctype cairo_pattern_t :pointer)
(cffi:defctype cairo_destroy_func_t :pointer)
(cffi:defctype cairo_user_data_key_t :pointer)
(cffi:defctype cairo_write_func_t :pointer)
(cffi:defctype cairo_read_func_t :pointer)
;; (cffi:defctype cairo_rectangle_t :pointer)
(cffi:defctype cairo_rectangle_list_t :pointer)
(cffi:defctype cairo_scaled_font_t :pointer)
(cffi:defctype cairo_font_face_t :pointer)
(cffi:defctype cairo_font_options_t :pointer)
(cffi:defctype cairo_path_data_t :pointer)
(cffi:defctype cairo_path_t :pointer)
;;;SWIG wrapper code starts here
(cl:defmacro defanonenum (&body enums)
"Converts anonymous enums to defconstants."
`(cl:progn ,@(cl:loop for value in enums
for index = 0 then (cl:1+ index)
when (cl:listp value) do (cl:setf index (cl:second value)
value (cl:first value))
collect `(cl:defconstant ,value ,index))))
(cl:eval-when (:compile-toplevel :load-toplevel)
(cl:unless (cl:fboundp 'swig-lispify)
(cl:defun swig-lispify (name flag cl:&optional (package cl:*package*))
(cl:labels ((helper (lst last rest cl:&aux (c (cl:car lst)))
(cl:cond
((cl:null lst)
rest)
((cl:upper-case-p c)
(helper (cl:cdr lst) 'upper
(cl:case last
((lower digit) (cl:list* c #\- rest))
(cl:t (cl:cons c rest)))))
((cl:lower-case-p c)
(helper (cl:cdr lst) 'lower (cl:cons (cl:char-upcase c) rest)))
((cl:digit-char-p c)
(helper (cl:cdr lst) 'digit
(cl:case last
((upper lower) (cl:list* c #\- rest))
(cl:t (cl:cons c rest)))))
((cl:char-equal c #\_)
(helper (cl:cdr lst) '_ (cl:cons #\- rest)))
(cl:t
(cl:error "Invalid character: ~A" c)))))
(cl:let ((fix (cl:case flag
((constant enumvalue) "+")
(variable "*")
(cl:t ""))))
(cl:intern
(cl:concatenate
'cl:string
fix
(cl:nreverse (helper (cl:concatenate 'cl:list name) cl:nil cl:nil))
fix)
package))))))
;;;SWIG wrapper code ends here
(cl:defconstant CAIRO_VERSION_MAJOR 1)
(cl:defconstant CAIRO_VERSION_MINOR 6)
(cl:defconstant CAIRO_VERSION_MICRO 4)
(cl:defconstant CAIRO_HAS_SVG_SURFACE 1)
(cl:defconstant CAIRO_HAS_PDF_SURFACE 1)
(cl:defconstant CAIRO_HAS_PS_SURFACE 1)
(cl:defconstant CAIRO_HAS_PNG_FUNCTIONS 1)
(cl:defconstant CAIRO_HAS_WIN32_FONT 1)
(cl:defconstant CAIRO_HAS_WIN32_SURFACE 1)
(cffi:defcfun ("cairo_win32_surface_create" cairo_win32_surface_create) :pointer
(hdc :pointer))
(cffi:defcfun ("cairo_win32_printing_surface_create" cairo_win32_printing_surface_create) :pointer
(hdc :pointer))
(cffi:defcfun ("cairo_win32_surface_create_with_ddb" cairo_win32_surface_create_with_ddb) :pointer
(hdc :pointer)
(format :pointer)
(width :int)
(height :int))
(cffi:defcfun ("cairo_win32_surface_create_with_dib" cairo_win32_surface_create_with_dib) :pointer
(format :pointer)
(width :int)
(height :int))
(cffi:defcfun ("cairo_win32_surface_get_dc" cairo_win32_surface_get_dc) :pointer
(surface :pointer))
(cffi:defcfun ("cairo_win32_surface_get_image" cairo_win32_surface_get_image) :pointer
(surface :pointer))
(cffi:defcfun ("cairo_win32_font_face_create_for_logfontw" cairo_win32_font_face_create_for_logfontw) :pointer
(logfont :pointer))
(cffi:defcfun ("cairo_win32_font_face_create_for_hfont" cairo_win32_font_face_create_for_hfont) :pointer
(font :pointer))
(cffi:defcfun ("cairo_win32_font_face_create_for_logfontw_hfont" cairo_win32_font_face_create_for_logfontw_hfont) :pointer
(logfont :pointer)
(font :pointer))
(cffi:defcfun ("cairo_win32_scaled_font_select_font" cairo_win32_scaled_font_select_font) :pointer
(scaled_font :pointer)
(hdc :pointer))
(cffi:defcfun ("cairo_win32_scaled_font_done_font" cairo_win32_scaled_font_done_font) :void
(scaled_font :pointer))
(cffi:defcfun ("cairo_win32_scaled_font_get_metrics_factor" cairo_win32_scaled_font_get_metrics_factor) :double
(scaled_font :pointer))
(cffi:defcfun ("cairo_win32_scaled_font_get_logical_to_device" cairo_win32_scaled_font_get_logical_to_device) :void
(scaled_font :pointer)
(logical_to_device :pointer))
(cffi:defcfun ("cairo_win32_scaled_font_get_device_to_logical" cairo_win32_scaled_font_get_device_to_logical) :void
(scaled_font :pointer)
(device_to_logical :pointer))
| 5,240 | Common Lisp | .lisp | 109 | 39.073394 | 122 | 0.631548 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 25bb262a4c65a63155fe45bb156ce9cd55fcc80842a94d5febd17361cb50dfb4 | 21,711 | [
-1
] |
21,712 | cl-cairo2-mac-swig.lisp | rheaplex_minara/lib/cl-cairo2/cl-cairo2-mac-swig.lisp |
(in-package :cl-cairo2)
;; typedefs: we don't want to create all of them automatically,
;; because typedefs for structures confuse with-foreign-slots
;; the ones we don't want are commented out
(cffi:defctype cairo_bool_t :int)
(cffi:defctype cairo_t :pointer)
(cffi:defctype cairo_surface_t :pointer)
;; (cffi:defctype cairo_matrix_t :pointer)
(cffi:defctype cairo_pattern_t :pointer)
(cffi:defctype cairo_destroy_func_t :pointer)
(cffi:defctype cairo_user_data_key_t :pointer)
(cffi:defctype cairo_write_func_t :pointer)
(cffi:defctype cairo_read_func_t :pointer)
;; (cffi:defctype cairo_rectangle_t :pointer)
(cffi:defctype cairo_rectangle_list_t :pointer)
(cffi:defctype cairo_scaled_font_t :pointer)
(cffi:defctype cairo_font_face_t :pointer)
(cffi:defctype cairo_font_options_t :pointer)
(cffi:defctype cairo_path_data_t :pointer)
(cffi:defctype cairo_path_t :pointer)
;;;SWIG wrapper code starts here
(cl:defmacro defanonenum (&body enums)
"Converts anonymous enums to defconstants."
`(cl:progn ,@(cl:loop for value in enums
for index = 0 then (cl:1+ index)
when (cl:listp value) do (cl:setf index (cl:second value)
value (cl:first value))
collect `(cl:defconstant ,value ,index))))
(cl:eval-when (:compile-toplevel :load-toplevel)
(cl:unless (cl:fboundp 'swig-lispify)
(cl:defun swig-lispify (name flag cl:&optional (package cl:*package*))
(cl:labels ((helper (lst last rest cl:&aux (c (cl:car lst)))
(cl:cond
((cl:null lst)
rest)
((cl:upper-case-p c)
(helper (cl:cdr lst) 'upper
(cl:case last
((lower digit) (cl:list* c #\- rest))
(cl:t (cl:cons c rest)))))
((cl:lower-case-p c)
(helper (cl:cdr lst) 'lower (cl:cons (cl:char-upcase c) rest)))
((cl:digit-char-p c)
(helper (cl:cdr lst) 'digit
(cl:case last
((upper lower) (cl:list* c #\- rest))
(cl:t (cl:cons c rest)))))
((cl:char-equal c #\_)
(helper (cl:cdr lst) '_ (cl:cons #\- rest)))
(cl:t
(cl:error "Invalid character: ~A" c)))))
(cl:let ((fix (cl:case flag
((constant enumvalue) "+")
(variable "*")
(cl:t ""))))
(cl:intern
(cl:concatenate
'cl:string
fix
(cl:nreverse (helper (cl:concatenate 'cl:list name) cl:nil cl:nil))
fix)
package))))))
;;;SWIG wrapper code ends here
(cl:defconstant CAIRO_VERSION_MAJOR 1)
(cl:defconstant CAIRO_VERSION_MINOR 6)
(cl:defconstant CAIRO_VERSION_MICRO 4)
(cl:defconstant CAIRO_HAS_SVG_SURFACE 1)
(cl:defconstant CAIRO_HAS_PDF_SURFACE 1)
(cl:defconstant CAIRO_HAS_PS_SURFACE 1)
(cl:defconstant CAIRO_HAS_FT_FONT 1)
(cl:defconstant CAIRO_HAS_PNG_FUNCTIONS 1)
(cl:defconstant CAIRO_HAS_QUARTZ_IMAGE_SURFACE 1)
(cl:defconstant CAIRO_HAS_QUARTZ_FONT 1)
(cl:defconstant CAIRO_HAS_QUARTZ_SURFACE 1)
(cl:defconstant CAIRO_HAS_XLIB_XRENDER_SURFACE 1)
(cl:defconstant CAIRO_HAS_XLIB_SURFACE 1)
(cffi:defcfun ("cairo_ft_font_face_create_for_pattern" cairo_ft_font_face_create_for_pattern) :pointer
(pattern :pointer))
(cffi:defcfun ("cairo_ft_font_options_substitute" cairo_ft_font_options_substitute) :void
(options :pointer)
(pattern :pointer))
(cffi:defcfun ("cairo_ft_font_face_create_for_ft_face" cairo_ft_font_face_create_for_ft_face) :pointer
(face :pointer)
(load_flags :int))
(cffi:defcfun ("cairo_ft_scaled_font_lock_face" cairo_ft_scaled_font_lock_face) :pointer
(scaled_font :pointer))
(cffi:defcfun ("cairo_ft_scaled_font_unlock_face" cairo_ft_scaled_font_unlock_face) :void
(scaled_font :pointer))
(cffi:defcfun ("cairo_xlib_surface_create_with_xrender_format" cairo_xlib_surface_create_with_xrender_format) :pointer
(dpy :pointer)
(drawable :pointer)
(screen :pointer)
(format :pointer)
(width :int)
(height :int))
(cffi:defcfun ("cairo_xlib_surface_get_xrender_format" cairo_xlib_surface_get_xrender_format) :pointer
(surface :pointer))
(cffi:defcfun ("cairo_quartz_surface_create" cairo_quartz_surface_create) :pointer
(format :pointer)
(width :unsigned-int)
(height :unsigned-int))
(cffi:defcfun ("cairo_quartz_surface_create_for_cg_context" cairo_quartz_surface_create_for_cg_context) :pointer
(cgContext :pointer)
(width :unsigned-int)
(height :unsigned-int))
(cffi:defcfun ("cairo_quartz_surface_get_cg_context" cairo_quartz_surface_get_cg_context) :pointer
(surface :pointer))
(cffi:defcfun ("cairo_quartz_font_face_create_for_cgfont" cairo_quartz_font_face_create_for_cgfont) :pointer
(font :pointer))
(cffi:defcfun ("cairo_quartz_font_face_create_for_atsu_font_id" cairo_quartz_font_face_create_for_atsu_font_id) :pointer
(font_id :pointer))
| 5,229 | Common Lisp | .lisp | 111 | 38.234234 | 120 | 0.631444 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 144b0f5ade140641996cc3908e81ae4ed482974b850c87e28a87f522d5013272 | 21,712 | [
-1
] |
21,713 | context.lisp | rheaplex_minara/lib/cl-cairo2/context.lisp | (in-package :cl-cairo2)
;;;;
;;;; Notes
;;;;
;;;; need to write:
;;;; cairo-get-target
;;;; push-group-with-content
;;;; get-group-target
;;;; mask-surface
;;;;
;;;;
;;;; not sure anyone needs:
;;;; get/set-user-data
;;;; get-reference-count
;;;;
;;;; context class
;;;;
(defclass context (cairo-object)
((width :initarg :width :reader get-width)
(height :initarg :height :reader get-height)
(pixel-based-p :initarg :pixel-based-p :reader pixel-based-p)))
(defmethod lowlevel-destroy ((context context))
(cairo_destroy (get-pointer context)))
(defmethod lowlevel-status ((context context))
(lookup-cairo-enum (cairo_status (get-pointer context)) table-status))
(defmethod print-object ((obj context) stream)
"Print a context object."
(print-unreadable-object (obj stream :type t)
(with-slots (pointer width height pixel-based-p) obj
(format stream "pointer: ~a, width: ~a, height: ~a, pixel-based-p: ~a"
pointer width height pixel-based-p))))
(defun create-context (surface)
(with-cairo-object (surface pointer)
(let ((context (make-instance 'context
:pointer (cairo_create pointer)
:width (get-width surface)
:height (get-height surface)
:pixel-based-p (pixel-based-p surface))))
;; register finalizer
; (let ((context-pointer (slot-value context 'pointer)))
(tg:finalize context
#'(lambda ()
(lowlevel-destroy context)))
;; return context
context)))
; cairo-objects' destroy calling lowlevel-destroy should suffice. todo: check this
;(defmethod destroy ((object context))
; (with-slots (pointer) object
; (when pointer
; (cairo_destroy pointer)
; (setf pointer nil)))
; ;; deregister finalizer
; (tg:cancel-finalization object))
(defgeneric sync (object)
(:documentation "Synchronize contents of the object with the
physical device if needed."))
(defgeneric sync-lock (object)
(:documentation "Suspend syncing (ie sync will have no effect) until
sync-unlock is called. Calls to sync-lock nest."))
(defgeneric sync-unlock (object)
(:documentation "Undo a call to sync-lock."))
(defgeneric sync-reset (object)
(:documentation "Undo all calls to sync, ie object will be
synced (if necessary) no matter how many times sync was called before."))
;; most contexts don't need syncing
(defmethod sync ((object context)))
(defmethod sync-lock ((object context)))
(defmethod sync-unlock ((object context)))
(defmethod sync-reset ((object context)))
(defmacro with-sync-lock ((context) &body body)
"Lock sync for context for the duration of body. Protected against
nonlocal exits."
(once-only (context)
`(progn
(sync-lock ,context)
(unwind-protect (progn ,@body)
(sync-unlock ,context)))))
;;;;
;;;; default context and convenience macros
;;;;
(defvar *context* nil "default cairo context")
(defmacro with-png-file ((filename format width height &optional (surface-name (gensym))) &body body)
"Execute the body with context bound to a newly created png
file, and close it after executing body."
`(let* ((,surface-name (create-image-surface ,format ,width ,height))
(*context* (create-context ,surface-name)))
(unwind-protect (progn ,@body)
(progn
(surface-write-to-png ,surface-name ,filename)
(destroy *context*)
(destroy ,surface-name)))))
(defmacro with-context ((context pointer) &body body)
"Execute body with pointer pointing to context, and check status."
(let ((status (gensym))
(pointer-name pointer))
`(with-slots ((,pointer-name pointer)) ,context
(if ,pointer-name
(multiple-value-prog1 (progn ,@body)
(let ((,status
(lookup-cairo-enum (cairo_status ,pointer-name) table-status)))
(unless (eq ,status :success)
(warn "function returned with status ~a." ,status))))
(warn "context is not alive")))))
(defmacro define-with-default-context (name &rest args)
"Define cairo function with *context* as its first argument and
args as the rest, automatically mapping name to the appropriate
cairo function."
`(defun ,name (,@args &optional (context *context*))
(with-context (context pointer)
(,(prepend-intern "cairo_" name) pointer ,@args))))
(defmacro define-with-default-context-sync (name &rest args)
"Define cairo function with *context* as its first argument and
args as the rest, automatically mapping name to the appropriate
cairo function. sync will be called after the operation."
`(defun ,name (,@args &optional (context *context*))
(with-context (context pointer)
(,(prepend-intern "cairo_" name) pointer ,@args))
(sync context)))
(defmacro define-flexible ((name pointer &rest args) &body body)
"Like define-with-default context, but with arbitrary body,
pointer will point to the context."
`(defun ,name (,@args &optional (context *context*))
(with-context (context ,pointer)
,@body)))
(defmacro define-many-with-default-context (&body args)
"Apply define-with-default context to a list. Each item is
itself a list, first element gives the function name, the rest
the arguments."
`(progn
,@(loop for arglist in args
collect `(define-with-default-context ,(car arglist) ,@(cdr arglist)))))
(defmacro define-get-set (property)
"Define set-property and get-property functions."
`(progn
(define-with-default-context ,(prepend-intern "get-" property :replace-dash nil))
(define-with-default-context ,(prepend-intern "set-" property :replace-dash nil)
,property)))
(defmacro define-get-set-using-table (property)
"Define set-property and get-property functions, where property
is looked up in table-property for conversion into Cairo's enum
constants."
`(progn
(define-flexible (,(prepend-intern "get-" property :replace-dash nil) pointer)
(lookup-cairo-enum (,(prepend-intern "cairo_get_" property) pointer)
,(prepend-intern "table-" property :replace-dash nil)))
(define-flexible (,(prepend-intern "set-" property :replace-dash nil)
pointer ,property)
(,(prepend-intern "cairo_set_" property) pointer
(lookup-enum ,property ,(prepend-intern "table-"
property :replace-dash nil))))))
;;;;
;;;; simple functions using context
;;;;
(define-many-with-default-context
(save)
(restore)
(push-group)
(pop-group)
(pop-group-to-source)
(set-source-rgb red green blue)
(set-source-rgba red green blue alpha)
(clip)
(clip-preserve)
(reset-clip)
(copy-page)
(show-page))
(define-with-default-context-sync fill-preserve)
(define-with-default-context-sync paint)
(define-with-default-context-sync paint-with-alpha alpha)
(define-with-default-context-sync stroke)
(define-with-default-context-sync stroke-preserve)
(defun set-source-surface (image x y &optional (context *context*))
(with-alive-object (image i-pointer)
(with-context (context c-pointer)
(cairo_set_source_surface c-pointer i-pointer x y))))
;;;; get-target
(defun get-target (context)
"Obtain the target surface of a given context. Width and height
will be nil, as cairo can't provide that in general."
(new-surface-with-check (cairo_get_target (slot-value context 'pointer))
nil nil))
;;;;
;;;; set colors using the cl-colors library
;;;;
(defgeneric set-source-color (color &optional context))
(defmethod set-source-color ((color rgb) &optional (context *context*))
(with-slots (red green blue) color
(set-source-rgb red green blue context)))
(defmethod set-source-color ((color rgba) &optional (context *context*))
(with-slots (red green blue alpha) color
(set-source-rgba red green blue alpha context)))
(defmethod set-source-color ((color hsv) &optional (context *context*))
(with-slots (red green blue) (hsv->rgb color)
(set-source-rgb red green blue context)))
;;;;
;;;; functions that get/set a property without any conversion
;;;;
(define-get-set line-width)
(define-get-set miter-limit)
(define-get-set tolerance)
;;;;
;;;; functions that get/set a property using a lookup table
;;;;
(define-get-set-using-table antialias)
(define-get-set-using-table fill-rule)
(define-get-set-using-table line-cap)
(define-get-set-using-table line-join)
(define-get-set-using-table operator)
;; fill-path: it should simply be fill, but it is renamed so it does
;; not clash with cl-user:fill
(define-flexible (fill-path pointer)
(cairo_fill pointer)
(sync context))
(define-flexible (set-dash pointer offset dashes)
(let ((num-dashes (length dashes)))
(with-foreign-object (dashes-pointer :double num-dashes)
(copy-double-vector-to-pointer (coerce dashes 'vector) dashes-pointer)
(cairo_set_dash pointer dashes-pointer num-dashes offset))))
(define-flexible (get-dash pointer)
"Return two values: dashes as a vector and the offset."
(let ((num-dashes (cairo_get_dash_count pointer)))
(with-foreign-objects ((dashes-pointer :double num-dashes)
(offset-pointer :double))
(cairo_get_dash pointer dashes-pointer offset-pointer)
(values (copy-pointer-to-double-vector num-dashes dashes-pointer)
(mem-ref offset-pointer :double)))))
(defmacro define-get-extents (name)
"Define functions that query two coordinate pairs."
`(define-flexible (,name pointer)
(with-foreign-objects ((x1 :double) (y1 :double)
(x2 :double) (y2 :double))
(,(prepend-intern "cairo_" name) pointer x1 y1 x2 y2)
(values (mem-ref x1 :double) (mem-ref y1 :double)
(mem-ref x2 :double) (mem-ref y2 :double)))))
(define-get-extents clip-extents)
(define-get-extents fill-extents)
(define-flexible (in-fill pointer x y)
(not (zerop (cairo_in_fill pointer x y))))
(define-flexible (in-stroke pointer x y)
(not (zerop (cairo_in_stroke pointer x y))))
;;;;
;;;; convenience functions for creating contexts directly
;;;;
(defmacro define-create-context (type)
`(defun ,(prepend-intern "create-" type :replace-dash nil :suffix "-context")
(filename width height)
"Create a surface, then a context for a file, then
destroy (dereference) the surface. The user only needs to
destroy the context when done."
(let* ((surface (,(prepend-intern "create-"
type :replace-dash nil :suffix "-surface")
filename width height))
(context (create-context surface)))
(destroy surface)
context)))
(define-create-context ps)
(define-create-context pdf)
(define-create-context svg)
| 10,444 | Common Lisp | .lisp | 258 | 37.050388 | 101 | 0.711129 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 43cc2ef213c7ffd8f6d3762267b6b863955372efbe33c3fd9ac53a50e2ff1cad | 21,713 | [
-1
] |
21,714 | pattern.lisp | rheaplex_minara/lib/cl-cairo2/pattern.lisp | (in-package :cl-cairo2)
(defclass pattern (cairo-object)
())
(defmethod lowlevel-destroy ((pattern pattern))
(cairo_pattern_destroy (get-pointer pattern)))
(defmethod lowlevel-status ((pattern pattern))
(lookup-cairo-enum (cairo_pattern_status (get-pointer pattern)) table-status))
(defmacro define-create-pattern (type &rest args)
"make create-<type>-pattern defun"
`(defun ,(prepend-intern "create-" type :suffix "-pattern") ,args
(let ((pattern (make-instance 'pattern)))
(with-checked-status pattern
(setf (slot-value pattern 'pointer) (,(prepend-intern "cairo_pattern_create_" type :replace-dash nil) ,@args))
(tg:finalize pattern #'(lambda () (lowlevel-destroy pattern)))))))
(define-create-pattern :rgb red green blue)
(define-create-pattern :rgba red green blue alpha)
(define-create-pattern :linear start-x start-y end-x end-y)
(define-create-pattern :radial center0-x center0-y radius0 center1-x center1-y radius1)
(defun create-pattern-for-surface (image)
(with-alive-object (image i-pointer)
(let ((pattern (make-instance 'pattern)))
(with-checked-status pattern
(setf (slot-value pattern 'pointer) (cairo_pattern_create_for_surface i-pointer))
(tg:finalize pattern #'(lambda () (lowlevel-destroy pattern)))))))
(defmacro define-pattern-function-flexible (name (pattern-name pointer-name &rest args) &body body)
"make a defun of the appropriate name with a wrapped body and the pattern's pointer bound to ,pointer-name"
`(defun ,(prepend-intern "pattern-" name :replace-dash nil) ,(cons pattern-name args)
(with-alive-object (,pattern-name ,pointer-name)
(with-checked-status ,pattern-name
,@body))))
(defmacro define-pattern-function (name &rest args)
"define pattern function which don't require wrapping anything except the pattern itself"
`(define-pattern-function-flexible ,name (pattern pointer ,@args)
(,(prepend-intern "cairo_pattern_" name :replace-dash t) pointer ,@args)))
;(defmacro define-pattern-function (name &rest args)
; (with-unique-names (pattern-name pointer-name)
; `(defun ,(prepend-intern "pattern-" name) ,(cons pattern-name args)
; (with-alive-object (,pattern-name ,pointer-name)
; (with-checked-status ,pattern-name
; (,(prepend-intern "cairo-pattern-" name) ,pointer-name ,@args))))))
(define-pattern-function add-color-stop-rgb offset red green blue)
(define-pattern-function add-color-stop-rgba offset red green blue alpha)
(define-pattern-function-flexible set-matrix (pattern pattern-pointer matrix)
(with-trans-matrix-in matrix matrix-pointer
(cairo_pattern_set_matrix pattern-pointer matrix-pointer)))
(define-pattern-function-flexible get-matrix (pattern pattern-pointer)
(with-trans-matrix-out matrix-pointer
(cairo_pattern_get_matrix pattern-pointer matrix-pointer)))
;maybe extend the define-get-set-using-table macro to support the cairo_pattern_set_... naming scheme?
(define-pattern-function-flexible get-type (pattern pattern-pointer)
(lookup-cairo-enum (cairo_pattern_get_type pattern-pointer) table-pattern-type))
(define-pattern-function-flexible get-extend (pattern pattern-pointer)
(lookup-cairo-enum (cairo_pattern_get_extend pattern-pointer) table-extend))
(define-pattern-function-flexible set-extend (pattern pattern-pointer extend)
(cairo_pattern_set_extend pattern-pointer (lookup-enum extend table-extend)))
(define-pattern-function-flexible get-filter (pattern pattern-pointer)
(lookup-cairo-enum (cairo_pattern_get_extend pattern-pointer) table-filter))
(define-pattern-function-flexible set-filter (pattern pattern-pointer filter)
(cairo_pattern_set_filter pattern-pointer (lookup-enum filter table-filter)))
;; the following functions are missing:
;get-rgba
;get-surface
;get-source
;get-color-stop-rgba
;get-color-stop-count
;get-linear-points
;get-radial-circles
(define-flexible (set-source context-pointer pattern)
;set a context's source to pattern
(with-alive-object (pattern pattern-pointer)
(with-checked-status pattern
(cairo_set_source context-pointer pattern-pointer))))
(define-flexible (mask context-pointer pattern)
(with-alive-object (pattern pattern-pointer)
(with-checked-status pattern
(cairo_mask context-pointer pattern-pointer))))
;;;;
;;;; convenience methods and macros for use with cl-colors:
;;;;
;;;;
(defgeneric create-color-pattern (color)
(:documentation "create a rgb or rgba pattern from the supplied color"))
(defmethod create-color-pattern ((color rgb))
(create-rgb-pattern (red color) (green color) (blue color)))
(defmethod create-color-pattern ((color rgba))
(create-rgba-pattern (red color) (green color) (blue color) (alpha color)))
(defgeneric pattern-add-color-stop (pattern offset color) ;todo: remove leading "pattern-"?
(:documentation "add a color stop to the pattern. color must be of class rgb, rgba or a list (r g b) or (r g b a)"))
(defmethod pattern-add-color-stop :around ((pattern pattern) offset color)
(if (member (pattern-get-type pattern) '(:linear :radial))
(call-next-method)
(error "cannot add a color stop to this pattern type")))
(defmethod pattern-add-color-stop ((pattern pattern) (offset number) (color cl-colors:rgb))
(pattern-add-color-stop-rgb pattern offset
(red color)
(green color)
(blue color)))
(defmethod pattern-add-color-stop ((pattern pattern) (offset number) (color cl-colors:rgba))
(pattern-add-color-stop-rgba pattern offset
(red color)
(green color)
(blue color)
(alpha color)))
(defmethod pattern-add-color-stop ((pattern pattern) (offset number) (color cons))
(unless (every #'numberp color)
(error "invalid color given: not a number"))
(apply (case (length color)
(3 #'pattern-add-color-stop-rgb)
(4 #'pattern-add-color-stop-rgba)
(otherwise (error "invalid color given: list is not of length 3 or 4")))
pattern offset color))
(defmacro make-with-pattern (type &rest args)
"makes a macro that creates and binds a <type> pattern to pattern-name, adds color stops to the pattern
(calling each element of color-stops with pattern-add-color-stop) before evaluating a body and destroying
the pattern."
`(defmacro ,(prepend-intern "with-" type :suffix "-pattern") (pattern-name ,args color-stops &body body)
(with-unique-names (offset-name color-name)
`(let ((,pattern-name ,(list ',(prepend-intern "create-" type :suffix "-pattern") ,@args)))
(loop for (,offset-name ,color-name) in ,color-stops
do (format t "~a~%" (class-of ,color-name))
do (pattern-add-color-stop ,pattern-name ,offset-name ,color-name))
(prog1
(progn ,@body)
(destroy ,pattern-name))))))
(make-with-pattern :radial center0-x center0-y radius0 center1-x center1-y radius1)
(make-with-pattern :linear start-x start-y end-x end-y)
(defun pattern-forms-p (pflist)
"pattern-forms := (pattern-form+)
pattern-form := (pattern-name (create-xxxx-pattern args))"
(if (consp pflist)
(dolist (pf pflist t)
(if (and (consp pf) (eql (length pf) 2))
(if (and (atom (car pf)) (consp (cadr pf)))
t
(error "invalid create-xxx-pattern form:~A" pf))
(error "invalid pattern-form:~A" pf)))
(error "invalid pattern-forms:~A" pflist)))
(defmacro with-patterns (pattern-forms &body body)
"create patterns from pattern-forms, each has its name as specified in the corresponding pattern-form,
and then execute body in which the patterns can be referenced using the names."
(when (pattern-forms-p pattern-forms)
`(let ,(loop for f in pattern-forms collect `(,(car f) ,(cadr f)))
(unwind-protect (progn ,@body)
(progn
,@(loop for f in pattern-forms collect `(destroy ,(car f))))))))
| 7,756 | Common Lisp | .lisp | 145 | 49.951724 | 118 | 0.732893 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 96d7671e8f6de0eb0ac165d004dc21e40d56c7b2416f600f56e3e53b8f6d5c3b | 21,714 | [
-1
] |
21,715 | gtk-context.lisp | rheaplex_minara/lib/cl-cairo2/gtk-context.lisp | (in-package :cl-cairo2)
;; library functions to create a gdk-surface
;; written by Peter Hildebrandt <[email protected]>
(defcfun ("gdk_cairo_create" gdk-cairo-create) :pointer (window :pointer))
(defclass gtk-context (context)
())
(defun create-gtk-context (gdk-window)
"creates an context to draw on a GTK widget, more precisely on the
associated gdk-window. This should only be called from within the
expose event. In cells-gtk, use (gtk-adds-widget-window gtk-pointer)
to obtain the gdk-window. 'gtk-pointer' is the pointer parameter
passed to the expose event handler."
(make-instance 'gtk-context
:pointer (gdk-cairo-create gdk-window)))
(defmethod destroy ((self gtk-context))
(cairo_destroy (slot-value self 'pointer)))
(defmacro with-gtk-context ((context gdk-window) &body body)
"Executes body while context is bound to a valid cairo context for
gdk-window. This should only be called from within an expose event
handler. In cells-gtk, use (gtk-adds-widget-window gtk-pointer) to
obtain the gdk-window. 'gtk-pointer' is the pointer parameter passed
to the expose event handler."
(with-gensyms (context-pointer)
`(let ((,context (create-gtk-context ,gdk-window)))
(with-context (,context ,context-pointer)
,@body)
(destroy ,context))))
;; export manually
(export '(xlib-image-context create-xlib-image-context))
| 1,436 | Common Lisp | .lisp | 29 | 45.37931 | 74 | 0.745812 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 4882020d5f49752e134493958036987aaa5954b31bd3bad64dbf3aabdd98feea | 21,715 | [
-1
] |
21,716 | lissajous.lisp | rheaplex_minara/lib/cl-cairo2/tutorial/lissajous.lisp | (in-package :cl-cairo2)
;;;;
;;;; Lissajous curves
;;;;
(defun show-text-aligned (text x y &optional (x-align 0.5) (y-align 0.5)
(context *context*))
"Show text aligned relative to (x,y)."
(let ((*context* context))
(multiple-value-bind (x-bearing y-bearing width height)
(text-extents text)
(move-to (- x (* width x-align) x-bearing)
(- y (* height y-align) y-bearing))
(show-text text))))
(defparameter size 500)
(defparameter margin 20)
(defparameter a 9)
(defparameter b 8)
(defparameter delta (/ pi 2))
(defparameter density 2000)
(defparameter macp (or (member :darwin *features*)
(member :macos *features*)
(member :macosx *features*)))
;; get context
(setf *context* (create-xlib-image-context
size size
:window-name (concatenate 'string "Lissajous" (if macp "-mac" ""))))
;; pastel blue background
(rectangle 0 0 size size)
(set-source-rgb 0.9 0.9 1)
(fill-path)
;; Lissajous curves, blue
(labels ((stretch (x) (+ (* (1+ x) (- (/ size 2) margin)) margin)))
(move-to (stretch (sin delta)) (stretch 0))
(dotimes (i density)
(let* ((v (/ (* i pi 2) density))
(x (sin (+ (* a v) delta)))
(y (sin (* b v))))
(line-to (stretch x) (stretch y)))))
(close-path)
(set-line-width .5)
(set-source-rgb 0 0 1)
(stroke)
;; "cl-cairo2" in Arial bold to the center
(select-font-face "Arial" :normal :bold)
(set-font-size 100)
(set-source-rgba 1 0.75 0 0.5) ; orange
(show-text-aligned "cl-cairo2" (/ size 2) (/ size 2))
;; ask to quit
(loop until (y-or-n-p "quit?"))
;; done
(destroy *context*)
| 1,574 | Common Lisp | .lisp | 51 | 28.196078 | 73 | 0.641447 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | d1e453bdfbc9101610938d9b5282bf55947c6dd1cad0e097dfb81fb50686c02c | 21,716 | [
-1
] |
21,717 | xlib-image-context-test.lisp | rheaplex_minara/lib/cl-cairo2/tutorial/xlib-image-context-test.lisp | (in-package :cl-cairo2)
(setf *context* (create-xlib-image-context 400 200 :display-name ":0"))
(move-to 0 0)
(line-to 400 200)
(set-source-color +green+)
(stroke)
(let* ((display (slot-value *context* 'display))
(screen (xdefaultscreen display))
(depth (xdefaultdepth display screen)))
depth)
(with-foreign-slots ((width height format data
byte-order bitmap-unit
bitmap-bit-order bitmap-pad
depth bytes-per-line
bits-per-pixel red-mask
green-mask blue-mask
xoffset) (slot-value *context* 'ximage) ximage)
(values width height format data
byte-order bitmap-unit
bitmap-bit-order bitmap-pad
depth bytes-per-line
bits-per-pixel red-mask
green-mask blue-mask
xoffset))
| 747 | Common Lisp | .lisp | 24 | 26.75 | 71 | 0.701389 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | f9ce3796edd362e64ffc5d8c894898291173d79d51f5f43e3dd391e162a63563 | 21,717 | [
-1
] |
21,718 | cairo-tutorial.lisp | rheaplex_minara/lib/cl-cairo2/tutorial/cairo-tutorial.lisp | ;;;
;;; How to run this sample code
;;;
;;; 1) create Temp/png directory under the current *default-pathname-defaults*,
;;; which is referenced as *png-dir* in the code,
;;; 2) compile the code, and then
;;; 3) call the exported functions.
;;;
;;; Result png files are saved to *png-dir*.
;;;
(defpackage :cairo-tutorial
(:use :cl :cl-cairo2)
(:export :stroke-example
:fill-example
:show-text-example
:paint-example
:mask-example
:preparing-and-selecting-source-example
:preparing-and-selecting-source2-example
:path-example
:text-example
:line-width1-example
:line-width2-example
:text-alignment-example
:run-all-examples))
(in-package :cairo-tutorial)
(defvar *png-dir* (merge-pathnames "Temp/png/"))
(defvar *png-width* 400)
(defvar *png-height* 400)
(defun clear-surface-rgba ()
(set-source-rgba 1.0 1.0 1.0 1.0)
(paint))
(defun png-pathname-string (fname &optional (check-existance nil))
(let ((pngdir *png-dir*))
(if (probe-file pngdir)
(let ((path (namestring (merge-pathnames (concatenate 'string fname ".png") pngdir))))
(if check-existance
(if (probe-file path)
path
(error "~A doesn't exist" path))
path))
(error "~A (see *png-dir*) doesn't exist" pngdir))))
(defmacro with-surface-rgba ((fname width height) &body body)
`(with-png-file (,fname :argb32 ,width ,height)
(clear-surface-rgba)
(scale ,width ,height)
,@body))
(defmacro write-to-png ((verb) &body body)
`(with-surface-rgba ((png-pathname-string ,verb) *png-width* *png-height*)
,@body))
;;; executable examples start from here
(defun stroke-example ()
(write-to-png ("stroke")
(set-line-width 0.1)
(set-source-rgb 0 0 0)
(rectangle 0.25 0.25 0.5 0.5)
(stroke)))
(defun fill-example ()
(write-to-png ("fill")
(set-source-rgb 0 0 0)
(rectangle 0.25 0.25 0.5 0.5)
(fill-path)))
(defun show-text-example ()
(write-to-png ("show-text")
(set-source-rgb 0 0 0)
(select-font-face "Georgia" :normal :bold)
(set-font-size 1.2)
(let ((te (get-text-extents "a")))
(move-to (- 0.5 (/ (text-width te) 2) (text-x-bearing te))
(- 0.5 (/ (text-height te) 2) (text-y-bearing te)))
(show-text "a"))))
(defun paint-example ()
(write-to-png ("paint")
(set-source-rgb 0 0 0)
(paint-with-alpha 0.5)))
(defun mask-example ()
(write-to-png ("mask")
(with-patterns ((linpat (create-linear-pattern 0 0 1 1))
(radpat (create-radial-pattern 0.5 0.5 0.25 0.5 0.5 0.6)))
(pattern-add-color-stop-rgb linpat 0 0 0.3 0.8)
(pattern-add-color-stop-rgb linpat 1 0 0.8 0.3)
;;
(pattern-add-color-stop-rgba radpat 0 0 0 0 1)
(pattern-add-color-stop-rgba radpat 1 0 0 0 0)
;;
(set-source linpat)
(mask radpat))))
(defun preparing-and-selecting-source-example ()
(write-to-png ("prep-select-source")
(set-source-rgb 0 0 0)
(move-to 0 0)
(line-to 1 1)
(move-to 1 0)
(line-to 0 1)
(set-line-width 0.2)
(stroke)
;;
(rectangle 0 0 0.5 0.5)
(set-source-rgba 1 0 0 0.8)
(fill-path)
;;
(rectangle 0 0.5 0.5 0.5)
(set-source-rgba 0 1 0 0.6)
(fill-path)
;;
(rectangle 0.5 0 0.5 0.5)
(set-source-rgba 0 0 1 0.4)
(fill-path)))
(defun preparing-and-selecting-source2-example (&key (1st-fill-only nil) (2nd-fill-only nil))
(write-to-png ("prep-select-source2")
(block exit-anchor
(with-patterns ((radpat (create-radial-pattern 0.25 0.25 0.1 0.5 0.5 0.5))
(linpat (create-linear-pattern 0.25 0.35 0.75 0.65)))
;;
(unless 2nd-fill-only
(pattern-add-color-stop-rgb radpat 0 1.0 0.8 0.8)
(pattern-add-color-stop-rgb radpat 1 0.9 0.0 0.0)
(dotimes (i 8)
(dotimes (j 8)
(rectangle (- (/ (1+ i) 10.0) 0.04) (- (/ (1+ j) 10.0) 0.04) 0.08 0.08)))
(set-source radpat)
(fill-path)
(when 1st-fill-only (return-from exit-anchor)))
;;
(pattern-add-color-stop-rgba linpat 0.00 1.0 1.0 1.0 0.0)
(pattern-add-color-stop-rgba linpat 0.25 0.0 1.0 0.0 0.5)
(pattern-add-color-stop-rgba linpat 0.50 1.0 1.0 1.0 0.0)
(pattern-add-color-stop-rgba linpat 0.75 0.0 0.0 1.0 0.5)
(pattern-add-color-stop-rgba linpat 1.00 1.0 1.0 1.0 0.0)
(rectangle 0 0 1 1)
(set-source linpat)
(fill-path)))))
(defun path-example (&key (do-stroke t) (do-fill nil))
(write-to-png ("path")
(set-line-width 0.1)
(set-source-rgb 0 0 0)
;;
(move-to 0.25 0.25)
(line-to 0.5 0.375)
(rel-line-to 0.25 -0.125)
(arc 0.5 0.5 (* 0.25 (sqrt 2)) (* -0.25 pi) (* 0.25 pi))
(rel-curve-to -0.25 -0.125 -0.25 0.125 -0.5 0)
(close-path)
;;
(when do-stroke
(set-line-width 0.04)
(set-source-rgb 0 0.64 0)
(stroke-preserve))
;;
(when do-fill
(set-source-rgba 0 0 0.8 0.4)
(fill-path))))
(defun text-example ()
(write-to-png ("textextents")
;; variable declarations
(let ((x nil)
(y nil)
(px nil)
(ux 1)
(uy 1)
(dashlength (make-array 1 :element-type 'float :initial-element 0.0))
(text "joy")
(fe nil)
(te nil))
;;
;; prepare drawing context
;;
(set-font-size 0.5)
;;
;; drawing code starts here
;;
(set-source-rgb 0 0 0)
(select-font-face "Georgia" :normal :bold)
(setf fe (get-font-extents))
;;
(multiple-value-setq (ux uy) (device-to-user-distance ux uy))
(setf px (max ux uy))
(setf fe (get-font-extents))
(setf te (get-text-extents text))
(setf x (- 0.5 (text-x-bearing te) (/ (text-width te) 2)))
(setf y (+ (- 0.5 (font-descent fe)) (/ (font-height fe) 2)))
;;
;; baseline, descent, ascent, height
;;
(set-line-width (* 4 px))
(setf (aref dashlength 0) (* 9 px))
(set-dash 0 dashlength)
(set-source-rgba 0 0.6 0 0.5)
(move-to (+ x (text-x-bearing te)) y)
(rel-line-to (text-width te) 0)
(move-to (+ x (text-x-bearing te)) (+ y (font-descent fe)))
(rel-line-to (text-width te) 0)
(move-to (+ x (text-x-bearing te)) (- y (font-ascent fe)))
(rel-line-to (text-width te) 0)
(move-to (+ x (text-x-bearing te)) (- y (font-height fe)))
(rel-line-to (text-width te) 0)
(stroke)
;;
;; extents: width & height
;;
(set-source-rgba 0 0 0.75 0.5)
(set-line-width px)
(setf (aref dashlength 0) (* 3 px))
(set-dash 0 dashlength)
(rectangle (+ x (text-x-bearing te)) (+ y (text-y-bearing te)) (text-width te) (text-height te))
(stroke)
;;
;; text
;;
(move-to x y)
(set-source-rgb 0 0 0)
(show-text text)
;;
;; bearing
;;
(set-dash 0 (make-array 0))
(set-line-width (* 2 px))
(set-source-rgba 0 0 0.75 0.5)
(move-to x y)
(rel-line-to (text-x-bearing te) (text-y-bearing te))
(stroke)
;;
;; text's advance
;;
(set-source-rgba 0 0 0.75 0.5)
(arc (+ x (text-x-advance te)) (+ y (text-y-advance te)) (* 5 px) 0 (* 2 pi))
(fill-path)
;;
;; reference point
;;
(arc x y (* 5 px) 0 (* 2 pi))
(set-source-rgba 0.75 0 0 0.5)
(fill-path))))
(defun line-width1-example ()
(write-to-png ("line-width1")
(let ((ux 1) (uy 1))
(multiple-value-setq (ux uy) (device-to-user-distance ux uy))
(when (< ux uy) (setf ux uy))
(set-line-width ux)
(set-source-rgb 0 0.2 0.8)
(rectangle 0 0 1 1)
(stroke)
(move-to 0 0)
(line-to 1 1)
(move-to 0 1)
(line-to 1 0)
(move-to 0 0.5)
(line-to 1 0.5)
(move-to 0.5 0)
(line-to 0.5 1)
(stroke))))
(defun line-width2-example ()
(write-to-png ("line-width2")
(set-source-rgb 0 1 0)
(set-line-width 0.1)
;;
(save)
(scale 0.5 1)
(arc 0.5 0.5 0.4 0 (* 2 pi))
(stroke)
;;
(translate 1 0)
(arc 0.5 0.5 0.4 0 (* 2 pi))
(restore)
(stroke)))
(defun text-alignment-example (&key (font-name "Georgia") use-fe)
(write-to-png ("text-alignment")
(set-source-rgb 0 0 0)
(select-font-face font-name :normal :normal)
(set-font-size 0.1)
;;
(let* ((alphabet "QrStUvWxYz")
(alphalen (length alphabet))
(fe (get-font-extents)))
(dotimes (i alphalen)
(let* ((str (string (aref alphabet i)))
(te (get-text-extents str))
(x (+ (/ 1 (* alphalen 2)) (* (/ 1 alphalen) i))))
(move-to (- x (text-x-bearing te) (/ (text-width te) 2))
(if use-fe
(+ (- 0.5 (font-descent fe)) (/ (font-height fe) 2))
(- 0.5 (text-y-bearing te) (/ (text-height te) 2))))
(show-text str))))))
(defun run-all-examples (&optional (debug nil))
(let* ((-example "-EXAMPLE")
(-example-len (length -example))
(pkg #.(package-name *package*)))
(mapcar #'(lambda (sym)
(let* ((sym-name (symbol-name sym))
(idx (search -example sym-name :from-end t)))
(if (and (< 0 idx)
(eql (length sym-name) (+ idx -example-len))
(fboundp (intern sym-name pkg)))
(if (not debug)
(funcall (symbol-function (intern sym-name pkg)))
(list sym sym-name))
(when debug
(list sym nil)))))
(apropos-list -example pkg))))
| 8,774 | Common Lisp | .lisp | 299 | 25.765886 | 99 | 0.614147 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 1797f019274fb9353a5c9c51ece17a0d6c691691b4e0fe9a6cce44765a0eeb79 | 21,718 | [
209927
] |
21,719 | example.lisp | rheaplex_minara/lib/cl-cairo2/tutorial/example.lisp | (require :asdf)
(asdf:operate 'asdf:load-op :cl-cairo2)
;;;; Make a test package
(defpackage :cairo-example
(:use :common-lisp :cl-cairo2))
(in-package :cairo-example)
;;;;
;;;; short example for the tutorial
;;;;
(defparameter *surface* (create-pdf-surface "example.pdf" 200 100))
(setf *context* (create-context *surface*))
(destroy *surface*)
;; clear the whole canvas with blue
(set-source-rgb 0.2 0.2 1)
(paint)
;; draw a white diagonal line
(move-to 200 0)
(line-to 0 100)
(set-source-rgb 1 1 1)
(set-line-width 5)
(stroke)
;; destroy context, this also destroys the surface and closes the file
(destroy *context*)
;;;;
;;;; helper functions
;;;;
(defun show-text-aligned (text x y &optional (x-align 0.5) (y-align 0.5)
(context *context*))
"Show text aligned relative to (x,y)."
(let ((*context* context))
(multiple-value-bind (x-bearing y-bearing width height)
(text-extents text)
(move-to (- x (* width x-align) x-bearing)
(- y (* height y-align) y-bearing))
(show-text text))))
;;;; very simple text example
(setf *context* (create-pdf-context "simpletext.pdf" 100 100))
(move-to 0 100)
(set-font-size 50)
(show-text "foo")
(destroy *context*)
;;;;
;;;; text placement example
;;;;
;;;; This example demonstrates the use of text-extents, by placing
;;;; text aligned relative to a red marker.
(defun mark-at (x y d red green blue)
"Make a rectangle of size 2d around x y with the given colors,
50% alpha. Used for marking points."
(rectangle (- x d) (- y d) (* 2 d) (* 2 d))
(set-source-rgba red green blue 0.5)
(fill-path))
(defun show-text-with-marker (text x y x-align y-align)
"Show text aligned relative to a red market at (x,y)."
(mark-at x y 2 1 0 0)
(set-source-rgba 0 0 0 0.6)
(show-text-aligned text x y x-align y-align))
(defparameter width 500)
(defparameter height 500)
(defparameter text "Fog") ; contains g, which goes below baseline
(defparameter size 50)
(defparameter x 20d0)
(defparameter y 50d0)
(setf *context* (create-pdf-context "text.pdf" width height))
;;(setf *context* (create-svg-context "text.svg" width height))
;;(setf *context* (create-pdf-context "text.pdf" width height))
;; white background
(set-source-rgb 1 1 1)
(paint)
;; setup font
(select-font-face "Arial" :normal :normal)
(set-font-size size)
;; starting point
(mark-at x y 2 1 0 0) ; red
;; first text in a box
(multiple-value-bind (x-bearing y-bearing text-width text-height)
(text-extents text)
(let ((rect-x (+ x x-bearing))
(rect-y (+ y y-bearing)))
(rectangle rect-x rect-y text-width text-height)
(set-source-rgba 0 0 1 0.3) ; blue
(set-line-width 1)
(set-dash 0 '(5 5))
(stroke)))
(set-source-rgba 0 0 0 0.6)
(move-to x y)
(show-text text)
;; text automatically aligned
;; (dolist (x-align '(0 0.5 1))
;; (dolist (y-align '(0 0.5 1))
;; (show-text-with-marker text (+ x (* x-align 300)) (+ y (* y-align 300) 100)
;; x-align y-align)))
(dolist (x-align '(0))
(dolist (y-align '(0))
(show-text-with-marker text (+ x (* x-align 300)) (+ y (* y-align 300) 100)
x-align y-align)))
(show-text-with-marker text x (+ y 100d0) 0d0 0d0)
;; done
(destroy *context*)
;;;;
;;;; text placement example
;;;;
;;;; This example demonstrates the use of text-extents, by placing
;;;; text aligned relative to a red marker.
(defun mark-at (x y d red green blue)
"Make a rectangle of size 2d around x y with the given colors,
50% alpha. Used for marking points."
(rectangle (- x d) (- y d) (* 2 d) (* 2 d))
(set-source-rgba red green blue 0.5)
(fill-path))
(defun show-text-with-marker (text x y x-align y-align)
"Show text aligned relative to a red market at (x,y)."
(mark-at x y 2 1 0 0)
(set-source-rgba 0 0 0 0.6)
(show-text-aligned text x y x-align y-align))
(defparameter width 500)
(defparameter height 500)
(defparameter text "Fog") ; contains g, which goes below baseline
(defparameter size 50)
(defparameter x 20)
(defparameter y 50)
(setf *context* (create-pdf-context "text2.pdf" width height))
;;(setf *context* (create-svg-context "text.svg" width height))
;;(setf *context* (create-pdf-context "text.pdf" width height))
;; white background
(set-source-rgb 1 1 1)
(paint)
;; setup font
(select-font-face "Arial" :normal :normal)
(set-font-size size)
;; starting point
(mark-at x y 2 1 0 0) ; red
;; first text in a box
(multiple-value-bind (x-bearing y-bearing text-width text-height)
(text-extents text)
(let ((rect-x (+ x x-bearing))
(rect-y (+ y y-bearing)))
(rectangle rect-x rect-y text-width text-height)
(set-source-rgba 0 0 1 0.3) ; blue
(set-line-width 1)
(set-dash 0 '(5 5))
(stroke)))
(set-source-rgba 0 0 0 0.6)
(move-to x y)
(show-text text)
;; text automatically aligned
(dolist (x-align '(0 0.5 1))
(dolist (y-align '(0 0.5 1))
(show-text-with-marker text
(+ x (* x-align 300))
(+ y (* y-align 300) 100)
x-align y-align)))
;(show-text-with-marker text (+ x 0) (+ y 0 0) 0 0)
;; done
(destroy *context*)
;;;;
;;;; Lissajous curves
;;;;
(defparameter size 500)
(defparameter margin 20)
(defparameter a 9)
(defparameter b 8)
(defparameter delta (/ pi 2))
(defparameter density 2000)
(setf *context* (create-pdf-context "lissajous.pdf" size size))
;; pastel blue background
(rectangle 0 0 width height)
(set-source-rgb 0.9 0.9 1)
(fill-path)
;; Lissajous curves, blue
(labels ((stretch (x) (+ (* (1+ x) (- (/ size 2) margin)) margin)))
(move-to (stretch (sin delta)) (stretch 0))
(dotimes (i density)
(let* ((v (/ (* i pi 2) density))
(x (sin (+ (* a v) delta)))
(y (sin (* b v))))
(line-to (stretch x) (stretch y)))))
(close-path)
(set-line-width .5)
(set-source-rgb 0 0 1)
(stroke)
;; "cl-cairo2" in Arial bold to the center
(select-font-face "Arial" :normal :bold)
(set-font-size 100)
(set-source-rgba 1 0.75 0 0.5) ; orange
(show-text-aligned "cl-cairo2" (/ size 2) (/ size 2))
;; done
(destroy *context*)
;;;;
;;;; transformation matrix example (for Judit, with love)
;;;;
;;;; This example uses the function heart which fills a heart-shape
;;;; with given transparency at the origin, using a fixed size.
;;;; Rotation, translation and scaling is achieved using the
;;;; appropriate cairo functions.
(defun heart (alpha)
"Draw a heart with fixed size and the given transparency alpha.
Heart is upside down."
(let ((radius (sqrt 0.5)))
(move-to 0 -2)
(line-to 1 -1)
(arc 0.5 -0.5 radius (deg-to-rad -45) (deg-to-rad 135))
(arc -0.5 -0.5 radius (deg-to-rad 45) (deg-to-rad 215))
(close-path)
(set-source-rgba 1 0 0 alpha)
(fill-path)))
(defparameter width 1024)
(defparameter height 768)
(defparameter max-angle 40d0)
(with-png-file ("hearts.png" :rgb24 width height)
;; fill with white
(rectangle 0 0 width height)
(set-source-rgb 1 1 1)
(fill-path)
;; draw the hearts
(dotimes (i 200)
(let ((scaling (+ 5d0 (random 40d0))))
(reset-trans-matrix) ; reset matrix
(translate (random width) (random height)) ; move the origin
(scale scaling scaling) ; scale
(rotate (deg-to-rad (- (random (* 2 max-angle)) max-angle 180))) ; rotate
(heart (+ 0.1 (random 0.7))))))
;;;;
;;;; make a rainbow-like pattern
;;;;
;;;;
(defparameter width 100)
(defparameter height 40)
(setf *context* (create-pdf-context "pattern.pdf" width height))
(with-linear-pattern rainbow (0 0 width 0)
`((0 (0.7 0 0.7 0)) ;rgb(a) color as list
(1/6 ,cl-colors:+blue+) ;color as cl-color
(2/6 ,cl-colors:+green+)
(3/6 ,cl-colors:+yellow+)
(4/6 ,cl-colors:+orange+)
(5/6 ,cl-colors:+red+)
(1 ,cl-colors:+violetred+))
(rectangle 0 0 width height)
(set-source rainbow)
(fill-path))
(destroy *context*)
| 7,779 | Common Lisp | .lisp | 241 | 29.846473 | 82 | 0.662938 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 6d168d31cdf61c0a70dd8cb0628379fe58ed5cee504bb90fe0bfe66f843f2ff9 | 21,719 | [
195877
] |
21,720 | lissajous-win.lisp | rheaplex_minara/lib/cl-cairo2/tutorial/lissajous-win.lisp | ;;;
;;; Lissajous curve demo using Win32 surface
;;;
;;; Note: running this code via the default swank server wouldn't work.
;;; One sure way to run this code is to start your Lisp system from a DOS
;;; command window, load this code from the REPL and then call lissajous-win:run.
;;;
(defpackage :lissajous-win
(:use #:cl #:cffi #:cl-cairo2)
(:shadowing-import-from
#:cl-cairo2 #:context #:arc #:fill-path #:get-miter-limit #:line-to #:mask #:set-miter-limit #:rectangle)
(:export
#:run))
(in-package :lissajous-win)
;;; load Win DLLs, define Win consts and functions
(load-foreign-library '(:default "gdi32"))
(load-foreign-library '(:default "kernel32"))
(load-foreign-library '(:default "user32"))
(cl:defconstant +cs-hredraw+ 2)
(cl:defconstant +cs-vredraw+ 1)
(cl:defconstant +ws-overlappedwindow+ #xcf0000)
(cl:defconstant +cw-usedefault+ #x80000000)
(cl:defconstant +white-brush+ 0)
(cl:defconstant +sw-shownormal+ 1)
(cl:defconstant +wm-create+ 1)
(cl:defconstant +wm-paint+ 15)
(cl:defconstant +wm-destroy+ 2)
(cl:defconstant +dt-center+ 1)
(cl:defconstant +dt-vcenter+ 4)
(cl:defconstant +dt-singleline+ 32)
(cffi:defcstruct wndclassexw
(cbSize :unsigned-int)
(style :unsigned-int)
(lpfnWndProc :pointer)
(cbClsExtra :int)
(cbWndExtra :int)
(hInstance :pointer)
(hIcon :pointer)
(hCursor :pointer)
(hbrBackground :pointer)
(lpszMenuName :pointer)
(lpszClassName :pointer)
(hIconSm :pointer))
(cffi:defcstruct rect
(left :long)
(top :long)
(right :long)
(bottom :long))
(cffi:defcstruct paintstruct
(hdc :pointer)
(fErase :INT)
(rcPaint RECT)
(fRestore :INT)
(fIncUpdate :INT)
(rgbReserved :pointer))
(cffi:defcstruct point
(x :long)
(y :long))
(cffi:defcstruct msg
(hwnd :pointer)
(message :unsigned-int)
(wParam :unsigned-int)
(lParam :long)
(time :unsigned-long)
(pt point))
(cffi:defcfun ("GetModuleHandleW" get-module-handle-w) :pointer
(arg0 :pointer))
(cffi:defcfun ("LoadIconW" load-icon-w) :pointer
(arg0 :pointer)
(arg1 :pointer))
(cffi:defcfun ("LoadCursorW" load-cursor-w) :pointer
(arg0 :pointer)
(arg1 :pointer))
(cffi:defcfun ("GetStockObject" get-stock-object) :pointer
(arg0 :int))
(cffi:defcfun ("RegisterClassExW" register-class-ex-w) :unsigned-short
(arg0 :pointer))
(cffi:defcfun ("GetLastError" get-last-error) :unsigned-long)
(cffi:defcfun ("CreateWindowExW" create-window-ex-w) :pointer
(arg0 :unsigned-long)
(arg1 :pointer)
(arg2 :pointer)
(arg3 :unsigned-long)
(arg4 :int)
(arg5 :int)
(arg6 :int)
(arg7 :int)
(arg8 :pointer)
(arg9 :pointer)
(arg10 :pointer)
(arg11 :pointer))
(cffi:defcfun ("DefWindowProcW" def-window-proc-w) :long
(arg0 :pointer)
(arg1 :unsigned-int)
(arg2 :unsigned-int)
(arg3 :long))
(cffi:defcfun ("DestroyWindow" destroy-window) :int
(arg0 :pointer))
(cffi:defcfun ("UnregisterClassW" unregister-class-w) :int
(arg0 :pointer)
(arg1 :pointer))
(cffi:defcfun ("ShowWindow" show-window) :int
(arg0 :pointer)
(arg1 :int))
(cffi:defcfun ("SetForegroundWindow" set-foreground-window) :int
(arg0 :pointer))
(cffi:defcfun ("GetMessageW" get-message-w) :int
(arg0 :pointer)
(arg1 :pointer)
(arg2 :unsigned-int)
(arg3 :unsigned-int))
(cffi:defcfun ("TranslateMessage" translate-message) :int
(arg0 :pointer))
(cffi:defcfun ("DispatchMessageW" dispatch-message-w) :long
(arg0 :pointer))
(cffi:defcfun ("MoveWindow" move-window) :int
(arg0 :pointer)
(arg1 :int)
(arg2 :int)
(arg3 :int)
(arg4 :int)
(arg5 :int))
(cffi:defcfun ("BeginPaint" begin-paint) :pointer
(arg0 :pointer)
(arg1 :pointer))
(cffi:defcfun ("EndPaint" end-paint) :int
(arg0 :pointer)
(arg1 :pointer))
(cffi:defcfun ("GetClientRect" get-client-rect) :int
(arg0 :pointer)
(arg1 :pointer))
(cffi:defcfun ("PostQuitMessage" post-quit-message) :void
(arg0 :int))
;;; Lissajous curves
(defparameter x 80)
(defparameter y 16)
(defparameter size 500)
(defparameter margin 20)
(defparameter a 9)
(defparameter b 8)
(defparameter delta (/ pi 2))
(defparameter density 2000)
(defun show-text-aligned (text x y &optional (x-align 0.5) (y-align 0.5)
(context *context*))
"Show text aligned relative to (x,y)."
(let ((*context* context))
(multiple-value-bind (x-bearing y-bearing width height)
(text-extents text)
(move-to (- x (* width x-align) x-bearing)
(- y (* height y-align) y-bearing))
(show-text text))))
(defun draw-lissajous (hwnd hdc ps)
(declare (ignore ps))
(with-win32-context (hwnd hdc width height)
(let ((*default-foreign-encoding* :utf-8)
(size (if (< width height) width height)))
;; pastel blue background
(rectangle 0 0 width height)
(set-source-rgb 0.9 0.9 1)
(fill-path)
;; Lissajous curves, blue
(labels ((stretch (x) (+ (* (1+ x) (- (/ size 2) margin)) margin)))
(move-to (stretch (sin delta)) (stretch 0))
(dotimes (i density)
(let* ((v (/ (* i pi 2) density))
(x (sin (+ (* a v) delta)))
(y (sin (* b v))))
(line-to (stretch x) (stretch y)))))
(close-path)
(set-line-width .5)
(set-source-rgb 0 0 1)
(stroke)
;; "cl-cairo2" in Arial bold to the center
(select-font-face "Arial" :normal :bold)
(set-font-size 100)
(set-source-rgba 1 0.75 0 0.5) ; orange
(show-text-aligned "cl-cairo2" (/ size 2) (/ size 2)))))
;;;
(defmacro make-int-resource (id)
`(make-pointer ,id))
(defparameter *null* (null-pointer))
(defparameter *hinstance* (get-module-handle-w *null*))
(defparameter *idi-application* (make-int-resource 32512))
(defparameter *idc-arrow* (make-int-resource 32512))
(defparameter *appname* "Lissajous-win")
(defmacro with-begin-paint ((hwnd hdc ps) &body body)
`(with-foreign-object (,ps 'paintstruct)
(let ((,hdc (begin-paint ,hwnd ,ps)))
,@body
(end-paint ,hwnd ,ps))))
(defcallback wind-proc :long ((hwnd :pointer) (msg :unsigned-int) (wparam :unsigned-int) (lparam :long))
(let ((rval 0))
(cond ((eql msg +wm-create+)
(move-window hwnd x y size size 1))
((eql msg +wm-paint+)
(with-begin-paint (hwnd hdc ps)
(draw-lissajous hwnd hdc ps)))
((eql msg +wm-destroy+)
(post-quit-message 0))
(t
(setf rval (def-window-proc-w hwnd msg wparam lparam))))
rval))
(defmacro fsv (ptr struct slot)
`(foreign-slot-value ,ptr ,struct ,slot))
(defun register-window-class (wc-name)
(let ((wnd-proc (get-callback 'wind-proc)))
(with-foreign-object (wc 'wndclassexw)
(setf (fsv wc 'wndclassexw 'cbSize) (foreign-type-size 'wndclassexw)
(fsv wc 'wndclassexw 'style) (logior +cs-hredraw+ +cs-vredraw+)
(fsv wc 'wndclassexw 'lpfnWndProc) wnd-proc
(fsv wc 'wndclassexw 'cbClsExtra) 0
(fsv wc 'wndclassexw 'cbWndExtra) 0
(fsv wc 'wndclassexw 'hInstance) *hinstance*
(fsv wc 'wndclassexw 'hIcon) (load-icon-w *null* *idi-application*)
(fsv wc 'wndclassexw 'hIconSm) (load-icon-w *null* *idi-application*)
(fsv wc 'wndclassexw 'hCursor) (load-cursor-w *null* *idc-arrow*)
(fsv wc 'wndclassexw 'hbrBackground) (get-stock-object +white-brush+)
(fsv wc 'wndclassexw 'lpszClassName) wc-name
(fsv wc 'wndclassexw 'lpszMenuName) *null*)
(let ((wcatom (register-class-ex-w wc)))
(if (zerop wcatom)
(error "register-class-ex-w failed:~A~%" (get-last-error))
wcatom)))))
(defun cleanup (wc-name hwnd)
(when (not (null-pointer-p hwnd))
(destroy-window hwnd))
(unregister-class-w wc-name *hinstance*))
(defun create-window (wc-name wnd-name)
(let ((hwnd (create-window-ex-w
0 wc-name wnd-name +ws-overlappedwindow+
(- 0 +cw-usedefault+) (- 0 +cw-usedefault+) (- 0 +cw-usedefault+) (- 0 +cw-usedefault+)
*null* *null* *hinstance* *null*)))
(when (null-pointer-p hwnd)
(cleanup wc-name *null*)
(error "create-window-ex-w failed:~A~%" (get-last-error)))
hwnd))
(defun message-loop ()
(with-foreign-object (msg 'msg)
(do ((gm (get-message-w msg *null* 0 0)
(get-message-w msg *null* 0 0)))
((zerop gm) (fsv msg 'msg 'wParam))
(translate-message msg)
(dispatch-message-w msg))))
(defun run ()
(let ((*default-foreign-encoding* :utf-16))
(with-foreign-string (app-name *appname*)
(register-window-class app-name)
(with-foreign-string (wnd-name *appname*)
(let ((hwnd (create-window app-name wnd-name))
(rval -1))
(when hwnd
(show-window hwnd +sw-shownormal+)
(set-foreground-window hwnd)
(setf rval (message-loop))
(cleanup app-name hwnd))
rval)))))
| 8,552 | Common Lisp | .lisp | 256 | 30.105469 | 108 | 0.678463 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 19aec4eb08f9ffd39d190308c8c0ea769f95c193f32efbf3ec182cbd8add0911 | 21,720 | [
-1
] |
21,721 | cairo-samples.lisp | rheaplex_minara/lib/cl-cairo2/tutorial/cairo-samples.lisp | ;;;
;;; How to run this sample code
;;;
;;; 1) create Temp/png directory under the current *default-pathname-defaults*,
;;; which is referenced as *png-dir* in the code,
;;; 2) copy flowers.png to *png-dir*,
;;; 3) compile the code, and then
;;; 4) call the exported functions.
;;;
;;; Result png files are saved to *png-dir*.
;;;
(defpackage :cairo-samples
(:use :cl :cl-cairo2)
(:export :arc-sample
:clip-sample
:clip-image-sample
:curve-rectangle-sample
:curve-to-sample
:dash-sample
:fill-and-stroke2-sample
:gradient-sample
:image-sample
:imagepattern-sample
:multi-segment-caps-sample
:set-line-cap-sample
:set-line-join-sample
:text-sample
:text-align-center-sample
:text-extents-sample
:run-all-samples))
(in-package :cairo-samples)
(defvar *png-dir* (merge-pathnames "Temp/png/"))
(defvar *sample-src-file* "flowers")
(defvar *png-width* 400)
(defvar *png-height* 400)
(defun clear-surface-rgba ()
(save)
(set-source-rgba 1.0 1.0 1.0 1.0)
(set-operator :source)
(paint)
(restore))
(defun clear-surface-rgb ()
(save)
(set-source-rgb 1.0 1.0 1.0)
(set-operator :source)
(paint)
(restore))
(defun png-pathname-string (fname &optional (check-existance nil))
(let ((pngdir *png-dir*))
(if (probe-file pngdir)
(let ((path (namestring (merge-pathnames (concatenate 'string fname ".png") pngdir))))
(if check-existance
(if (probe-file path)
path
(error "~A doesn't exist" path))
path))
(error "~A (see *png-dir*) doesn't exist" pngdir))))
(defmacro with-png-surface-rgba ((fname width height) &body body)
`(with-png-file (,fname :argb32 ,width ,height)
(clear-surface-rgba)
(set-source-rgb 0 0 0)
; (scale ,width ,height)
,@body))
(defmacro with-png-surface-rgb ((fname width height) &body body)
`(with-png-file (,fname :rgb24 ,width ,height)
(clear-surface-rgb)
(set-source-rgb 0 0 0)
; (scale ,width ,height)
,@body))
(defmacro write-to-png ((verb) &body body)
`(with-png-surface-rgba ((png-pathname-string ,verb) *png-width* *png-height*)
,@body))
(defmacro write-to-png24 ((verb) &body body)
`(with-png-surface-rgb ((png-pathname-string ,verb) *png-width* *png-height*)
,@body))
;;; executable examples start from here
(defun arc-sample (&optional (arc-positive t))
(write-to-png ("arc")
(let ((xc 128.0)
(yc 128.0)
(radius 100.0)
(angle1 (* 45.0 (/ pi 180.0))) ; angles are specified
(angle2 (* 180.0 (/ pi 180.0)))) ; in radians
(set-line-width 10.0)
(if arc-positive
(arc xc yc radius angle1 angle2)
(arc-negative xc yc radius angle1 angle2))
(stroke)
;; draw helping lines
(set-source-rgba 1 0.2 0.2 0.6)
(set-line-width 6.0)
(arc xc yc 10.0 0 (* 2 pi))
(fill-path)
;;
; (arc xc yc radius angle1 angle1) ; This causes floating point invalid operation on cairo-arc call
(arc xc yc radius angle1 (+ angle1 (deg-to-rad 0.01))) ; so do this instead as workaround.
(line-to xc yc)
; (arc xc yc radius angle2 angle2);
(arc xc yc radius angle2 (+ angle2 (deg-to-rad 0.01))) ; ditto
(line-to xc yc)
(stroke))))
(defun clip-sample ()
(write-to-png ("clip")
(arc 128.0 128.0 76.8 0 (* 2 pi))
(clip)
;;
(new-path) ; current path is not consumed by clip
;;
(rectangle 0 0 256 256)
(fill-path)
(set-source-rgb 0 1 0)
(move-to 0 0)
(line-to 256 256)
(move-to 256 0)
(line-to 0 256)
(set-line-width 10.0)
(stroke)))
(defun clip-image-sample ()
(write-to-png ("clip-image")
(arc 128.0 128.0 76.8 0 (* 2 pi))
(clip)
(new-path) ; path not consumed by clip
;;
(with-png-surface ((png-pathname-string *sample-src-file* t) image)
(let ((w (image-surface-get-width image))
(h (image-surface-get-height image)))
;;
(scale (/ 256.0 w) (/ 256.0 h))
;;
(set-source-surface image 0 0)
(paint)))))
(defun curve-rectangle-sample ()
(write-to-png ("curve-rectangle")
;; a custom shape that could be wrapped in a function
(let* ((x0 25.6)
(y0 25.6)
(rect-width 204.8)
(rect-height 204.8)
(radius 102.4)
(x1 (+ x0 rect-width))
(y1 (+ y0 rect-height)))
(if (< (/ rect-width 2) radius)
(if (< (/ rect-height 2) radius)
(progn
(move-to x0 (/ (+ y0 y1) 2))
(curve-to x0 y0 x0 y0 (/ (+ x0 x1) 2) y0)
(curve-to x1 y0 x1 y0 x1 (/ (+ y0 y1) 2))
(curve-to x1 y1 x1 y1 (/ (+ x1 x0) 2) y1)
(curve-to x0 y1 x0 y1 x0 (/ (+ y0 y1) 2)))
(progn
(move-to x0 (+ y0 radius))
(curve-to x0 y0 x0 y0 (/ (+ x0 x1) 2) y0)
(curve-to x1 y0 x1 y0 x1 (+ y0 radius))
(line-to x1 (- y1 radius))
(curve-to x1 y1 x1 y1 (/ (+ x1 x0) 2) y1)
(curve-to x0 y1 x0 y1 x0 (- y1 radius))))
(if (< (/ rect-height 2) radius)
(progn
(move-to x0 (/ (+ y0 y1) 2))
(curve-to x0 y0 x0 y0 (+ x0 radius) y0)
(line-to (- x1 radius) y0)
(curve-to x1 y0 x1 y0 x1 (/ (+ y0 y1) 2))
(curve-to x1 y1 x1 y1 (- x1 radius) y1)
(line-to (+ x0 radius) y1)
(curve-to x0 y1 x0 y1 x0 (/ (+ y0 y1) 2)))
(progn
(move-to x0 (+ y0 radius))
(curve-to x0 y0 x0 y0 (+ x0 radius) y0)
(line-to (- x1 radius) y0)
(curve-to x1 y0 x1 y0 x1 (+ y0 radius))
(line-to x1 (- y1 radius))
(curve-to x1 y1 x1 y1 (- x1 radius) y1)
(line-to (+ x0 radius) y1)
(curve-to x0 y1 x0 y1 x0 (- y1 radius)))))
(close-path)
;;
(set-source-rgb 0.5 0.5 1)
(fill-preserve)
(set-source-rgba 0.5 0 0 0.5)
(set-line-width 10.0)
(stroke))))
(defun curve-to-sample ()
(write-to-png ("curve-to")
(let ((x 25.6) (y 128.0)
(x1 102.4) (y1 230.4)
(x2 153.6) (y2 25.6)
(x3 230.4) (y3 128.0))
(move-to x y)
(curve-to x1 y1 x2 y2 x3 y3)
;;
(set-line-width 10.0)
(stroke)
;;
(set-source-rgba 1 0.2 0.2 0.6)
(set-line-width 6.0)
(move-to x y) (line-to x1 y1)
(move-to x2 y2) (line-to x3 y3)
(stroke))))
(defun dash-sample ()
(write-to-png ("dash")
(let* ((dashes (make-array 4 :element-type 'float :initial-contents '(50.0 10.0 10.0 10.0)))
(offset -50.0))
(set-dash offset dashes)
(set-line-width 10.0)
;;
(move-to 128.0 25.6)
(line-to 230.4 230.4)
(rel-line-to -102.4 0.0)
(curve-to 51.2 230.4 51.2 128.0 128.0 128.0)
;;
(stroke))))
(defun fill-and-stroke2-sample ()
(write-to-png ("fill-and-stroke2")
(move-to 128.0 25.6)
(line-to 230.4 230.4)
(rel-line-to -102.4 0.0)
(curve-to 51.2 230.4 51.2 128.0 128.0 128.0)
(close-path)
;;
(move-to 64.0 25.6)
(rel-line-to 51.2 51.2)
(rel-line-to -51.2 51.2)
(rel-line-to -51.2 -51.2)
(close-path)
;;
(set-line-width 10.0)
(set-source-rgb 0 0 1)
(fill-preserve)
(set-source-rgb 0 0 0)
(stroke)))
(defun gradient-sample ()
(write-to-png ("gradient")
(with-patterns ((pat (create-linear-pattern 0.0 0.0 0.0 256.0)))
(pattern-add-color-stop-rgba pat 1 0 0 0 1)
(pattern-add-color-stop-rgba pat 0 1 1 1 1)
(rectangle 0 0 256 256)
(set-source pat)
(fill-path))
;;
(with-patterns ((pat (create-radial-pattern 115.2 102.4 25.6 102.4 102.4 128.0)))
(pattern-add-color-stop-rgba pat 0 1 1 1 1)
(pattern-add-color-stop-rgba pat 1 0 0 0 1)
(set-source pat)
(arc 128.0 128.0 76.8 0 (* 2 pi))
(fill-path))))
(defun image-sample ()
(write-to-png ("image")
(with-png-surface ((png-pathname-string *sample-src-file* t) image)
(let ((w (image-surface-get-width image))
(h (image-surface-get-height image)))
(translate (/ *png-width* 2) (/ *png-height* 2)) ; was 128.0, 128.0
(rotate (* 45 (/ pi 180)))
(scale (/ 256.0 w) (/ 256.0 h))
(translate (* -0.5 w) (* -0.5 h))
;;
(set-source-surface image 0 0)
(paint)))))
(defun imagepattern-sample (&optional (draw-frame nil))
(write-to-png ("imagepattern")
(with-png-surface ((png-pathname-string *sample-src-file* t) image)
(let ((w (image-surface-get-width image))
(h (image-surface-get-height image))
(matrix nil))
;;
(when draw-frame
(move-to 0 0)
(line-to 0 *png-height*)
(line-to *png-width* *png-height*)
(line-to *png-width* 0)
(line-to 0 0)
(stroke))
;;
(with-patterns ((pattern (create-pattern-for-surface image)))
(pattern-set-extend pattern :repeat)
;;
(translate (/ *png-width* 2) (/ *png-height* 2)) ; was 128.0, 128.0
(rotate (/ pi 4))
(scale (/ 1 (sqrt 2)) (/ 1 (sqrt 2)))
(translate (/ *png-width* -2) (/ *png-height* -2)) ; was -128.0, -128.0
;;
(setf matrix (trans-matrix-init-scale (* (/ w 200.0) 2.5) (* (/ h 200.0) 2.5))) ; was 256.0 * 5.0, 256.0 * 5.0
(pattern-set-matrix pattern matrix)
;;
(set-source pattern)
;;
(rectangle 0 0 *png-width* *png-height*) ; was 256.0 256.0
(fill-path))))))
(defun multi-segment-caps-sample ()
(write-to-png ("multi-segment-caps")
(move-to 50.0 75.0)
(line-to 200.0 75.0)
;;
(move-to 50.0 125.0)
(line-to 200.0 125.0)
;;
(move-to 50.0 175.0)
(line-to 200.0 175.0)
;;
(set-line-width 30.0)
(set-line-cap :round)
(stroke)))
(defun set-line-cap-sample ()
(write-to-png ("set-line-cap")
(set-line-width 30.0)
(set-line-cap :butt) ; default
(move-to 64.0 50.0) (line-to 64.0 200.0)
(stroke)
(set-line-cap :round)
(move-to 128.0 50.0) (line-to 128.0 200.0)
(stroke)
(set-line-cap :square)
(move-to 192.0 50.0) (line-to 192.0 200.0)
(stroke)
;;
;; draw helping lines
(set-source-rgb 1 0.2 0.2)
(set-line-width 2.56)
(move-to 64.0 50.0) (line-to 64.0 200.0)
(move-to 128.0 50.0) (line-to 128.0 200.0)
(move-to 192.0 50.0) (line-to 192.0 200.0)
(stroke)))
(defun set-line-join-sample ()
(write-to-png ("set-line-join")
(set-line-width 40.96)
(move-to 76.8 84.48)
(rel-line-to 51.2 -51.2)
(rel-line-to 51.2 51.2)
(set-line-join :miter) ; default
(stroke)
;;
(move-to 76.8 161.28)
(rel-line-to 51.2 -51.2)
(rel-line-to 51.2 51.2)
(set-line-join :bevel)
(stroke)
;;
(move-to 76.8 238.08)
(rel-line-to 51.2 -51.2)
(rel-line-to 51.2 51.2)
(set-line-join :round)
(stroke)))
(defun text-sample ()
(write-to-png ("text")
(select-font-face "Sans" :normal :bold)
(set-font-size 90.0)
;;
(move-to 10.0 135.0)
(show-text "Hello")
;;
(move-to 70.0 165.0)
(text-path "void")
(set-source-rgb 0.5 0.5 1)
(fill-preserve)
(set-source-rgb 0 0 0)
(set-line-width 2.56)
(stroke)
;;
;; draw helping lines
(set-source-rgba 1 0.2 0.2 0.6)
(arc 10.0 135.0 5.12 0 (* 2 pi))
(close-path)
(arc 70.0 165.0 5.12 0 (* 2 pi))
(fill-path)))
(defun text-align-center-sample ()
(write-to-png ("text-align-center")
(let ((extents nil)
(utf8 "cairo")
(x nil) (y nil))
;;
(select-font-face "Sans" :normal :normal)
;;
(set-font-size 52.0)
(setf extents (get-text-extents utf8))
(setf x (- (/ *png-width* 2) (+ (/ (text-width extents) 2) (text-x-bearing extents)))) ; was 128.0
(setf y (- (/ *png-height* 2) (+ (/ (text-height extents) 2) (text-y-bearing extents)))) ; was 128.0
;;
(move-to x y)
(show-text utf8)
;;
;; draw helping lines
(set-source-rgba 1 0.2 0.2 0.6)
(set-line-width 6.0)
(arc x y 10.0 0 (* 2 pi))
(fill-path)
(move-to (/ *png-width* 2) 0) ; was 128.0
(rel-line-to 0 *png-height*) ; was 256
(move-to 0 (/ *png-height* 2)) ; was 128.0
(rel-line-to *png-width* 0) ; was 256
(stroke))))
(defun text-extents-sample ()
(write-to-png ("text-extents")
(let ((extents nil)
(utf8 "cairo")
(x nil) (y nil))
;;
(select-font-face "Sans" :normal :normal)
;;
(set-font-size 100.0)
(setf extents (get-text-extents utf8))
;;
(setf x 25.0)
(setf y 150.0)
;;
(move-to x y)
(show-text utf8)
;;
;; draw helping lines
(set-source-rgba 1 0.2 0.2 0.6)
(set-line-width 6.0)
(arc x y 10.0 0 (* 2 pi))
(fill-path)
(move-to x y)
(rel-line-to 0 (- (text-height extents)))
(rel-line-to (text-width extents) 0)
(rel-line-to (text-x-bearing extents) (- (text-y-bearing extents)))
(stroke))))
(defun run-all-samples (&optional (debug nil))
(let* ((-sample "-SAMPLE")
(-sample-len (length -sample))
(pkg #.(package-name *package*)))
(mapcar #'(lambda (sym)
(let* ((sym-name (symbol-name sym))
(idx (search -sample sym-name :from-end t)))
(if (and (< 0 idx)
(eql (length sym-name) (+ idx -sample-len))
(fboundp (intern sym-name pkg)))
(if (not debug)
(funcall (symbol-function (intern sym-name pkg)))
(list sym sym-name))
(when debug
(list sym nil)))))
(apropos-list -sample pkg))))
| 12,485 | Common Lisp | .lisp | 432 | 25.444444 | 114 | 0.611009 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | c3b2de92dc7fc1d98237c9bbb82d5b873f048f6d29fd2b62b509311ae7cb43a3 | 21,721 | [
-1
] |
21,722 | x11-example.lisp | rheaplex_minara/lib/cl-cairo2/tutorial/x11-example.lisp | (asdf:operate 'asdf:load-op :cl-cairo2)
;;;; Make a test package
(defpackage :cairo-xlib-example
(:use :common-lisp :cl-cairo2))
(in-package :cairo-xlib-example)
;; open display
(let ((width 400)
(height 300))
(setf *context* (create-xlib-context width height :window-name "diagonal lines"))
;; clear the whole canvas with blue
(rectangle 0 0 width height)
(set-source-rgb 0.2 0.2 0.5)
(fill-path)
;; draw a white diagonal line
(move-to width 0)
(line-to 0 height)
(set-source-rgb 1 1 1)
(set-line-width 5)
(stroke)
;; draw a green diagonal line
(move-to 0 0)
(line-to width height)
(set-source-rgb 0 1 0)
(set-line-width 5)
(stroke))
;; need to close window manually
(defun random-square (alpha)
"Draw a blue rectangle with fixed size and the given transparency alpha."
(move-to 1 1)
(line-to -1 1)
(line-to -1 -1)
(line-to 1 -1)
(close-path)
(set-source-rgba 0 0 1 alpha)
(fill-path))
(defparameter width 800)
(defparameter height 600)
(defparameter max-angle 90d0)
(setf *context* (create-xlib-context width height :window-name "rectangles"))
;; fill with white
(rectangle 0 0 width height)
(set-source-rgb 1 1 1)
(fill-path)
;; draw the rectangles
(dotimes (i 500)
(let ((scaling (+ 5d0 (random 40d0))))
(reset-trans-matrix) ; reset matrix
(translate (random width) (random height)) ; move the origin
(scale scaling scaling) ; scale
(rotate (deg-to-rad (random max-angle))) ; rotate
(random-square (+ 0.1 (random 0.4)))))
;; need to close window manually
| 1,563 | Common Lisp | .lisp | 52 | 27.403846 | 83 | 0.686379 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 9c010eea60c982661947e60224d4224584529c11a082c3d03a29a0cbe8fad3a3 | 21,722 | [
-1
] |
21,723 | cairo-demos.lisp | rheaplex_minara/lib/cl-cairo2/tutorial/cairo-demos.lisp | ;;;
;;; How to run this sample code
;;;
;;; 1) create Temp/png directory under the current *default-pathname-defaults*,
;;; which is referenced as *png-dir* in the code,
;;; 2) copy flowers.png to *png-dir*,
;;; 3) compile the code, and then
;;; 4) call the exported functions.
;;;
;;; Result png files are saved to *png-dir*.
;;;
(defpackage :cairo-demos
(:use :common-lisp :cl-cairo2)
#+sbcl
(:use :sb-sys)
(:export :image-data-demo1
:image-data-demo2))
(in-package :cairo-demos)
;;; helpers
(defvar *png-dir* (merge-pathnames "Temp/png/"))
(defvar *demo-src-file* "flowers")
(defvar *png-width* 256)
(defvar *png-height* 256)
(defun png-pathname-string (fname &optional (check-existance nil))
(let ((pngdir *png-dir*))
(if (probe-file pngdir)
(let ((path (namestring (merge-pathnames (concatenate 'string fname ".png") pngdir))))
(if check-existance
(if (probe-file path)
path
(error "~A doesn't exist" path))
path))
(error "~A (see *png-dir*) doesn't exist" pngdir))))
(defmacro argb-to-argb32 (a r g b)
#+(or (and sbcl (or x86 ppc)) (and ccl 32-bit-host little-endian-host))
`(logior (ash ,a 24) (ash ,r 16) (ash ,g 8) ,b)
#-(or (and sbcl (or x86 ppc)) (and ccl 32-bit-host little-endian-host))
(error "no implemented"))
(defmacro write-argb32 (sap idx argb32)
#+sbcl
`(setf (sap-ref-32 ,sap ,idx) ,argb32)
#+ccl
`(setf (ccl:%get-unsigned-long ,sap ,idx) ,argb32)
#-(or sbcl ccl)
(error "not implemented"))
(defmacro write-argb (sap idx a r g b)
`(write-argb32 ,sap ,idx (argb-to-argb32 ,a ,r ,g ,b)))
(defmacro argb-from-argb32 (argb32)
#+(or (and sbcl (or x86 ppc)) (and ccl 32-bit-host little-endian-host))
`(values (logand #xff (ash ,argb32 -24))
(logand #xff (ash ,argb32 -16))
(logand #xff (ash ,argb32 -8))
(logand #xff ,argb32))
#-(or (and sbcl (or x86 ppc)) (and ccl 32-bit-host little-endian-host))
(error "not implemented"))
(defmacro read-argb32 (sap idx)
#+sbcl
`(sap-ref-32 ,sap ,idx)
#+ccl
`(ccl:%get-unsigned-long ,sap ,idx)
#-(or sbcl ccl)
(error "not implemented"))
(defmacro read-argb (sap idx)
`(argb-from-argb32 (read-argb32 ,sap ,idx)))
;;; demos
(defun image-data-demo1 (&key (a #xff) (r -1) (g -1) (b -1))
"Create a rectangle png image in specified alpha, r, g, b color"
(if (and (eq r -1) (eq g -1) (eq b -1))
(setf r (random 256) g (random 256) b (random 256))
(progn
(when (eq r -1)
(setf r 0))
(when (eq g -1)
(setf g 0))
(when (eq b -1)
(setf b 0))))
(let ((width 256) (height 256))
(with-png-file ((png-pathname-string "demo1") :argb32 width height argbsf)
(let ((sfwidth (image-surface-get-width argbsf))
(sfheight (image-surface-get-height argbsf))
(sfbpr (image-surface-get-stride argbsf))
(image-data (image-surface-get-data argbsf :pointer-only t)))
;;
(format t "surface width, height, bytes-per-row: ~a, ~a ~a ~%" sfwidth sfheight sfbpr)
(format t "image-data type:~a ~%" (type-of image-data))
;;
(loop for h from 0 to (1- height) do
(loop for w from 0 to (1- width) do
(let ((idx (+ (* h sfbpr) (* w 4))))
(write-argb image-data idx a r g b))))))))
(defun image-data-demo2 (&key (zoomw 2) (zoomh 2))
"Expand a png image to the one with width and height zoom rates specified."
(when (or (< zoomh 1) (< zoomw 1))
(error "zoom value must be integer greater than or equals to 1"))
(setf zoomw (floor zoomw))
(setf zoomh (floor zoomh))
;;
;; get surface of source png image
;;
(with-png-surface ((png-pathname-string *demo-src-file*) srcsf)
(let ((srcwidth (image-surface-get-width srcsf))
(srcheight (image-surface-get-height srcsf))
(srcfmt (image-surface-get-format srcsf))
(srcbpr (image-surface-get-stride srcsf))
(src-data (image-surface-get-data srcsf :pointer-only t)))
(format t "source surface width, height, bpr, format: ~a, ~a, ~a ~a ~%" srcwidth srcheight srcbpr srcfmt)
(unless (or (eq srcfmt :argb32) (eq srcfmt :rgb24))
(error "source image format isn't argb32 or rgb24:~a~%" srcfmt))
;;
;; write destination png image with specified zoom size
;;
(let ((dstwidth (* srcwidth zoomw))
(dstheight (* srcheight zoomh)))
(with-png-file ((png-pathname-string "demo2") :argb32 dstwidth dstheight dstsf)
(let ((dstbpr (image-surface-get-stride dstsf))
(dst-data (image-surface-get-data dstsf :pointer-only t))
(bpp 4))
(loop for h from 0 to (1- srcheight) do
(loop for w from 0 to (1- srcwidth) do
(let ((srcidx (+ (* h srcbpr) (* w bpp)))
(dstidx (+ (* h dstbpr zoomh) (* w bpp zoomw))))
(loop for zh from 0 to (1- zoomh) do
(loop for zw from 0 to (1- zoomw) do
(write-argb32 dst-data
(+ dstidx (* zh dstbpr) (* bpp zw))
(read-argb32 src-data srcidx)))))))))))))
| 4,853 | Common Lisp | .lisp | 126 | 34.912698 | 108 | 0.639296 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | bec1b77ea4199490369bb4d89b0dde39df63f40c3a09bac9867e830f60dede9d | 21,723 | [
-1
] |
21,724 | test-xlib.lisp | rheaplex_minara/lib/cl-cairo2/tutorial/test-xlib.lisp | (in-package :cl-cairo2)
(defun random-size ()
(+ 200 (random 100)))
(defparameter *list-of-contexts* nil)
(defparameter *max-number-of-contexts* 50)
(defun x-on-window (context)
(let ((width (get-width context))
(height (get-height context)))
;; clear
(rectangle 0 0 width height context)
(set-source-color +white+ context)
(fill-path context)
;; draw X
(move-to 0 0 context)
(line-to width height context)
(set-source-color +green+ context)
(stroke context)
(move-to 0 height context)
(line-to width 0 context)
(set-source-color +blue+ context)
(stroke context)))
(defun remove-random-window (list)
(assert (not (null list)))
(let* ((length (length list))
(index (random length))
(context (nth index list)))
(format t "killing ~a~%" index)
(destroy context)
(remove context list)))
;; create contexts with an x on them
(dotimes (i *max-number-of-contexts*)
(let ((context (create-xlib-image-context (random-size) (random-size))))
(x-on-window context)
(push context *list-of-contexts*)))
;; close all, in random order
(do ()
((not *list-of-contexts*))
(setf *list-of-contexts* (remove-random-window *list-of-contexts*)))
(defparameter *c1* (create-xlib-context 100 100))
(x-on-window *c1*)
(defparameter *c2* (create-xlib-context 140 200))
(x-on-window *c2*)
(destroy *c1*)
| 1,376 | Common Lisp | .lisp | 43 | 28.651163 | 74 | 0.678491 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 93ad2aa723acf70fa54149e877c9a1530656e95949a397a97d060a16d8acd71b | 21,724 | [
-1
] |
21,725 | test-finalizer.lisp | rheaplex_minara/lib/cl-cairo2/tutorial/test-finalizer.lisp | (in-package :cl-cairo2)
(setf *context* (create-pdf-context "/tmp/foo.pdf" 100 100))
(move-to 0 0)
(line-to 100 100)
(set-source-rgb 0 0 1)
(stroke)
;; destroy object, after this, it will be ready to be GC'd
(setf *context* nil)
;; call GC
#+sbcl (sb-ext:gc)
| 262 | Common Lisp | .lisp | 10 | 24.9 | 60 | 0.694779 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 022e66965f36cf99be0fc22293a9a7b4e3ab616aac41e143cf5263c16564dc58 | 21,725 | [
-1
] |
21,728 | example.lisp.svn-base | rheaplex_minara/lib/cl-cairo2/tutorial/.svn/text-base/example.lisp.svn-base | (asdf:operate 'asdf:load-op :cl-cairo2)
;;;; Make a test package
(defpackage :cairo-example
(:use :common-lisp :cl-cairo2))
(in-package :cairo-example)
;;;;
;;;; short example for the tutorial
;;;;
(defparameter *surface* (create-ps-surface "example.ps" 200 100))
(setf *context* (create-context *surface*))
(destroy *surface*)
;; clear the whole canvas with blue
(set-source-rgb 0.2 0.2 1)
(paint)
;; draw a white diagonal line
(move-to 200 0)
(line-to 0 100)
(set-source-rgb 1 1 1)
(set-line-width 5)
(stroke)
;; destroy context, this also destroys the surface and closes the file
(destroy *context*)
;;;;
;;;; helper functions
;;;;
(defun show-text-aligned (text x y &optional (x-align 0.5) (y-align 0.5)
(context *context*))
"Show text aligned relative to (x,y)."
(let ((*context* context))
(multiple-value-bind (x-bearing y-bearing width height)
(text-extents text)
(move-to (- x (* width x-align) x-bearing)
(- y (* height y-align) y-bearing))
(show-text text))))
;;;; very simple text example
(setf *context* (create-ps-context "simpletext.ps" 100 100))
(move-to 0 100)
(set-font-size 50)
(show-text "foo")
(destroy *context*)
;;;;
;;;; text placement example
;;;;
;;;; This example demonstrates the use of text-extents, by placing
;;;; text aligned relative to a red marker.
(defun mark-at (x y d red green blue)
"Make a rectangle of size 2d around x y with the given colors,
50% alpha. Used for marking points."
(rectangle (- x d) (- y d) (* 2 d) (* 2 d))
(set-source-rgba red green blue 0.5)
(fill-path))
(defun show-text-with-marker (text x y x-align y-align)
"Show text aligned relative to a red market at (x,y)."
(mark-at x y 2 1 0 0)
(set-source-rgba 0 0 0 0.6)
(show-text-aligned text x y x-align y-align))
(defparameter width 500)
(defparameter height 500)
(defparameter text "Fog") ; contains g, which goes below baseline
(defparameter size 50)
(defparameter x 20d0)
(defparameter y 50d0)
(setf *context* (create-ps-context "text.ps" width height))
;;(setf *context* (create-svg-context "text.svg" width height))
;;(setf *context* (create-pdf-context "text.pdf" width height))
;; white background
(set-source-rgb 1 1 1)
(paint)
;; setup font
(select-font-face "Arial" 'font-slant-normal 'font-weight-normal)
(set-font-size size)
;; starting point
(mark-at x y 2 1 0 0) ; red
;; first text in a box
(multiple-value-bind (x-bearing y-bearing text-width text-height)
(text-extents text)
(let ((rect-x (+ x x-bearing))
(rect-y (+ y y-bearing)))
(rectangle rect-x rect-y text-width text-height)
(set-source-rgba 0 0 1 0.3) ; blue
(set-line-width 1)
(set-dash 0 '(5 5))
(stroke)))
(set-source-rgba 0 0 0 0.6)
(move-to x y)
(show-text text)
;; text automatically aligned
;; (dolist (x-align '(0 0.5 1))
;; (dolist (y-align '(0 0.5 1))
;; (show-text-with-marker text (+ x (* x-align 300)) (+ y (* y-align 300) 100)
;; x-align y-align)))
(dolist (x-align '(0))
(dolist (y-align '(0))
(show-text-with-marker text (+ x (* x-align 300)) (+ y (* y-align 300) 100)
x-align y-align)))
(show-text-with-marker text x (+ y 100d0) 0d0 0d0)
;; done
(destroy *context*)
;;;;
;;;; text placement example
;;;;
;;;; This example demonstrates the use of text-extents, by placing
;;;; text aligned relative to a red marker.
(defun mark-at (x y d red green blue)
"Make a rectangle of size 2d around x y with the given colors,
50% alpha. Used for marking points."
(rectangle (- x d) (- y d) (* 2 d) (* 2 d))
(set-source-rgba red green blue 0.5)
(fill-path))
(defun show-text-with-marker (text x y x-align y-align)
"Show text aligned relative to a red market at (x,y)."
(mark-at x y 2 1 0 0)
(set-source-rgba 0 0 0 0.6)
(show-text-aligned text x y x-align y-align))
(defparameter width 500)
(defparameter height 500)
(defparameter text "Fog") ; contains g, which goes below baseline
(defparameter size 50)
(defparameter x 20)
(defparameter y 50)
(setf *context* (create-ps-context "text2.ps" width height))
;;(setf *context* (create-svg-context "text.svg" width height))
;;(setf *context* (create-pdf-context "text.pdf" width height))
;; white background
(set-source-rgb 1 1 1)
(paint)
;; setup font
(select-font-face "Arial" 'font-slant-normal 'font-weight-normal)
(set-font-size size)
;; starting point
(mark-at x y 2 1 0 0) ; red
;; first text in a box
(multiple-value-bind (x-bearing y-bearing text-width text-height)
(text-extents text)
(let ((rect-x (+ x x-bearing))
(rect-y (+ y y-bearing)))
(rectangle rect-x rect-y text-width text-height)
(set-source-rgba 0 0 1 0.3) ; blue
(set-line-width 1)
(set-dash 0 '(5 5))
(stroke)))
(set-source-rgba 0 0 0 0.6)
(move-to x y)
(show-text text)
;; text automatically aligned
(dolist (x-align '(0 0.5 1))
(dolist (y-align '(0 0.5 1))
(show-text-with-marker text (+ x (* x-align 300)) (+ y (* y-align 300) 100)
x-align y-align)))
(show-text-with-marker text (+ x 0d0) (+ y 0d0 0d0) 0d0 0d0)
;; done
(destroy *context*)
;;;;
;;;; Lissajous curves
;;;;
(defparameter size 500)
(defparameter margin 20)
(defparameter a 9)
(defparameter b 8)
(defparameter delta (/ pi 2))
(defparameter density 2000)
(setf *context* (create-ps-context "lissajous.ps" size size))
;; pastel blue background
(rectangle 0 0 width height)
(set-source-rgb 0.9 0.9 1)
(fill-path)
;; Lissajous curves, blue
(labels ((stretch (x) (+ (* (1+ x) (- (/ size 2) margin)) margin)))
(move-to (stretch (sin delta)) (stretch 0))
(dotimes (i density)
(let* ((v (/ (* i pi 2) density))
(x (sin (+ (* a v) delta)))
(y (sin (* b v))))
(line-to (stretch x) (stretch y)))))
(close-path)
(set-line-width .5)
(set-source-rgb 0 0 1)
(stroke)
;; "cl-cairo2" in Arial bold to the center
(select-font-face "Arial" 'font-slant-normal 'font-weight-bold)
(set-font-size 100)
(set-source-rgba 1 0.75 0 0.5) ; orange
(show-text-aligned "cl-cairo2" (/ size 2) (/ size 2))
;; done
(destroy *context*)
;;;;
;;;; transformation matrix example (for Judit, with love)
;;;;
;;;; This example uses the function heart which fills a heart-shape
;;;; with given transparency at the origin, using a fixed size.
;;;; Rotation, translation and scaling is achieved using the
;;;; appropriate cairo functions.
(defun heart (alpha)
"Draw a heart with fixed size and the given transparency alpha.
Heart is upside down."
(let ((radius (sqrt 0.5)))
(move-to 0 -2)
(line-to 1 -1)
(arc 0.5 -0.5 radius (deg-to-rad -45) (deg-to-rad 135))
(arc -0.5 -0.5 radius (deg-to-rad 45) (deg-to-rad 215))
(close-path)
(set-source-rgba 1 0 0 alpha)
(fill-path)))
(defparameter width 1024)
(defparameter height 768)
(defparameter max-angle 40d0)
(with-png-file ("hearts.png" 'format-rgb24 width height)
;; fill with white
(rectangle 0 0 width height)
(set-source-rgb 1 1 1)
(fill-path)
;; draw the hearts
(dotimes (i 200)
(let ((scaling (+ 5d0 (random 40d0))))
(reset-trans-matrix) ; reset matrix
(translate (random width) (random height)) ; move the origin
(scale scaling scaling) ; scale
(rotate (deg-to-rad (- (random (* 2 max-angle)) max-angle 180))) ; rotate
(heart (+ 0.1 (random 0.7))))))
| 7,266 | Common Lisp | .lisp | 219 | 30.876712 | 82 | 0.669373 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 41e6ff8e363134498fdf963c6fdf83a6ace610b372bcde576aab352c828dcf01 | 21,728 | [
-1
] |
21,731 | bug-test.lisp | rheaplex_minara/lib/cl-cairo2/tutorial/elusive-bug/bug-test.lisp | (asdf:operate 'asdf:load-op :cl-cairo2)
;;;; Make a test package
(defpackage :cairo-example-bug-test
(:use :common-lisp :cl-cairo2))
(declaim (optimize (debug 3)))
(in-package :cairo-example-bug-test)
(defun show-text-aligned (text x y &optional (x-align 0.5) (y-align 0.5)
(context *context*))
"Show text aligned relative to (x,y)."
(let ((*context* context))
(multiple-value-bind (x-bearing y-bearing width height)
(text-extents text)
(move-to (- x (* width x-align) x-bearing)
(- y (* height y-align) y-bearing))
(show-text text))))
;;;;
;;;; text placement example
;;;;
;;;; This example demonstrates the use of text-extents, by placing
;;;; text aligned relative to a red marker.
(defun mark-at (x y d red green blue)
"Make a rectangle of size 2d around x y with the given colors,
50% alpha. Used for marking points."
(rectangle (- x d) (- y d) (* 2 d) (* 2 d))
(set-source-rgba red green blue 0.5)
(fill-path))
(defun show-text-with-marker (text x y x-align y-align)
"Show text aligned relative to a red market at (x,y)."
(mark-at x y 2 1 0 0)
(set-source-rgb 0 0 1)
(show-text-aligned text x y x-align y-align))
(progn
(defparameter width 500)
(defparameter height 500)
(defparameter text "Fog") ; contains g, which goes below baseline
(defparameter size 50)
(defparameter x 20d0)
(defparameter y 50d0)
(setf *context* (create-ps-context "/tmp/text.ps" width height))
;;(setf *context* (create-svg-context "text.svg" width height))
;;(setf *context* (create-pdf-context "text.pdf" width height))
;; white background
(set-source-rgb 1 1 1)
(paint)
;; setup font
(select-font-face "Arial" 'font-slant-normal 'font-weight-normal)
(set-font-size size)
;; starting point
;;(mark-at x y 2 1 0 0) ; red
;; first text in a box
(multiple-value-bind (x-bearing y-bearing text-width text-height)
(text-extents text)
(let ((rect-x (+ x x-bearing))
(rect-y (+ y y-bearing)))
(rectangle rect-x rect-y text-width text-height)
(set-source-rgba 0 0 1 0.3) ; blue
(set-line-width 1)
(set-dash 0 '(5 5))
(stroke)))
(set-source-rgba 0 0 0 0.6)
(move-to x y)
(show-text text)
;; text automatically aligned
;; (dolist (x-align '(0 0.5 1))
;; (dolist (y-align '(0 0.5 1))
;; (show-text-with-marker text (+ x (* x-align 300)) (+ y (* y-align 300) 100)
;; x-align y-align)))
;; (dolist (x-align '(0))
;; (dolist (y-align '(0))
;; (show-text-with-marker text (+ x (* x-align 300)) (+ y (* y-align 300) 100)
;; x-align y-align)))
;; (move-to 50 50)
;; (show-text "Bar")
(show-text-with-marker text x (+ y 100d0) 0d0 0d0)
;; done
(destroy *context*)
)
| 2,656 | Common Lisp | .lisp | 77 | 32.285714 | 82 | 0.660693 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 81564b1064e0f17bade602beffcd51ed17d499097e067673372fdbad86c26f02 | 21,731 | [
-1
] |
21,732 | bug.lisp | rheaplex_minara/lib/cl-cairo2/tutorial/elusive-bug/bug.lisp | (asdf:operate 'asdf:load-op :cl-cairo2)
;;;; Make a test package
(defpackage :cairo-example
(:use :common-lisp :cl-cairo2))
(in-package :cairo-example)
;;;;
;;;; helper functions
;;;;
(defun show-text-aligned (text x y &optional (x-align 0.5) (y-align 0.5)
(context *context*))
"Show text aligned relative to (x,y)."
(let ((*context* context))
(multiple-value-bind (x-bearing y-bearing width height)
(text-extents text)
(move-to (- x (* width x-align) x-bearing)
(- y (* height y-align) y-bearing))
(show-text text))))
;;;;
;;;; text placement example
;;;;
;;;; This example demonstrates the use of text-extents, by placing
;;;; text aligned relative to a red marker.
(defun mark-at (x y d red green blue)
"Make a rectangle of size 2d around x y with the given colors,
50% alpha. Used for marking points."
(rectangle (- x d) (- y d) (* 2 d) (* 2 d))
(set-source-rgba red green blue 0.5)
(fill-path))
(defun show-text-with-marker (text x y x-align y-align)
"Show text aligned relative to a red market at (x,y)."
(mark-at x y 2 1 0 0)
(set-source-rgba 0 0 0 0.6)
(show-text-aligned text x y x-align y-align))
(defparameter width 500)
(defparameter height 500)
(defparameter text "Fog") ; contains g, which goes below baseline
(defparameter size 50)
(defparameter x 20d0)
(defparameter y 50d0)
(setf *context* (create-ps-context "text.ps" width height))
;;(setf *context* (create-svg-context "text.svg" width height))
;;(setf *context* (create-pdf-context "text.pdf" width height))
;; white background
(set-source-rgb 1 1 1)
(paint)
;; setup font
(select-font-face "Arial" 'font-slant-normal 'font-weight-normal)
(set-font-size size)
;; starting point
(mark-at x y 2 1 0 0) ; red
;; first text in a box
(multiple-value-bind (x-bearing y-bearing text-width text-height)
(text-extents text)
(let ((rect-x (+ x x-bearing))
(rect-y (+ y y-bearing)))
(rectangle rect-x rect-y text-width text-height)
(set-source-rgba 0 0 1 0.3) ; blue
(set-line-width 1)
(set-dash 0 '(5 5))
(stroke)))
(set-source-rgba 0 0 0 0.6)
(move-to x y)
(show-text text)
;; text automatically aligned
;; (dolist (x-align '(0 0.5 1))
;; (dolist (y-align '(0 0.5 1))
;; (show-text-with-marker text (+ x (* x-align 300)) (+ y (* y-align 300) 100)
;; x-align y-align)))
;; (dolist (x-align '(0))
;; (dolist (y-align '(0))
;; (show-text-with-marker text (+ x (* x-align 300)) (+ y (* y-align 300) 100)
;; x-align y-align)))
;; (set-source-rgba 0 0 0 0.6)
;; (rectangle 0 0 100 100)
;; (fill-path)
;; (move-to 50 50)
;; (set-source-rgba 0 0 1 0.5)
;; (show-text "Foo")
(show-text-with-marker text x (+ y 100d0) 0d0 0d0)
;; done
(destroy *context*)
| 2,731 | Common Lisp | .lisp | 81 | 31.580247 | 82 | 0.656309 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 3d867abebfa7c292f24f4418031c7db4e459aadd6e73d25eafe11c7023b1ac14 | 21,732 | [
-1
] |
21,733 | buffer.lisp | rheaplex_minara/src/buffer.lisp | ;; buffer.lisp : buffers for minara
;;
;; Copyright (c) 2004,2007 Rob Myers, [email protected]
;;
;; This file is part of Minara.
;;
;; Minara is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; Minara is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Minara. If not, see <http://www.gnu.org/licenses/>.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Modules
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(in-package minara)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Buffer
;; A buffer of text, particularly the Lisp code describing the drawing
;; instructions from a document or an overlay.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defclass buffer ()
((gap-buffer :accessor buffer-gap-buffer
:initarg :content
:initform (make-instance 'flexichain:standard-flexichain))
(mark :accessor buffer-mark
:initform 0)
(changed :accessor buffer-changed
:initform nil)
(cache :accessor buffer-cache
:initarg :cache
:initform nil)
(variables :accessor buffer-variables
:initarg :variables
:initform (make-hash-table :size 31))))
(defun set-buffer-changed (buf)
(setf (buffer-changed buf)
t))
(defun clear-buffer-changed (buf)
(setf (buffer-changed buf)
nil))
(defun buffer-changed-p (buf)
(eq (buffer-changed buf) t))
(defun buffer-erase (buf)
(setf (buffer-gap-buffer buf)
(make-instance 'flexichain:standard-flexichain)))
(defun buffer-end (buf)
(flexichain:nb-elements (buffer-gap-buffer buf)))
(defun buffer-start (buf)
(declare (ignore buf))
0)
;; To string
;; Don't use for evaluation, use stream
(defun buffer-range-to-string (buffer begin end)
(let ((content (buffer-gap-buffer buffer)))
(loop with result = (make-string (- end begin))
for source from begin below end
for dest upfrom 0
do (setf (aref result dest)
(flexichain:element* content source))
finally (return result))))
(defun buffer-to-string (buffer)
(buffer-range-to-string buffer (buffer-start buffer) (buffer-end buffer)))
;; Incredibly slow. Replace with a buffer-stream system.
(defun evaluate-buffer (buffer package-name)
(format t "evaluating buffer")
(let ((old-package *package*))
(setf *package* (find-package package-name))
(with-input-from-string
(strstr (buffer-range-to-string buffer
(buffer-start buffer)
(buffer-end buffer)))
(load strstr))
(setf *package* old-package)))
;; Insert and delete outside of the undo system.
;; No, you really do not want these. See undo.
(defun buffer-insert-no-undo (buffer pos text)
(setf (buffer-mark buffer) pos)
(let ((buf (buffer-gap-buffer buffer)))
(loop for char across text
do (flexichain:insert* buf (buffer-mark buffer) char)
do (incf (buffer-mark buffer)))))
(defun buffer-delete-no-undo (buffer pos count)
(loop repeat count
do (flexichain:delete* (buffer-gap-buffer buffer) pos)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Buffer Variables
;; A buffer can have an arbitrary number of named variables set on it.
;; These will last until the buffer is disposed of, and are unaffected by event
;; handling, particularly redraws, unless the code inside the buffer affects
;; the variables when evaluated, which would be weird.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Set buffer variable
(defun set-buffer-variable (buffer name value)
(setf (gethash name (buffer-variables buffer))
value))
;; Get buffer variable
(defun buffer-variable (buffer name)
(gethash name (buffer-variables buffer)))
;; Get buffer variable, creating it if it doesn't exist
(defun ensure-buffer-variable (buffer name)
(multiple-value-bind (val present)
(gethash name (buffer-variables buffer))
(if present
val
(set-buffer-variable buffer name nil))))
;; Remove buffer variable
(defun kill-buffer-variable (buffer name)
(remhash name (buffer-variables buffer)))
;; Remove all buffer variables
(defun kill-all-buffer-variables (buffer)
(setf (buffer-variables buffer)
(make-instance 'hashtable)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Buffer Drawing and Caching
;; Note that we draw lazily, only evaluating a buffer if it has been updated
;; since it was last cached.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; So code located in the current buffer can get buffer variables, for example.
(defvar *current-buffer* nil)
(defun current-buffer ()
*current-buffer*)
(defmacro with-buffer (buf &rest body)
(let ((old-buf (gensym)))
`(let ((,old-buf *current-buffer*))
(setf *current-buffer* ,buf)
,@body
(setf *current-buffer* ,old-buf))))
;; Redraw the buffer (just run the cache if no timestamp variation)
(defun draw-buffer (cb)
(when (buffer-changed-p cb)
;; Otherwise, generate the cache and update the cache timestamp
(let ((c (buffer-cache cb)))
(format t "draw-buffer~%")
(minara-rendering:cache-record-begin c)
(with-buffer cb
(evaluate-buffer cb "minara-rendering"))
(minara-rendering:cache-record-end c)
(clear-buffer-changed cb)))
(minara-rendering:cache-draw (buffer-cache cb)))
;; Flag the buffer to be drawn when the window next redraws
(defun buffer-invalidate (cb)
(set-buffer-changed cb))
;; Loading and saving buffers
(defun buffer-file-path (buffer)
(buffer-variable buffer '_file-path ))
(defun set-buffer-file-path (buffer file-path)
(set-buffer-variable buffer '_file-path file-path))
(defun buffer-file-timestamp (buffer)
(buffer-variable buffer '_file-timestamp ))
(defun set-buffer-file-timestamp (buffer file-path)
(set-buffer-variable buffer '_file-timestamp (file-write-date file-path)))
;; This adds a trailing newline at end of file if one wasn't present
(defun read-buffer-from-file (buffer filename)
(let ((content (buffer-gap-buffer buffer)))
(with-open-file (file filename)
(loop for line = (read-line file nil 'eof)
until (eq line 'eof)
do (loop for char across line
do (flexichain:push-end content char)
finally (flexichain:push-end content #\Newline)))))
(setf (buffer-mark buffer) (buffer-end buffer))
(set-buffer-file-path buffer filename)
(set-buffer-file-timestamp buffer filename)
buffer)
(defun make-buffer-from-file (filename)
(read-buffer-from-file (make-instance 'buffer) filename))
(defun reload-buffer-file (buffer)
(buffer-erase buffer)
(read-buffer-from-file buffer (buffer-file-path buffer)))
(defun write-buffer-to-file (buffer filename)
(with-open-file (file filename :direction :output :if-exists :supersede)
(write-string (buffer-range-to-string buffer
(buffer-start buffer)
(buffer-end buffer))
file))
(set-buffer-file-path buffer filename)
(set-buffer-file-timestamp buffer filename))
| 7,596 | Common Lisp | .lisp | 184 | 37.592391 | 79 | 0.657155 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | f01908844d4ef54f3cab2d05f830bcba52f576b0eab61b1f48cbd63668b56715 | 21,733 | [
-1
] |
21,734 | bootstrap.lisp | rheaplex_minara/src/bootstrap.lisp | (require 'asdf)
;; This will need modifying if launched from a script in the parent directory
;; It should handle both eventualities, checking for last part of truename . .
(mapc #'(lambda (asd)
(pushnew (make-pathname :directory
(pathname-directory asd))
asdf:*central-registry*
:test #'equal))
(directory (merge-pathnames #p"*/*.asd" (truename "../lib/"))))
(asdf:operate 'asdf:load-op 'flexichain)
;;(asdf:operate 'asdf:load-op 'cffi)
(asdf:operate 'asdf:load-op 'cl-opengl)
(asdf:operate 'asdf:load-op 'cl-glu)
(asdf:operate 'asdf:load-op 'cl-glut)
;; check for libcairo.so, warn user to install cairo-dev if missing
(asdf:operate 'asdf:load-op 'cl-cairo2)
(asdf:operate 'asdf:load-op 'minara)
(minara::minara)
;; Make sure you have a Lisp installed
;; sudo apt-get install sbcl
;; To install cl-cairo
;; sudo apt-get install libcairo2-dev
;; (asdf-install::install 'cl-utilities)
;; (asdf-install::install 'cl-colors)
;; (asdf-install::install 'cl-cairo2)
;; Most of the libraries Minara uses are included,
;; This will change as they become asdf-installable
;; (or cl-cairo will be included if neccessary). | 1,148 | Common Lisp | .lisp | 28 | 38.75 | 78 | 0.728173 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 62d49d7dee8ed719a8fbf0932dbe4330e7cd92771c10ba17b1c6fd9cb5518c11 | 21,734 | [
-1
] |
21,735 | transformations.lisp | rheaplex_minara/src/transformations.lisp | ;; transformations.lisp : 2d geometric transformations for minara
;;
;; Copyright (c) 2004, 2007 Rob Myers, [email protected]
;;
;; This file is part of Minara.
;;
;; Minara is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; Minara is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Minara. If not, see <http://www.gnu.org/licenses/>.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Geometric transformations using matrices
;; Matrices are Postscript-style 6-element arrays
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(in-package minara)
(defclass matrix ()
((a :initarg :a
:initform 1.0
:accessor matrix-a)
(b :initarg :b
:initform 0.0
:accessor matrix-b)
(c :initarg :c
:initform 0.0
:accessor matrix-c)
(d :initarg :d
:initform 1.0
:accessor matrix-d)
(tx :initarg :t
:initform 0.0
:accessor matrix-tx)
(ty :initarg :ty
:initform 0.0
:accessor matrix-ty)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Functions to generate transformation matrices
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; a b 0
;; c d 0
;; tx ty 1
;; (a b c d tx ty)
;; identity
;; 1 0 0
;; 0 1 0
;; 0 0 1
;; (1 0 0 0 1 0)
(defun make-matrix-identity ()
(make-instance 'matrix))
;; scale
;; sx 0 0
;; 0 sy 0
;; 0 0 1
;; (sx 0 0 sy 0 0)
(defun make-matrix-scale (x y)
(make-instance 'matrix :a x :b 0.0 :c 0.0 :d y :tx 0.0 :ty 0.0))
;; translate
;; 1 0 0
;; 0 1 0
;; tx ty 1
;; (1 0 0 1 tx ty)
(defun make-matrix-translate (x y)
(make-instance 'matrix :a 1.0 :b 0.0 :c 0.0 :d 1.0 :tx x :ty y))
;; rotate
;; cos sin 0
;; -sin cos 0
;; 0 0 1
;; (cos sin -sin cos 0 0)
(defun make-matrix-rotate (z)
(let ((c (cos z))
(s (sin z))
(ns (- (sin z))))
(make-instance 'matrix :a c :b s :c ns :d c :tx 0.0 :ty 0.0)))
;; to string
(defun matrix-to-string (matrix)
(format nil "~a ~a ~a ~a ~a ~a" (matrix-a matrix) (matrix-b matrix)
(matrix-c matrix) (matrix-d matrix) (matrix-tx matrix)
(matrix-ty matrix)))
(defun matrix-to-concatenate-string (matrix)
(format nil "(concatenate-matrix ~a)" (matrix-to-string matrix)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Matrix Concatenation
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; concatenate
;; Multiply the rows of A by the columns of B
;;(define a (matrix-translate-make 10 20))(define b (matrix-translate-make 200 100))(define c (matrix-concatenate a b)) c
;; This is going to be a bottleneck, so unroll it
;; Optimise so rather than first, second, third, we use car/cdr on each cdr
(defun matrix-concatenate-aux (a b)
(let* ((aa (matrix-a a))
(ab (matrix-b a))
(ac (matrix-c a))
(ad (matrix-d a))
(ae (matrix-tx a))
(af (matrix-ty a))
(ba (matrix-a b))
(bb (matrix-b b))
(bc (matrix-c b))
(bd (matrix-d b))
(be (matrix-tx b))
(bf (matrix-ty b)))
(make-instance 'matrix
:a (+ (* aa ba) (* ab bc)) ;;(* 0.0 btx)
:b (+ (* aa bb) (* ab bd)) ;;(* 0.0 b32)
;;(+ (* a11 b13) (* a12 b23) (* a13 b33))
:c (+ (* ac ba) (* ad bc)) ;;(*a23 b31)
:d (+ (* ac bb) (* ad bd)) ;;(* a23 b32)
;;(+ (* a21 b13) (* a22 b23) (* a23 b33))
:tx (+ (* ae ba) (* af bc) be) ;;(* a33 b31)
:ty (+ (* ae bb) (* af bd) bf)))) ;;(* a33 b32)
;;(+ (* a31 b13) (* a32 b23) (* a33 b33))
;; concatenaten
;; Concatenate a list of matrices
(defun matrix-concatenate (a &rest ms)
(let ((product (matrix-concatenate-aux a (car ms)))
(rest (cdr ms)))
(if (not (consp rest))
product
(matrix-concatenate product (cdr ms)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Applying transformation matrices to objects.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; transform
;; Transform a point by a matrix
;; This is going to be a bottleneck, so unroll it
;; Optimise so rather than first, second, third, we use car/cdr on each cdr
(defun matrix-point-transform (x y m)
(let* ((a (matrix-a m))
(b (matrix-b m))
(c (matrix-c m))
(d (matrix-d m))
(tx (matrix-tx m))
(ty (matrix-ty m))
(xx (+ (* x a)
(* y b)
tx))
(yy (+ (* x c)
(* y d)
ty)))
(values xx yy)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Matrix stacks, pushing, popping
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun make-matrix-stack ()
(list (make-matrix-identity)))
(defun stack-set-matrix (matrix-stack matrix)
(cons matrix (cdr matrix-stack)))
(defun stack-current-matrix (matrix-stack)
(car matrix-stack))
(defun stack-concatenate-matrix (matrix-stack matrix)
(stack-set-matrix matrix-stack
(matrix-concatenate matrix
(stack-current-matrix matrix-stack))))
(defun stack-push-matrix (matrix-stack)
(cons (copy-tree (stack-current-matrix matrix-stack))
matrix-stack))
(defun stack-pop-matrix (matrix-stack)
(cdr matrix-stack))
(defun get-translate-values (trans)
(multiple-value-bind (x next)
(read-from-string trans nil 0.0)
(values x (read-from-string trans nil 0.0 :start next)))) | 5,801 | Common Lisp | .lisp | 169 | 31.414201 | 121 | 0.548791 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 4e7a424001689a583c41b48468e0f43a985125e568373a11999c8abc74ebfb99 | 21,735 | [
-1
] |
21,736 | keymap.lisp | rheaplex_minara/src/keymap.lisp | ;; keymap.lisp : Keymaps
;;
;; Copyright (c) 2004, 2007 Rob Myers, [email protected]
;;
;; This file is part of Minara.
;;
;; Minara is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; Minara is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Minara. If not, see <http://www.gnu.org/licenses/>.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Keymaps
;; Inspired by, but different from, Emacs keymaps.
;; In particular keymaps fit within more general event handlers, rather than
;; the other way round. (If that statement is incorrect, please correct it).
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(in-package minara)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; FIXME: Use Emacs-style nested keymaps
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Window-system-specific constants
;; Here GLUT constants
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defconstant GLUT_KEY_F1 1)
(defconstant GLUT_KEY_F2 2)
(defconstant GLUT_KEY_F3 3)
(defconstant GLUT_KEY_F4 4)
(defconstant GLUT_KEY_F5 5)
(defconstant GLUT_KEY_F6 6)
(defconstant GLUT_KEY_F7 7)
(defconstant GLUT_KEY_F8 8)
(defconstant GLUT_KEY_F9 9)
(defconstant GLUT_KEY_F10 10)
(defconstant GLUT_KEY_F11 11)
(defconstant GLUT_KEY_F12 12)
;; directional keys
(defconstant GLUT_KEY_LEFT 100)
(defconstant GLUT_KEY_UP 101)
(defconstant GLUT_KEY_RIGHT 102)
(defconstant GLUT_KEY_DOWN 103)
(defconstant GLUT_KEY_PAGE_UP 104)
(defconstant GLUT_KEY_PAGE_DOWN 105)
(defconstant GLUT_KEY_HOME 106)
(defconstant GLUT_KEY_END 107)
(defconstant GLUT_KEY_INSERT 108)
;; glutGetModifiers return mask.
(defconstant GLUT_ACTIVE_SHIFT 1)
(defconstant GLUT_ACTIVE_CTRL 2)
(defconstant GLUT_ACTIVE_ALT 4)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Making and getting keymaps
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Make an empty keymap alist
(defun make-keymap ()
(make-hash-table :size 31))
;; The one and only global keymap
(defvar *global-keymap* (make-keymap))
;; The current root keymap
(defvar *keymap-current-root* nil)
;; Check that the object is a keymap
(defun keymap-p (keymap)
(hash-table-p keymap))
;; The current keymap
(defvar *keymap-current* *keymap-current-root*)
;; Reset the history
(defun reset-current-keymap ()
(setf *keymap-current* *keymap-current-root*))
;; Set the root keymap
(defun keymap-current-root-set (keymap)
(setf *keymap-current-root* keymap)
(reset-current-keymap))
;; Reset the root keymap
(defun keymap-current-root-reset ()
(setf *keymap-current-root* nil))
;; Set the current keymap
(defun keymap-current-set (keymap)
(setf *keymap-current* keymap))
;; Add a possibly nested key fun to the keymap
;; A key is a basic key (aA1) prefixed with CA for control and/or alt
(defun keymap-add-fun-list (keymap fun keys)
(let* ((key (car keys))
(rest-of-keys (cdr keys))
(keymap-entry-for-key (gethash key keymap t)))
;;(format #t "keys: ~a~%key: ~a~%keymap-for-key: ~a~%rest: ~a~%~%"
;; keys key keymap-entry-for-key rest-of-keys)
(cond
;; Last key? Insert in current keymap
((eq rest-of-keys nil)
;; Warn if rebinding key
;;(if (hash-ref keymap
;; key)
;; (format #t "Redefined key ~a in keymap ~a~%" key keymap))
(setf (gethash key keymap)
fun))
;; No keymap for key?
((eq keymap-entry-for-key t)
;; Create it
(setf (gethash key keymap)
(make-keymap))
;; And recurse
(keymap-add-fun-list (gethash key keymap)
fun
rest-of-keys))
;; Keymap exists but key is not last key?
(t
;; If it's a key, replace with a keymap
(if (functionp keymap-entry-for-key)
(setf (gethash key keymap)
(make-keymap)))
;; Just recurse, re-getting keymap in case we replaced key with keymap
(keymap-add-fun-list (gethash key keymap)
fun
rest-of-keys)))))
(defun keymap-add-fun (keymap fun &rest keys)
(keymap-add-fun-list keymap fun keys))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Dispatching keypresses through keymaps
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Try to dispatch the key press in the keymap
(defun dispatch-keymap (keymap key)
(let ((next-candidate (gethash key
keymap)))
(cond
;; Keymap? Install as current keymap
((keymap-p next-candidate)
(keymap-current-set next-candidate)
t)
;; No match? Reset
((not next-candidate)
(reset-current-keymap)
nil)
;; Fun? Call
(t ;;(fun? next-candidate)
(funcall next-candidate)
(reset-current-keymap)
t))))
;; Try to dispatch the current keymap
(defun dispatch-key (key)
(if (not (and *keymap-current*
(dispatch-keymap *keymap-current*
key)))
(if (not (dispatch-keymap *global-keymap*
key))
(format t
"No match for key ~a in current or global keymap.~%"
key))))
;; Our method to interface to the event system
;; Note that whilst getting shift alt and control is GLUT-dependent,
;; once we make the booleans it could be any windowing system
(defun key-dispatch-hook-method (win key modifiers)
(declare (ignore win))
(let (;; (shift (= 1 (logand modifiers
;; GLUT_ACTIVE_SHIFT)))
(control (= 2 (logand modifiers
GLUT_ACTIVE_CTRL)))
(alt (= 4 (logand modifiers
GLUT_ACTIVE_ALT))))
;; Shift is just the upper-case character
;;(if shift
;;(set! key (concatenate 'string "S" key)))
(if control
(setf key (concatenate 'string "C" key)))
(if alt
(setf key (concatenate 'string "A" key)))
(dispatch-key key)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Setting up the keymaps in the events system
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Install the cancel key into the global keymap
(keymap-add-fun *global-keymap* #'reset-current-keymap "Cg")
;; Hook into the event system
;;(add-key-release-hook #'key-dispatch-hook-method)
;; TEST
#|(defun dummy ()
(write "hello"))
(defun dummy2 ()
(write "hello 2"))
(defvar km (make-keymap))
(keymap-add-fun km #'dummy "a")
(keymap-add-fun km #'dummy2 "b" "c")
(keymap-current-root-set km)
(dispatch-key "a")|# | 7,164 | Common Lisp | .lisp | 191 | 34.287958 | 79 | 0.588668 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | aa382dd358b63fbd913d166c2e541354d2231cf43423c1982cda4f9763af0cd8 | 21,736 | [
-1
] |
21,737 | evaluation.lisp | rheaplex_minara/src/evaluation.lisp | (in-package minara)
(defmacro with-package (package &rest rest)
(let ((old-package (gensym)))
`(let ((,old-package *package*))
(setf *package* ,package)
,@rest
(setf *package* ,old-package ))))
#|(defvar *temp-package-num* 0)
(defun disposable-package-with-package (base-package)
"Create a disposable package that includes the symbols from base-package."
(+1 *temp-package-num*)
('make-package (format nil "%%temp-%d" *temp-package-num*)
:use (list base-package)))
(defun eval-buffer-with-package (buffer package)
"Eval buffer in a temporary package with the symbols exported from package."
(with-package (disposable-package-with-package package)
(let ((stream (make-buffer-stream (contents buffer))))
(loop
do (let ((form (read stream nil stream)))
(if (ne form stream)
(eval form)
(return nil)))))))|# | 878 | Common Lisp | .lisp | 22 | 35.545455 | 78 | 0.677608 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 2269c4cd26d025ebffbece9f3088c45f4ac82b7196511ec903cfa695aea90cce | 21,737 | [
-1
] |
21,738 | minara.lisp | rheaplex_minara/src/minara.lisp | ;; minara.lisp : setup and startup
;;
;; Copyright (c) 2007 Rob Myers, [email protected]
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, write to the Free Software
;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
(in-package minara)
;; Load the splash screen if required
;; This is a GLUT wart: if we started without a window open we'd quit
(defun load-splash-screen ()
(display-window (make-window-from-file "../minara.minara")))
;; Main entry point / startup.
(defun minara ()
(load-splash-screen)) | 1,086 | Common Lisp | .lisp | 25 | 42.04 | 71 | 0.753321 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | c1cdf145937ed2bd7c3b97866636dd1a05d0e5125ae9900fd3025e0cdc989f54 | 21,738 | [
-1
] |
21,739 | shape-tools.lisp | rheaplex_minara/src/shape-tools.lisp | ;; shape-tools.lisp : simple shape tools
;;
;; Copyright (c) 2004, 2007 Rob Myers, [email protected]
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, write to the Free Software
;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
;; Trivial shape tools
;; Something to inspire more advanced tools
;; TODO - Keymap for polygon & star to increase/decrease number of sides
;; and increase/decrease inner radius
;; TODO - Oval tool
;; TODO - Insert function call rather than code
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Circle
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar *circle-tool-mouse-down* nil)
(defvar *circle-tool-mouse-down-x* nil)
(defvar *circle-tool-mouse-down-y* nil)
;; When the button is pressed, make and initialise the circle drawing buffer
(defun circle-mouse-down (window button x y)
(let* ((circle-buffer (buffer-text (make-window-buffer window
"circle"))))
(window-undo-stack-push window
circle-buffer)
(setf circle-tool-mouse-down t)
(setf circle-tool-mouse-down-x (window-view-x window
x))
(setf circle-tool-mouse-down-y (window-view-y window
y))))
(defun circle-mouse-move (window raw-x raw-y)
(if circle-tool-mouse-down
(let* ((circle-buffer (window-buffer window
"circle"))
(x (window-view-x window
raw-x))
(y (window-view-y window
raw-y))
(radius (abs (distance-between-points circle-tool-mouse-down-x
circle-tool-mouse-down-y
x
y)))
;; http://www.whizkidtech.redprince.net/bezier/circle/
(l (* radius
0.5522847498))
(left (- circle-tool-mouse-down-x
radius))
(right (+ circle-tool-mouse-down-x
radius))
(top (+ circle-tool-mouse-down-y
radius))
(bottom (- circle-tool-mouse-down-y
radius)))
(buffer-erase circle-buffer)
(write-current-colour circle-buffer)
(buffer-insert-undoable circle-buffer
nil
"(path-begin)\n")
(buffer-insert-undoable circle-buffer
nil
(format nil
"(move-to ~f ~f)~%"
left circle-tool-mouse-down-y))
(buffer-insert-undoable circle-buffer
nil
(format nil
"(curve-to ~f ~f ~f ~f ~f ~f)~%"
left (+ circle-tool-mouse-down-y l)
(- circle-tool-mouse-down-x l) top
circle-tool-mouse-down-x top))
(buffer-insert-undoable circle-buffer
nil
(format nil
"(curve-to ~f ~f ~f ~f ~f ~f)~%"
(+ circle-tool-mouse-down-x l) top
right (+ circle-tool-mouse-down-y l)
right circle-tool-mouse-down-y))
(buffer-insert-undoable circle-buffer
nil
(format nil
"(curve-to ~f ~f ~f ~f ~f ~f)~%"
right (- circle-tool-mouse-down-y l)
(+ circle-tool-mouse-down-x l) bottom
circle-tool-mouse-down-x bottom))
(buffer-insert-undoable circle-buffer
nil
(format nil
"(curve-to ~f ~f ~f ~f ~f ~f)~%"
(- circle-tool-mouse-down-x l) bottom
left (- circle-tool-mouse-down-y l)
left circle-tool-mouse-down-y))
(buffer-insert-undoable circle-buffer
nil
"(path-end)\n")
(buffer-undo-mark circle-buffer)
(buffer-invalidate circle-buffer)
(window-redraw window))))
;; When the mouse is released, add the circle buffer to the main buffer
;; Redraw the main buffer, and release the pen drawing buffers
(defun circle-mouse-up (window button x y)
(setf circle-tool-mouse-down nil)
(let* ((buff (window-buffer
window
"circle"))
(main-buff (window-buffer-main window)))
(buffer-insert-undoable main-buff
nil
(buffer-to-string buff))
(buffer-undo-mark main-buff)
(window-undo-stack-pop window)
;; Clean up and redraw
(remove-window-buffer window
"circle")
(buffer-invalidate (window-buffer-main window))
(window-redraw window)))
;; Install
(defun circle-tool-install ()
(add-mouse-move-hook circle-mouse-move)
(add-mouse-down-hook circle-mouse-down)
(add-mouse-up-hook circle-mouse-up))
;; Uninstall
(defun circle-tool-uninstall ()
(remove-mouse-move-hook circle-mouse-move)
(remove-mouse-down-hook circle-mouse-down)
(remove-mouse-up-hook circle-mouse-up))
;; Register
(install-tool circle-tool-install
circle-tool-uninstall
"Circle"
"t" "c")
;; Oval
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Square
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar square-tool-mouse-down nil)
(defvar square-tool-mouse-down-x nil)
(defvar square-tool-mouse-down-y nil)
;; When the button is pressed, make and initialise the drawing buffer
(defun square-mouse-down (window button x y)
(let* ((buff (buffer-text (make-window-buffer window
"square"))))
(window-undo-stack-push window
buff)
(setf square-tool-mouse-down t)
(setf square-tool-mouse-down-x (window-view-x window
x))
(setf square-tool-mouse-down-y (window-view-y window
y))))
(defun square-mouse-move (window raw-x raw-y)
(if square-tool-mouse-down
(let* ((buff (window-buffer window
"square"))
(x (window-view-x window
raw-x))
(y (window-view-y window
raw-y))
(radius (distance-between-points square-tool-mouse-down-x
square-tool-mouse-down-y
x
y))
(left (- square-tool-mouse-down-x radius))
(right (+ square-tool-mouse-down-x radius))
(top (+ square-tool-mouse-down-y radius))
(bottom (- square-tool-mouse-down-y radius)))
(buffer-erase buff)
(write-current-colour buff)
(buffer-insert-undoable buff
nil
"(path-begin)\n")
(buffer-insert-undoable buff
nil
(format nil
"(move-to ~f ~f)~%"
left bottom))
(buffer-insert-undoable buff
nil
(format nil
"(line-to ~f ~f)~%"
left top))
(buffer-insert-undoable buff
nil
(format nil
"(line-to ~f ~f)~%"
right top))
(buffer-insert-undoable buff
nil
(format nil
"(line-to ~f ~f)~%"
right bottom))
(buffer-insert-undoable buff
nil
(format nil
"(line-to ~f ~f)~%"
left bottom))
(buffer-insert-undoable buff
nil
"(path-end)\n")
(buffer-undo-mark buff)
(buffer-invalidate buff)
(window-redraw window))))
;; When the mouse is released, add the circle buffer to the main buffer
;; Redraw the main buffer, and release the pen drawing buffers
(defun square-mouse-up (window button x y)
(setf square-tool-mouse-down nil)
(let* ((buff (window-buffer
window
"square"))
(main-buff (window-buffer-main window)))
(buffer-insert-undoable main-buff
nil
(buffer-to-string buff))
(buffer-undo-mark main-buff)
(window-undo-stack-pop window)
;; Clean up and redraw
(remove-window-buffer window
"square")
(buffer-invalidate (window-buffer-main window))
(window-redraw window)))
;; Install
(defun square-tool-install ()
(add-mouse-move-hook square-mouse-move)
(add-mouse-down-hook square-mouse-down)
(add-mouse-up-hook square-mouse-up))
;; Uninstall
(defun (square-tool-uninstall)
(remove-mouse-move-hook square-mouse-move)
(remove-mouse-down-hook square-mouse-down)
(remove-mouse-up-hook square-mouse-up))
;; Register
(install-tool square-tool-install
square-tool-uninstall
"Square"
"t" "s")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Rectangle
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar star-number-points 6)
(defvar star-inner-radius-offset 0.5)
(defvar rectangle-tool-mouse-down nil)
(defvar rectangle-tool-mouse-down-x nil)
(defvar rectangle-tool-mouse-down-y nil)
;; When the button is pressed, make and initialise the drawing buffer
(defun rectangle-mouse-down (window button x y)
(let* ((buff (buffer-text (make-window-buffer window
"rectangle"))))
(window-undo-stack-push window
buff)
(setf rectangle-tool-mouse-down t)
(setf rectangle-tool-mouse-down-x (window-view-x window
x))
(setf rectangle-tool-mouse-down-y (window-view-y window
y))))
(defun rectangle-mouse-move (window raw-x raw-y)
(if rectangle-tool-mouse-down
(let* ((buff (window-buffer window
"rectangle"))
(x (window-view-x window
raw-x))
(y (window-view-y window
raw-y)))
(buffer-erase buff)
(write-current-colour buff)
(buffer-insert-undoable buff
nil
"(path-begin)\n")
(buffer-insert-undoable buff
nil
(format nil
"(move-to ~f ~f)~%"
rectangle-tool-mouse-down-x
rectangle-tool-mouse-down-y))
(buffer-insert-undoable buff
nil
(format nil
"(line-to ~f ~f)~%"
x
rectangle-tool-mouse-down-y))
(buffer-insert-undoable buff
nil
(format nil
"(line-to ~f ~f)~%"
x
y))
(buffer-insert-undoable buff
nil
(format nil
"(line-to ~f ~f)~%"
rectangle-tool-mouse-down-x
y))
(buffer-insert-undoable buff
nil
(format nil
"(line-to ~f ~f)~%"
rectangle-tool-mouse-down-x
rectangle-tool-mouse-down-y))
(buffer-insert-undoable buff
nil
"(path-end)\n")
(buffer-undo-mark buff)
(buffer-invalidate buff)
(window-redraw window))))
;; When the mouse is released, add the circle buffer to the main buffer
;; Redraw the main buffer, and release the pen drawing buffers
(defun rectangle-mouse-up (window button x y)
(setf rectangle-tool-mouse-down nil)
(let* ((buff (window-buffer
window
"rectangle"))
(main-buff (window-buffer-main window)))
(buffer-insert-undoable main-buff
nil
(buffer-to-string buff))
(buffer-undo-mark main-buff)
(window-undo-stack-pop window)
;; Clean up and redraw
(remove-window-buffer window
"rectangle")
(buffer-invalidate (window-buffer-main window))
(window-redraw window)))
;; Install
(defun rectangle-tool-install ()
(add-mouse-move-hook rectangle-mouse-move)
(add-mouse-down-hook rectangle-mouse-down)
(add-mouse-up-hook rectangle-mouse-up))
;; Uninstall
(defun rectangle-tool-uninstall ()
(remove-mouse-move-hook rectangle-mouse-move)
(remove-mouse-down-hook rectangle-mouse-down)
(remove-mouse-up-hook rectangle-mouse-up))
;; Register
(install-tool rectangle-tool-install
rectangle-tool-uninstall
"Rectangle"
"t" "r")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Star
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar star-points 5)
(defvar star-inner-radius-fraction 0.5)
(defvar star-tool-mouse-down nil)
(defvar star-tool-mouse-down-x nil)
(defvar star-tool-mouse-down-y nil)
;; When the button is pressed, make and initialise the drawing buffer
(defun star-mouse-down (window button x y)
(let* ((buff (buffer-text (make-window-buffer window
"star"))))
(window-undo-stack-push window
buff)
(setf star-tool-mouse-down t)
(setf star-tool-mouse-down-x (window-view-x window
x))
(setf star-tool-mouse-down-y (window-view-y window
y))))
(defun star-draw-point (buff theta inner-angle-step inner-y outer-y)
(let ((outer-point (rotate-point-around-point star-tool-mouse-down-x
star-tool-mouse-down-y
star-tool-mouse-down-x
outer-y
theta))
(inner-point (rotate-point-around-point star-tool-mouse-down-x
star-tool-mouse-down-y
star-tool-mouse-down-x
inner-y
(- theta
inner-angle-step))))
(buffer-insert-undoable buff
nil
(format nil
"(line-to ~f ~f)~%"
(car inner-point)
(cdr inner-point)))
(buffer-insert-undoable buff
nil
(format nil
"(line-to ~f ~f)~%"
(car outer-point)
(cdr outer-point)))))
(defun star-draw (window x y)
(let* ((buff (window-buffer window
"star"))
(radius (/ (distance-between-points star-tool-mouse-down-x
star-tool-mouse-down-y
x
y)
2.0))
(inner-radius (/ radius
star-inner-radius-fraction))
(angle-step (/ 360.0
star-points))
(inner-angle-step (/ angle-step
2.0))
(inner-y (+ star-tool-mouse-down-y
inner-radius))
(outer-y (+ star-tool-mouse-down-y
radius))
(first-point (rotate-point-around-point star-tool-mouse-down-x
star-tool-mouse-down-y
star-tool-mouse-down-x
outer-y
(- inner-angle-step))))
(buffer-insert-undoable buff
nil
"(path-begin)\n")
(buffer-insert-undoable buff
nil
(format nil
"(move-to ~f ~f)~%"
(car first-point)
(cdr first-point)))
(do ((theta inner-angle-step (+ theta angle-step)))
((> theta 360.0) nil)
(star-draw-point buff theta inner-angle-step inner-y outer-y))
(buffer-insert-undoable buff
nil
"(path-end)\n")))
(defun star-mouse-move (window raw-x raw-y)
(if star-tool-mouse-down
(let* ((buff (window-buffer window
"star"))
(x (window-view-x window
raw-x))
(y (window-view-y window
raw-y)))
(buffer-erase buff)
(write-current-colour buff)
(star-draw window
x
y)
(buffer-undo-mark buff)
(buffer-invalidate buff)
(window-redraw window))))
;; When the mouse is released, add the circle buffer to the main buffer
;; Redraw the main buffer, and release the pen drawing buffers
(defun star-mouse-up (window button x y)
(setf star-tool-mouse-down nil)
(let* ((buff (window-buffer
window
"star"))
(main-buff (window-buffer-main window)))
(buffer-insert-undoable main-buff
nil
(buffer-to-string buff))
(buffer-undo-mark main-buff)
(window-undo-stack-pop window)
;; Clean up and redraw
(remove-window-buffer window
"star")
(buffer-invalidate (window-buffer-main window))
(window-redraw window)))
;; Install
(defun star-tool-install ()
(add-mouse-move-hook star-mouse-move)
(add-mouse-down-hook star-mouse-down)
(add-mouse-up-hook star-mouse-up))
;; Uninstall
(defun star-tool-uninstall ()
(remove-mouse-move-hook star-mouse-move)
(remove-mouse-down-hook star-mouse-down)
(remove-mouse-up-hook star-mouse-up))
;; Register
(install-tool star-tool-install
star-tool-uninstall
"Star"
"t" "S")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Polygon
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar polygon-points 5)
(defvar polygon-tool-mouse-down nil)
(defvar polygon-tool-mouse-down-x nil)
(defvar polygon-tool-mouse-down-y nil)
;; When the button is pressed, make and initialise the drawing buffer
(defun polygon-mouse-down (window button x y)
(let* ((buff (buffer-text (make-window-buffer window
"polygon"))))
(window-undo-stack-push window
buff)
(setf polygon-tool-mouse-down t)
(setf polygon-tool-mouse-down-x (window-view-x window
x))
(setf polygon-tool-mouse-down-y (window-view-y window
y))))
(defun polygon-draw (window x y)
(let* ((buff (window-buffer window
"polygon"))
(radius (distance-between-points polygon-tool-mouse-down-x
polygon-tool-mouse-down-y
x
y))
(angle-step (/ 360.0
polygon-points))
(outer-y (+ polygon-tool-mouse-down-y
radius)))
(buffer-insert-undoable buff
nil
"(path-begin)\n")
(buffer-insert-undoable buff
nil
(format nil
"(move-to ~f ~f)~%"
polygon-tool-mouse-down-x
outer-y))
(do ((theta angle-step (+ theta angle-step)))
((> theta 360.0) nil)
(let ((outer-point (rotate-point-around-point polygon-tool-mouse-down-x
polygon-tool-mouse-down-y
polygon-tool-mouse-down-x
outer-y
theta)))
(buffer-insert-undoable buff
nil
(format nil
"(line-to ~f ~f)~%"
(car outer-point)
(cdr outer-point)))))
(buffer-insert-undoable buff
nil
"(path-end)\n")))
(defun polygon-mouse-move (window raw-x raw-y)
(if polygon-tool-mouse-down
(let* ((buff (window-buffer window
"polygon"))
(x (window-view-x window
raw-x))
(y (window-view-y window
raw-y)))
(buffer-erase buff)
(write-current-colour buff)
(polygon-draw window
x
y)
(buffer-undo-mark buff)
(buffer-invalidate buff)
(window-redraw window))))
;; When the mouse is released, add the circle buffer to the main buffer
;; Redraw the main buffer, and release the pen drawing buffers
(defun polygon-mouse-up (window button x y)
(setf polygon-tool-mouse-down nil)
(let* ((buff (window-buffer
window
"polygon"))
(main-buff (window-buffer-main window)))
(buffer-insert-undoable main-buff
nil
(buffer-to-string buff))
(buffer-undo-mark main-buff)
(window-undo-stack-pop window)
;; Clean up and redraw
(remove-window-buffer window
"polygon")
(buffer-invalidate (window-buffer-main window))
(window-redraw window)))
;; Install
(defun polygon-tool-install ()
(add-mouse-move-hook polygon-mouse-move)
(add-mouse-down-hook polygon-mouse-down)
(add-mouse-up-hook polygon-mouse-up))
;; Uninstall
(defun polygon-tool-uninstall ()
(remove-mouse-move-hook polygon-mouse-move)
(remove-mouse-down-hook polygon-mouse-down)
(remove-mouse-up-hook polygon-mouse-up))
;; Register
(install-tool polygon-tool-install
polygon-tool-uninstall
"Polygon"
"t" "y")
| 25,431 | Common Lisp | .lisp | 577 | 26.65338 | 79 | 0.449037 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 5380c6dbcf97b5f7809cafa96eb62fadea76acf67bb3a695b1426bccec9d49b6 | 21,739 | [
-1
] |
21,740 | buffer-old.lisp | rheaplex_minara/src/buffer-old.lisp | ;; buffer.lisp : buffers for minara
;;
;; Copyright (c) 2004,2007 Rob Myers, [email protected]
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, write to the Free Software
;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Modules
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Timestamps
;; We use timestamps to keep track of when something has changed,
;; particularly buffers of scheme code and the cached drawing of them.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Timestamps
(define update-timestamp (buf)
(set-object-property! buf 'timestamp (current-time)))
(define (timestamp-from-file buf file-path)
(set-object-property! buf
'timestamp
(stat:mtime (stat file-path))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Buffer
;; A buffer of text, particularly the Scheme code describing the drawing
;; instructions from a document or an overlay.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; The buffer record
(defstruct buffer
(text buffer-text
set-buffer-text!)
;; The cached rendering generated by executing the text buffer
(cache buffer-cache)
;; The variables alist
(buffer-variables buffer-variables
set-buffer-variables!))
;; Public constructor
(define (make-buffer)
(let ((buf (really-make-buffer (make-gap-buffer)
(cache-make)
(list))))
(update-timestamp! (buffer-text buf))
(initialise-timestamp! (buffer-cache buf))
buf))
;; Public constrictor to load the buffer from file
(define (make-buffer-from-file file-path)
(let ((buf (really-make-buffer (find-file file-path)
(cache-make)
'())))
(update-timestamp! (buffer-text buf))
(initialise-timestamp! (buffer-cache buf))
buf))
;; The file path for a buffer than has been loaded from file
(define (buffer-file buf)
(object-property (buffer-text buf) 'filename))
;; Reload the buffer from file.
(define (buffer-file-reload buf)
(buffer-delete-undoable buf #f #f)
(buffer-insert-undoable buf
0
(gb->string (find-file (buffer-file buf))))
(buffer-undo-mark buf)
(buffer-invalidate buf))
;; Convert the buffer to a string
(define (buffer-to-string buf)
(gb->string (buffer-text buf)))
(define (buffer-erase buf)
(gb-erase! (buffer-text buf)))
(define (buffer-end buf)
(gb-point-max (buffer-text buf)))
(define (buffer-start buf)
(gb-point-min (buffer-text buf)))
(define (buffer-range-to-string buf from length)
(gb->substring (buffer-text buf)
from
length))
;; Insert outside of the undo system. No, you really do not want this. See undo.
(define (buffer-insert-no-undo buffer pos text)
(let* ((gap-buffer (buffer-text buffer))
(position (or pos
(gb-point-max gap-buffer))))
(gb-goto-char gap-buffer
position)
(gb-insert-string! gap-buffer
text)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Buffer Variables
;; A buffer can have an arbitrary number of named variables set on it.
;; These will last until the buffer is disposed of, and are unaffected by event
;; handling, particularly redraws, unless the code inside the buffer affects
;; the variables when evaluated, which would be weird.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Set buffer variable
(define (set-buffer-variable! buffer name value)
(let ((variables (buffer-variables buffer)))
(set-buffer-variables! buffer
(assoc-set! variables
name
value))))
;; Get buffer variable
(define (buffer-variable buffer name)
(assoc-ref (buffer-variables buffer)
name))
;; Get buffer variable, creating it if it doesn't exist
(define (ensure-buffer-variable buffer name)
(assoc-ref (buffer-variables buffer)
name))
;; Remove buffer variable
(define (kill-buffer-variable! buffer name)
(set-buffer-variables! buffer
(assoc-remove! (buffer-variables buffer)
name)))
;; Remove all buffer variables
(define (kill-all-buffer-variables buffer)
(set-buffer-variables! '()))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Buffer Drawing and Caching
;; Note that we draw lazily, only evaluating a buffer if it has been updated
;; since it was last cached.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; So code located in the current buffer can get buffer variables, for example.
(define %current-buffer nil)
(define (current-buffer)
%current-buffer)
;; Redraw the buffer (just run the cache if no timestamp variation)
(define (draw-buffer cb)
;; Is the cache more recent than the buffer text?
(if (< (timestamp (buffer-text cb))
(timestamp (buffer-cache cb)))
;; Just redraw the cache, the text hasn't changed
(cache-draw (buffer-cache cb))
;; Otherwise, generate the cache and update the cache timestamp
(let ((c (buffer-cache cb)))
(cache-record-begin c)
(set! %current-buffer cb)
(eval-string (buffer-to-string cb))
(set! %current-buffer #f)
(cache-record-end c)
(update-timestamp! (buffer-cache cb)))))
;; Flag the buffer to be drawn when the window next redraws
(define (buffer-invalidate cb)
(update-timestamp! (buffer-text cb)))
| 6,129 | Common Lisp | .lisp | 152 | 36.986842 | 80 | 0.624599 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | dc9fa0a180d83bbc080cc2a8ce89f072ce6b4302b5eea284d9f39df2274abac6 | 21,740 | [
-1
] |
21,741 | menu.lisp | rheaplex_minara/src/menu.lisp | ;; menu.lisp : contextual menus for minara
;;
;; Copyright (c) 2004, 2007 Rob Myers, [email protected]
;;
;; This file is part of Minara.
;;
;; Minara is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; Minara is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Minara. If not, see <http://www.gnu.org/licenses/>.
(in-package minara)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Menus
;; We use GLUT contextual menus at the moment. This is terrible. Nothing should
;; be done that relies on this, or that would prevent proper pull-down menus
;; being used in future.
;;
;; Menu handlers receive the window id they're called on as their parameter.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; The global menu / menu item id count
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar *menu-item-id* 1024)
(defun menu-id-make ()
(let ((id *menu-item-id*))
(setf *menu-item-id* (+ *menu-item-id* 1))
id))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Callbacks for menu items
;; So when the window system passes us a "menu selected" event, we look up the
;; menu item id here and call the callback registered under that id.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar menu-callbacks '())
(defun menu-callback-add (id callback)
(setf menu-callbacks
(acons id callback menu-callbacks)))
(defun menu-callback-remove (id)
(setf menu-callbacks
(remove-if (lambda (target) (eq target (car id)))
menu-callbacks)))
(defun menu-callback (id)
(assoc id menu-callbacks))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Top-level menus
;; We only have 1-level deep menus at the moment, no nested submenus.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun menu-make-toplevel (title)
(list (minara-menu-make) title))
(defun menu-name (menu)
(cadr menu))
(defun menu-id (menu)
(car menu))
(defun menu-install-toplevel (menu)
(minara-menu-install (menu-id menu) (menu-name menu)))
;; Remove a menu
;; Unimplemented
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; menu items
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Create a menu item.
;; This installs a callback that will be called when this item is selected.
(defun menu-make-entry (menu title callback)
(let ((item-id (menu-id-make)))
(minara-menu-add-entry (menu-id menu) title item-id)
(menu-callback-add item-id callback)
item-id))
;; Remove a menu item
(defun menu-delete-entry (menu-id)
(minara-menu-remove-entry menu-id)
(menu-callback-remove menu-id))
;; Change a menu state
;; Get a menu state
;; Enable a menu item
;; Disble a menu item
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Menu event handling
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; The standard menu event handler
;; Hooked into the main event system in events.scm
;; Don't replace.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun default-menu-handler (window-id menu-id)
(let ((handler (cdr (menu-callback menu-id))))
(if handler
(funcall handler window-id))))
(defun install-default-menu-handler ()
(add-menu-select-hook #'default-menu-handler))
;; Just install the default menu handler to start with
(install-default-menu-handler)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; testing
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; (define (pen-dummy window-id)
; (write "called pen dummy"))
; (define (colour-dummy window-id)
; (write "called colour dummy"))
; (define (select-dummy window-id)
; (write "called select dummy"))
; (define menoo (menu-make-toplevel "tools"))
; (menu-make-entry menoo "pen" pen-dummy)
; (menu-make-entry menoo "colour" colour-dummy)
; (menu-make-entry menoo "select" select-dummy)
; (menu-install-toplevel menoo) | 4,804 | Common Lisp | .lisp | 112 | 40.991071 | 79 | 0.532903 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 06fdfff377187eb79b38bdd050231db43db198e6c4194524bca743d2bbbf3c42 | 21,741 | [
-1
] |
21,742 | minara-scratch.lisp | rheaplex_minara/src/minara-scratch.lisp |
;; How does Slime handle source file positions?
;; Anyway, deftool can register these
*compile-file-truename*
*load-truename*
(defmacro file-path-string ()
*compile-file-truename*)
(defmacro with-package (package &rest rest)
(with-gensyms (old-buffer)
`(setf old-buffer *package*)
`(setf *package* package)
@,rest
`(setf *package* old-package)))
(defvar *temp-package-num* 0)
(defun disposable-package-with-package (base-package)
"Create a disposable package that includes the symbols from base-package."
(+1 *temp-package-num*)
('make-package (format nil "%%temp-%d" *temp-package-num*)
:use (list base-package)))
(defun eval-buffer-with-package (buffer package)
"Eval buffer in a temporary package with the symbols exported from package."
(with-package (disposable-package-with-package package)
(let ((stream (make-buffer-stream (contents buffer))))
(loop
do (let ((form (read stream nil stream)))
(if (ne form stream)
(eval form)
(return nil)))))))
(defclass minara-window (glut:window)
()
(:default-initargs :width 500 :height 500 :pos-x 100 :pos-y 100
:mode '(:single :rgb) :title "movelight.lisp"))
(defmethod glut:display-window :before ((w polys-window))
(gl:clear-color 0 0 0 0)
(gl:shade-model :flat))
(defmethod glut:display ((w movelight-window))
(gl:clear :color-buffer-bit :depth-buffer-bit)
(gl:with-pushed-matrix
(glu:look-at 0 0 5 0 0 0 0 1 0)
(gl:with-pushed-matrix
(gl:rotate (slot-value w 'spin) 1 0 0)
(gl:light :light0 :position #(0 0 1.5 1))
(gl:translate 0 0 1.5)
(gl:disable :lighting)
(gl:color 0 1 1)
(glut:wire-cube 0.1)
(gl:enable :lighting))
(glut:solid-torus 0.275 0.85 8 15))
(gl:flush))
(defmethod glut:reshape ((w movelight-window) width height)
(gl:viewport 0 0 width height)
(gl:matrix-mode :projection)
(gl:load-identity)
(glu:perspective 40 (/ width height) 1 20)
(gl:matrix-mode :modelview)
(gl:load-identity))
(defmethod glut:mouse ((w movelight-window) button state x y)
(declare (ignore x y))
(when (and (eq button :left-button) (eq state :down))
(with-slots (spin) w
(setf spin (mod (+ spin 30) 360)))
(glut:post-redisplay)))
(defmethod glut:keyboard ((w movelight-window) key x y)
(declare (ignore x y))
(defmethod initialize-instance :after ((w varray-window) &key)
(gl:clear-color 0 0 0 0)
(gl:shade-model :smooth)
(setup-pointers))
(defmethod glut:display ((w varray-window))
(gl:clear :color-buffer-bit)
(ecase deref-method
(draw-array
(gl:draw-arrays :triangles 0 6))
(array-element
(gl:with-primitives :triangles
(gl:array-element 2)
(gl:array-element 3)
(gl:array-element 5)))
(draw-elements
(gl:draw-elements :polygon 4 :unsigned-int '(0 1 3 4))))
(gl:flush))
(defmethod glut:reshape ((w varray-window) width height)
(gl:viewport 0 0 width height)
(gl:matrix-mode :projection)
(gl:load-identity)
(glu:ortho-2d 0 width 0 height))
(defun rb-movelight ()
(glut:display-window (make-instance 'movelight-window)))
;; create a display list for each of 6 characters
(gl:shade-model :flat)
(let ((base (gl:gen-lists 128)))
(gl:list-base base)
(loop for char in (list a e p r s) do
(gl:with-new-list ((+ base (char-code (car char))) :compile)
(draw-letter (cdr char))))
(gl:begin :line-strip)
(loop for (x y what) in instructions do
(case what
(pt (gl:vertex x y))
(stroke (gl:vertex x y)
(gl:end)
(gl:begin :line-strip))
(end (gl:vertex x y)
(gl:end)
(gl:translate 8 0 0)))))) | 3,882 | Common Lisp | .lisp | 104 | 30.932692 | 78 | 0.630568 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | f242573e37dcec6721ab43ec1b2aac360c350307887a3a29f766ce6907b62aa7 | 21,742 | [
-1
] |
21,743 | picking.lisp | rheaplex_minara/src/picking.lisp | ;; picking.lisp : minara scheme development file
;;
;; Copyright (c) 2004-2006, 2007 Rob Myers, [email protected]
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, write to the Free Software
;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
(in-package minara-picking)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Picking (object selection, highlighting, choosing, whatever)
;;
;; How does this work?
;;
;; Precis:
;; Count the shapes, hit-test the shapes, store the buffer positions that hit,
;; find the s-expressions that contain those buffer positions.
;;
;; Details:
;; We install a rendering protocol that counts the number of
;; occurrences of the (begin-path) operator.
;; This allows us to identify which shape is being drawn.
;;
;; We then count the number of intersections between a ray
;; from the target point and the result of evaluating each drawing command.
;; When we get to the end of a path, if the number of intersections
;; are odd the point is inside the shape so we push the current path number
;; onto a list.
;; This count indicates the number of the hit path. There may be more than one,
;; stored in Z-order.
;;
;; We then use the count to search the text for the relevent path description.
;;
;; This is slow, but we can cache a lot of the information and improve
;; performance.
;;
;; Note that picking returns a list of every item under the picking point
;; from back to front rather than just the frontmost object.
;; A normal "selection" tool can then disard everything apart from the topmost
;; object.
;;
;; Area-based selection will also be required and can be implemented similarly.
;; A point and a rectangle (or other shape eg pen-drawing based selection) are
;; just geometries to check for intersection or containment after all.
;;
;; This is all very single threaded. Attach the vars to the buffer being picked.
;;
;; And it's inefficient, having no optimization for bounding boxes for example
;; It is possible to generate, cache and update bounding boxes and other
;; optimizations (hashed to object counts) when editing the text, but this will
;; be done once the basic functionality is implemented.
;; Ideally we'd evaluate the buffer front-to-back. :-)
;; Nothing should be done or assumed to prevent the model of rebinding the
;; drawing routines to the picking routines then evaluating the drawing buffer
;; from working.
;;
;; For picking inside of functions e.g. (define (square) moveto...) ... (square)
;; Rebind define to keep track of the call stack, or can we get the stack from
;; Guile?
;; Picking inside of functions is a TODO.
;;
;; Note that we will not be able to pick every imaginable piece of code, eg
;; random scribbles that do not have their seed in the main buffer won't pick,
;; and code from over the network may be problematic.
;; So provide guidelines for producing pickable code.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; A picking hit
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defclass picking-hit ()
((index :accessor picking-hit-index
:initarg :index)
(from :accessor picking-hit-from
:initarg :from)
(to :accessor picking-hit-to
:initarg :to)
(transformation :accessor picking-hit-transformation
:initarg :transformation)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Globals
;; Used within a single pass through the picking routines
;; (so should be thread-local)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; The buffer string chopped to the end of the last matched sexp
;; RENAME
(defvar *previous-buffer-string* "")
;; The picking point
(defvar pick-x nil)
(defvar pick-y nil)
;; Where the last drawing operation left the pen
(defvar previous-x nil)
(defvar previous-y nil)
;; Keep track of which colour we're currently using
;; (We'll need to keep track of any other fill methods as well,
;; but we will never stroke, so we won't need to track that.)
(defvar current-colour nil)
;; Keep track of the current transformations
(defvar current-translate nil)
(defvar current-rotate nil)
(defvar current-scale nil)
(defvar transformation-stack (make-matrix-stack))
(defvar current-transform nil)
;; RENAME
;; Keep track of which polygon we're currently drawing
(defvar current-polygon 0)
;; Keep track of the last polygon so we can skip polys to speed up sexp matching
(defvar previous-polygon 0)
;; How many ray-line intersections there are with the current polygon
(defvar intersections 0)
;; RENAME
;; The list of polygons picked and their transforms. This will be back-to-front.
(defvar picked-polygons '())
;; Reset the picking state
(defun start-picking ()
(setf pick-x nil)
(setf pick-y nil)
(setf previous-x nil)
(setf previous-y nil)
(setf current-colour 0)
(setf current-polygon 0)
(setf previous-polygon 0)
(setf intersections 0)
(setf current-rotate 0)
(setf current-scale 0)
(setf current-translate 0)
(setf transformation-stack (make-matrix-stack))
(setf picked-polygons '()))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Picking protocol
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Keep track of the colour
(defun set-colour (r g b a)
(setf current-colour (+ current-colour 1)))
;; Keep track of the transforms
;; TODO: do it.
(defun push-matrix ()
(setf transformation-stack
(stack-push-matrix transformation-stack)))
(defun pop-matrix ()
(setf transformation-stack
(stack-pop-matrix transformation-stack)))
(defun concatenate-matrix (a b c d e f)
(setf transformation-stack
(stack-concatenate-matrix transformation-stack
(make-matrix a b c d e f))))
(defun set-matrix (a b c d e f)
(setf transformation-stack
(stack-set-matrix transformation-stack
(make-matrix a b c d e f))))
(defun identity-matrix ()
(setf transformation-stack
(stack-set-matrix transformation-stack
(identity-matrix))))
(defun translate (x y)
(setf transformation-stack
(stack-concatenate-matrix transformation-stack
(matrix-translate-make x y)))
(setf current-translate (+ current-translate 1)))
(defun scale (x y)
(setf transformation-stack
(stack-concatenate-matrix transformation-stack
(matrix-scale-make x y)))
(setf current-scale (+ current-scale 1)))
(defun rotate (theta)
(setf transformation-stack
(stack-concatenate-matrix transformation-stack
(matrix-rotate-make theta)))
(setf current-rotate (+ current-rotate 1)))
(defun transform (x y)
(matrix-point-transform x y (stack-current-matrix transformation-stack)))
;; Start a new pick pass
(defun path-begin ()
(setf intersections 0)
(setf current-polygon (+ current-polygon 1)))
;; Check the intersections. Even = inside, Odd = oustide
;; Store the colour and anything else in a list with the polygon number?
(defun path-end ()
(if (and (oddp intersections)
(not (= intersections
0)))
(setf picked-polygons
(cons
(get-picked-path)
picked-polygons)))
(setf intersections 0))
;; Keep track of the "previous" position
(defun move-to (xx yy)
(multiple-value-bind (x y) (picking-transform xx yy)
(setf previous-x x)
(setf previous-y y)))
;; Where to send the ray -uh- line to. Oh, the horror! Fixme.
(defparameter %ray-x 65535.0)
;; Line segment hit test
(defun line-to (xx yy)
(multiple-value-bind (x y) (picking-transform xx yy)
(if (lines-intersect-vertices previous-x
previous-y
x
y
pick-x
pick-y
%ray-x
pick-y)
(setf intersections (+ intersections
1)))
(setf previous-x x)
(setf previous-y y)))
;; Curve hit test
(defun curve-to (xx1 yy1 xx2 yy2 xx3 yy3)
(multiple-value-bind (x1 y1) (picking-transform xx1 yy1)
(multiple-value-bind (x2 y2) (picking-transform xx2 yy2)
(multiple-value-bind (x3 y3) (picking-transform xx3 yy3)
(let ((count (line-bezier-intersection-count-vertices
pick-x pick-y %ray-x pick-y
previous-x previous-y x1 y1 x2 y2 x3 y3)))
(setf previous-x x3)
(setf previous-y y3)
(setf intersections (+ intersections
count)))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Buffer routines
;; Find the positions in the buffer that match the s-expression that was
;; evaluated to draw a particular shape.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Find the index of the start of the nth occurrence of a phrase
(defun nth-occurrence (buffer phrase nth)
(nth-occurrence-aux buffer phrase nth 0 0))
(defun nth-occurrence-aux (buffer phrase target count position)
;; Terminal clause, return the value
(if (or (= target count)
;; Catch the error condition
(not position))
position
;; Otherwise search forward
(nth-occurrence-aux buffer phrase target (+ count 1)
;; +1 so we don't re-match the same string
(+ (string-contains buffer phrase position) 1))))
;; Get an s-expression from the ( at the character index given to the closing )
(defun sexp-bounds (buffer start)
(let ((end (sexp-bounds-aux buffer (+ start 1) 1)))
(values start end)))
;; Recursively find the end of the s-expression
(defun sexp-bounds-aux (buffer current count)
;; Terminal clause, return the value
(if (= count 0)
current
;; Otherwise we get the current char and check it
(let ((current-char (substring buffer current (+ current 1))))
(cond
((string= current-char "(")
(sexp-bounds-aux buffer (+ current 1) (+ count 1)))
((string= current-char ")")
(sexp-bounds-aux buffer (+ current 1) (- count 1)))
(else
(sexp-bounds-aux buffer (+ current 1) count))))))
;; Get an s-expression from the ) at the character index given to the opening (
(defun reverse-sexp-bounds (buffer start)
(let ((end (sexp-bounds-aux buffer (- start 1) 1)))
(values start end)))
;; Recursively find the beginning of the s-expression
(defun reverse-sexp-bounds-aux (buffer current count)
;; Terminal clause, return the value
(if (= count 0)
current
;; Otherwise we get the current char and check it
(let ((current-char (substring buffer current (- current 1))))
(cond
((string= current-char ")")
(sexp-bounds-aux buffer (- current 1) (+ count 1)))
((string= current-char "(")
(sexp-bounds-aux buffer (- current 1) (- count 1)))
(otherwise
(sexp-bounds-aux buffer (- current 1) count))))))
;; Get the nth sexp starting with the given operator
(defun nth-sexp-bounds (buffer operator count)
(let* ((op-with-bracket (string-append "(" operator))
(start (nth-occurrence buffer op-with-bracket count)))
(sexp-bounds buffer start)))
;; Get the nth colour statement in the buffer
(defun get-nth-sexp (buffer-str func nth)
(nth-sexp-bounds buffer-str func nth))
;; Get the nth path in the buffer
(defun get-nth-path (buffer nth)
(let ((path-from (- (nth-occurrence buffer
"(path-begin)" nth)
1))
;; 10 to move past "path-end"
(path-to (+ (nth-occurrence buffer
"(path-end)" nth) 10)))
(values path-from path-to)))
(defun sexp-before (buffer-str pos)
(let ((sexp-start (string-rindex buffer-str #\( 0 pos)))
(if sexp-start
(sexp-bounds buffer-str sexp-start)
nil)))
(defun sexp-after (buffer-str pos)
(let ((sexp-start (string-index buffer-str #\( pos)))
(if sexp-start
(sexp-bounds buffer-str sexp-start)
nil)))
(defun sexp-symbol-string (buffer-str sexp-pos)
(if (string= (substring buffer-str sexp-pos (+ sexp-pos 1))
"(")
(let ((symbol-end (or (string-index buffer-str #\space sexp-pos)
(string-index buffer-str #\) sexp-pos))))
(if symbol-end
(substring buffer-str
(+ sexp-pos 1 )
symbol-end)
nil))
nil))
(defun get-picked-path ()
(let* ((nnth (- current-polygon previous-polygon)))
(let-values (((path-from path-to)
(get-nth-path previous-buffer-string nnth)))
(setf previous-buffer-string (substring previous-buffer-string
path-to))
(setf previous-polygon current-polygon)
(make-picking-hit current-polygon
path-from
path-to
(copy-tree (stack-current-matrix
transformation-stack))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Picking in the main window buffer.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun set-picking-point (x y)
;; Translate?
(setf pick-x x)
(setf pick-y y))
(defun pick-paths (buf x y)
(install-picking-rendering-protocol)
(set-picking-point x y) ;; Translate?
(let ((buffer-string (buffer-to-string buf)))
(setf previous-buffer-string buffer-string)
(eval-string buffer-string))
(if (eq picked-polygons '())
nil
picked-polygons))
(defun pick-paths-window (win x y)
(pick-paths (window-buffer-main win) x y))
(defun pick-path (buf x y)
(let ((picks (pick-paths buf x y)))
(if picks
;; Return the range and transform
(last picks)
nil)))
(defun pick-path-window (win x y)
(pick-path (window-buffer-main win) x y))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; tests
;; Horribly tied to first minara logo file version. Need better checks...
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;(test-section "picking: s-expressions")
;;(defvar buf (find-file "../minara.minara"))
;;(test 105 (car (get-nth-path buf 1)))
;;(test 5025 (cadr (get-nth-path buf 1)))
;;(test 1063 (car (get-nth-sexp buf "move-to" 3)))
;;(test 1088 (cadr (get-nth-sexp buf "move-to" 3)))
;;(test-section "picking: picking")
;;(defvar %pickbuf (make-gap-buffer))
;;(gb-insert-string! %pickbuf
;; ";;minara file\n(set-colour 0.0 0.0 1.0)\n(path-begin)\n(move-to 10 10)\n(line-to 10 100)\n(line-to 100 10)\n(line-to 10 10)\n(path-end)\n(fill-path)\n")
;;(test 40 (begin
;; (install-picking-rendering-protocol)
;; (eval-string (gb->string %pickbuf)))) | 14,899 | Common Lisp | .lisp | 376 | 36.457447 | 163 | 0.654671 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 119f6eb69a9def6e99e26a7a67b9dcaf1d66dfbdfc5f88f087e035273421f139 | 21,743 | [
-1
] |
21,744 | events.lisp | rheaplex_minara/src/events.lisp | ;; events.lisp : gui event handling
;;
;; Copyright (c) 2004, 2007 Rob Myers, [email protected]
;;
;; This file is part of Minara.
;;
;; Minara is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; Minara is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Minara. If not, see <http://www.gnu.org/licenses/>.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Basic GUI and application events
;;
;; We receive events from the window system via the C code, which may have
;; done some setting up of the environment for us.
;;
;; We keep a list of handlers for each event, and call each in turn.
;;
;; People really *shouldn't* replace these functions, instead they should
;; use them to add and remove event hooks within the system set up here.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(in-package minara)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Quitting
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar *quit-funs* '())
(defun quit-hook ()
(dolist (fun *quit-funs*)
(funcall fun)))
(defun add-quit-hook (fun)
(if (not (member fun
*quit-funs*))
(setf *quit-funs*
(cons fun
*quit-funs*))))
(defun remove-quit-hook (fun)
(setf *quit-funs*
(remove fun
*quit-funs*)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Resizing
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar *resize-funs* '())
(defun resize-hook (win width height)
(dolist (fun *resize-funs*)
(funcall fun
win
width
height)))
(defun add-resize-hook (fun)
(if (not (member fun
*resize-funs*))
(setf *resize-funs*
(cons fun
*resize-funs*))))
(defun remove-resize-hook (fun)
(setf *resize-funs*
(remove fun
*resize-funs*)))
;; GLUT's window co-ords go down, OGL's go up.
;; So we need to allow for this
#|(defun update-window-dimensions (window width height)
(set-window-width window
width)
(set-window-height window
height))
(add-resize-hook #'update-window-dimensions)|#
(defun swizzle-y (win y)
(- (cl-glut:height win)
y))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Drawing
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar *draw-funs* '())
(defun draw-hook (win)
(dolist (fun *draw-funs*)
(funcall fun win)))
(defun add-draw-hook (fun)
(if (not (member fun
*draw-funs*))
(setf *draw-funs*
(cons fun
*draw-funs*))))
(defun remove-draw-hook (fun)
(setf *draw-funs*
(remove fun
*draw-funs*)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Mouse down
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar *mouse-down-funs* '())
(defun mouse-down-hook (win button x y)
(let ((yy (swizzle-y win
y)))
(dolist (fun *mouse-down-funs*)
(funcall fun
win
button
x
yy))))
(defun add-mouse-down-hook (fun)
(if (not (member fun
*mouse-down-funs*))
(setf *mouse-down-funs*
(cons fun
*mouse-down-funs*))))
(defun remove-mouse-down-hook (fun)
(setf *mouse-down-funs*
(remove fun
*mouse-down-funs*)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Mouse up
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar *mouse-up-funs* '())
(defun mouse-up-hook (win button x y)
(let ((yy (swizzle-y win
y)))
(dolist (fun *mouse-up-funs*)
(funcall fun
win
button
x
yy))))
(defun add-mouse-up-hook (fun)
(if (not (member fun
*mouse-up-funs*))
(setf *mouse-up-funs*
(cons fun
*mouse-up-funs*))))
(defun remove-mouse-up-hook (fun)
(setf *mouse-up-funs*
(remove fun
*mouse-up-funs*)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Mouse movement
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar *mouse-move-funs* '())
(defun mouse-move-hook (win x y)
(let ((yy (swizzle-y win
y)))
(dolist (fun *mouse-move-funs*)
(funcall fun
win
x
yy))))
(defun add-mouse-move-hook (fun)
(if (not (member fun
*mouse-move-funs*))
(setf *mouse-move-funs*
(cons fun
*mouse-move-funs*))))
(defun remove-mouse-move-hook (fun)
(setf *mouse-move-funs*
(remove fun
*mouse-move-funs*)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Key presses
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar *key-press-funs* '())
(defun key-press-hook (win key modifiers)
(dolist (fun *key-press-funs*)
(funcall fun
win
key
modifiers)))
(defun add-key-press-hook (fun)
(if (not (member fun
*key-press-funs*))
(setf *key-press-funs*
(cons fun
*key-press-funs*))))
(defun remove-key-press-hook (fun)
(setf *key-press-funs*
(remove fun
*key-press-funs*)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Key releases
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar *key-release-funs* '())
(defun key-release-hook (win key modifiers)
(dolist (fun *key-release-funs*)
(funcall fun
win
key
modifiers)))
(defun add-key-release-hook (fun)
(if (not (member fun
*key-release-funs*))
(setf *key-release-funs*
(cons fun
*key-release-funs*))))
(defun remove-key-release-hook (fun)
(setf *key-release-funs*
(remove fun
*key-release-funs*)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Menu Selection
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar *menu-select-funs* '())
(defun menu-select-hook (win menu-id)
(dolist (fun *menu-select-funs*)
(funcall fun
win
menu-id)))
(defun add-menu-select-hook (fun)
(if (not (member fun
*menu-select-funs*))
(setf *menu-select-funs*
(cons fun
*menu-select-funs*))))
(defun remove-menu-select-hook (fun)
(setf *menu-select-funs*
(remove fun
*menu-select-funs*)))
| 6,918 | Common Lisp | .lisp | 222 | 27.301802 | 79 | 0.489827 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | b15d5c8f5e0d17bb03b306bd1720a1ef3824c1578bad0ec00a58db678c509237 | 21,744 | [
-1
] |
21,745 | window.lisp | rheaplex_minara/src/window.lisp | ;; window.lisp : windows for minara
;;
;; Copyright (c) 2004, 2007 Rob Myers, [email protected]
;;
;; This file is part of Minara.
;;
;; Minara is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; Minara is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Minara. If not, see <http://www.gnu.org/licenses/>.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Windows (frames)
;; Documents are attached to a single window at the moment.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(in-package minara)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Constants
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defparameter *window-width* 600)
(defparameter *window-height* 400)
(defparameter *untitled-window-name* "Untitled")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Globals
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; The list of windows
(defvar *windows* (make-hash-table :size 31))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Window objects
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; The window record
(defclass window (glut:window)
((buffers :initarg :buffers
:accessor window-buffers
:initform '())
(status :initarg :status
:accessor window-status
:initform "")
(undo-stack :initarg :undo-stack
:accessor window-undo-stack
:initform '()))
(:default-initargs :width *window-width* :height *window-height*
:pos-x 100 :pos-y 100
:mode '(:single :rgb) :title *untitled-window-name*))
;; Set the title
(defun set-window-title (window title)
(glut:set-window-title window title))
;; Utility constructor
#|(define (%make-window)
;; Window must be made before any display lists (MacOSX)!
(let ((window
(really-make-window
(window-make $window-width $window-height)
'()
-1
-1
""
'())))
(hash-create-handle! *windows* (window-id window) window)
;; Redraw timestamp
(initialise-timestamp! window)
c
;; Buffers *under* the main buffer, created bottom to top
;; Ask before adding anything here
(window-view-buffer-make window)
;; Return the window
window))
|#
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Window Buffers
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; We assume that assoc lists will keep their order
;; Get window buffer
(defun window-buffer (window name)
(cdr (assoc name (window-buffers window))))
;; Get main window buffer
(defun window-buffer-main (window)
(window-buffer window '_main))
;; Add window buffer
;; We add buffers to the end of the list so we draw newer buffers last
;; This means doing our own assoc-set equivalent
(defun add-window-buffer (window buffer-name buffer)
(if (not (window-buffer window buffer-name))
(setf (window-buffers window)
(append (list (cons buffer-name buffer))
(window-buffers window)))))
(defun make-window-buffer (window buffer-name)
(let ((buf (make-instance 'buffer)))
(add-window-buffer window buffer-name buf)
buf))
(defun ensure-window-buffer (window buffer-name)
(let ((maybe-buffer (window-buffer window buffer-name)))
(or maybe-buffer
(make-window-buffer window buffer-name))))
;; Remove window buffer
(defun remove-window-buffer (window name)
(setf (window-buffers window)
(remove-if (lambda (candidate) (eq (car candidate) name))
(window-buffers window))))
;; Get the main buffer path
(defun window-buffer-path (window)
(buffer-file-path (window-buffer-main window)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Window Title
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Get the window filename
(defun window-name-base (win)
(let ((buf-path (buffer-file-path (window-buffer-main win))))
(if (not buf-path)
*untitled-window-name*
(subseq buf-path
0
(- (length buf-path)
(length ".minara"))))))
;; Set a window title bar information
(defun set-window-title-info (win info)
(minara-window-set-title (concatenate 'string (window-name-base win)
"[" info "]")))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Window Drawing
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Flag a window as needing redrawing
(defun window-redraw (win)
(minara-window-invalidate (glut:id win)))
;; Draw the window, rebuilding buffer caches as needed
(defun window-draw (cb)
;; Check timestamps, short circuiting on the first earlier than the window
;; If the window cache is more recent than the buffer timestamps
;; (install-window-rendering-protocol)
;; (minara-rendering:push-matrix)
(minara-rendering:rendering-begin)
(dolist (buf-cons (window-buffers cb))
(let ((buf (cdr buf-cons)))
(draw-buffer buf)))
(minara-rendering:rendering-end))
;; Draw or redraw a window's buffers/caches
(defgeneric window-redraw-event (window &optional prefix))
(defmethod window-redraw-event (window &optional (prefix ""))
(minara-window-draw-begin window)
(window-draw window)
;; Should be set status, like set title. But needs faking in GLUT...
(minara-window-draw-status (concatenate 'string
prefix
(window-status window)))
(minara-window-draw-end window))
(add-draw-hook #'window-redraw-event)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Window construction & loading buffers
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Public constructors
(defgeneric make-window ())
(defmethod make-window ()
(let ((win (make-instance 'window)))
;; Main buffer
(make-window-buffer win '_main)
;; Set title
(set-window-title win *untitled-window-name*)
win))
(defgeneric make-window-from-file (file-path))
(defmethod make-window-from-file (file-path)
(let* ((win (make-instance 'window)))
;; Main buffer from file
(add-window-buffer win '_main (make-buffer-from-file file-path))
;; Set title
;; (set-window-title win (window-name-base win))
win))
;; Reload the document buffer
(defun reload-window-buffer (window)
(let ((main (window-buffer-main window)))
(when (< (buffer-file-timestamp main)
(file-write-date (window-buffer-path window)))
(reload-buffer-file main)
(window-redraw window))))
;;(window-status-temporary window
;; "Buffer changed, not reloaded!"
;; 2))))
(defun reload-current-window ()
(reload-window-buffer (window-current)))
(keymap-add-fun *global-keymap* #'reload-current-window "x" "r")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Window Saving
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Find whether a buffer has ever been saved
(defun buffer-has-file-p (buf)
(not (eq (buffer-file-path buf) nil)))
;; Find whether a buffer has changed
(defun buffer-changed-since-load-p (buf)
(if (not (buffer-file-path buf))
nil
(buffer-changed buf)))
;; Get the file path for a window
;; Save a window buffer, updating the timestamp
(defun save-window (win)
(let* ((file-buffer (buffer-gap-buffer (window-buffer-main win)))
(file-path (buffer-file-path file-buffer)))
(if (not file-path)
(error "Trying to save buffer with no associated file")
(if (buffer-changed-since-load-p file-buffer)
(let ((backup-path (concatenate 'string file-path "~")))
(rename-file file-path backup-path)
(write-buffer-to-file file-buffer file-path))))))
;; Save the current frontmost window
(defun save-current-window ()
(save-window (window-current)))
;; Register keys for saving a window
(keymap-add-fun *global-keymap* #'save-current-window "x" "s")
;; Close a window safely, prompting user and saving if changed
;(define (close-window-event win)
; (save-window win))
;; Ask the user if they want to close the window, and if so whether to save
;(define (prompt-user-if-changed win)
;; IMPLEMENT ME
; 'just-close)
;; Close the frontmost window
;(define (close-current-window)
; (let ((current-window ((window-for-id (window-current)))))
; (case (prompt-user-if-changed)
; ('save-and-close (save-window current-window)
; (close-window current-window))
; ('just-close
; (close-window current-window)))))
;; Register keys for closing a window
;(keymap-add-fun %global-keymap close-current-window "x" "c")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Window External editor
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Edit the window's main buffer in an external editor
(defparameter *default-external-edit-command*
"/usr/bin/open -a /Applications/TextEdit.app")
(defvar *external-edit-command* *default-external-edit-command*)
(defun external-edit-file (path)
#|(system (concatenate 'string *external-edit-command*
" "
path
" &"))|#
(format t "Should open ~a in Emacs.~%" path))
(defun external-edit-window (window)
;; TODO: Warn user if unsaved!!!!!
(save-window window)
(external-edit-file (window-buffer-path window)))
;; Edit the current frontmost window
(defun external-edit-current-window ()
(external-edit-window (window-current)))
;; Register keys for editing a window
(keymap-add-fun *global-keymap* #'external-edit-current-window "x" "e")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Window status line
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Set the status temporarily
;; Needs threads, so fix later
;; Or convert to installing/uninstalling mouse event handler
(defun window-status-temporary (window status duration)
(declare (ignore window) (ignore status) (ignore duration)))
#| (let ((old-status (window-status window)))
(set-window-status window
status)
(window-redraw (window-id window))
(begin-thread
(lambda ()
(sleep duration)
(if (string= status
(window-status window))
(begin
(set-window-status! window
old-status)
(window-redraw (window-id window))))))))|#
| 11,355 | Common Lisp | .lisp | 273 | 37.278388 | 80 | 0.572417 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | f4bc4163c466faa6d9ddaa49cd8b931f7d9a9c050ea18eceea8ca574e8b6b4a1 | 21,745 | [
-1
] |
21,746 | pen-tool.lisp | rheaplex_minara/src/pen-tool.lisp | ;; pen-tool.lisp : the pen tool
;;
;; Copyright (c) 2004, 2007 Rob Myers, [email protected]
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, write to the Free Software
;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; This is a simple scribble tool for testing during initial development.
;; It should be renamed "scribble" and replaced with a real pen tool.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar $path-end "(path-end)\n")
(defvar $path-end-length (string-length $path-end))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Keep track of the mouse button state
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar pen-tool-mouse-down nil)
;; When the button is pressed, make and initialise the pen drawing buffers
(defun begin-drawing (window x y)
(let ((pen-buffer (make-window-buffer window
"pen")))
(window-undo-stack-push window
pen-buffer)
(write-current-colour pen-buffer)
(buffer-insert-undoable pen-buffer
nil
(format nil
"(path-begin)~%(move-to ~a ~a)~%"
(window-view-x window x)
(window-view-y window y)))
(buffer-insert-undoable pen-buffer
nil
$path-end)
(buffer-undo-mark pen-buffer)))
(defun pen-mouse-down (win button x y)
(begin-drawing win x y)
(setf pen-tool-mouse-down t))
;; When the mouse is dragged, add the new co-ordinate to the drawing buffer
;; And redraw the pen drawing buffers
(defun draw-point (window x y)
(let ((pen-buffer (window-buffer window
"pen")))
;; Remove the previous path-end
(buffer-delete-undoable pen-buffer
(- (buffer-end pen-buffer)
$path-end-length)
$path-end-length)
(buffer-insert-undoable pen-buffer
nil
(format nil
"(line-to ~a ~a)~%"
(window-view-x window x)
(window-view-y window y)))
(buffer-insert-undoable pen-buffer
nil
$path-end)
(buffer-undo-mark pen-buffer)
(buffer-invalidate pen-buffer)
(window-redraw window)))
(defun pen-mouse-move (win x y)
(if pen-tool-mouse-down
(draw-point win x y)))
;; When the mouse is released, add the pen drawing buffers to the main buffer
;; Redraw the main buffer, and release the pen drawing buffers
(defun end-drawing (window)
(let ((buff (window-buffer window
"pen"))
(main-buff (window-buffer-main window)))
(buffer-insert-undoable main-buff
nil
(buffer-to-string buff))
(buffer-undo-mark main-buff)
(window-undo-stack-pop window)
;; Clean up and redraw
(remove-window-buffer window
"pen")
(buffer-invalidate (window-buffer-main window))
(window-redraw window)))
(defun pen-mouse-up (win button x y)
(end-drawing win)
(setf pen-tool-mouse-down nil))
;; Install
(defun pen-tool-install ()
(add-mouse-move-hook pen-mouse-move)
(add-mouse-down-hook pen-mouse-down)
(add-mouse-up-hook pen-mouse-up))
;; Uninstall
(defun pen-tool-uninstall ()
(remove-mouse-move-hook pen-mouse-move)
(remove-mouse-down-hook pen-mouse-down)
(remove-mouse-up-hook pen-mouse-up))
;; Register
(install-tool pen-tool-install
pen-tool-uninstall
"Simple Pen"
"t" "p")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Polyline
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; TODO:
;; Show first click as point
;; Show second click as line
;; Then show other clicks as poly
(defun polyline-timestamp (window)
(let ((buffer (window-buffer window
"pen")))
(if buffer
(buffer-variable buffer
"polyline-timestamp")
nil)))
(defun update-polyline-timestamp (window)
(let ((buffer (window-buffer window
"pen")))
(if buffer
(set-buffer-variabl buffer
"polyline-timestamp"
(get-internal-real-time)))))
(defun polyline-begin-drawing (win button x y)
(begin-drawing win x y)
(update-polyline-timestamp win))
(defun polyline-draw (win button x y)
(draw-point win x y)
(update-polyline-timestamp win))
(defun polyline-finish-drawing (win)
(end-drawing win))
(defun polyline-mouse-up (win button x y)
(let ((last-time (polyline-timestamp win)))
(if (not last-time)
(polyline-begin-drawing win button x y)
(let* ((now (get-internal-real-time))
(delta (- now
last-time)))
;; If it's not a double-click, then draw
(if (> (/ delta
internal-time-units-per-second)
0.25)
(polyline-draw win button x y)
(polyline-finish-drawing win))))))
;; Install
(defun polyline-tool-install ()
(add-mouse-up-hook polyline-mouse-up))
;; Uninstall
(defun polyline-tool-uninstall ()
(let ((win (window-current)))
(if (polyline-timestamp win)
(polyline-finish-drawing win)))
(remove-mouse-up-hook polyline-mouse-up))
;; Register
(install-tool polyline-tool-install
polyline-tool-uninstall
"Polyline"
"t" "P") | 6,511 | Common Lisp | .lisp | 162 | 30.981481 | 79 | 0.54639 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 258907287b51b6c5e616537857c59279cebfc601390a7949651fea92a28b6b82 | 21,746 | [
-1
] |
21,747 | colour-tools.lisp | rheaplex_minara/src/colour-tools.lisp | ;; colour-tools.lisp : minara colour picking
;;
;; Copyright (c) 2007 Rob Myers, [email protected]
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, write to the Free Software
;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
(in-package minara)
;; Colour support
(defvar current-colour "(set-colour 0.0 0.0 0.0 0.0)")
(defun write-current-colour (buff)
(buffer-insert-undoable buff
nil
(format nil
"~a~%"
current-colour)))
;; RGB
(defvar rgb-minor-amount 0.01)
(defvar rgb-major-amount 0.1)
(defvar rgb-current-r 0.0)
(defvar rgb-current-g 0.0)
(defvar rgb-current-b 0.0)
(defvar rgb-current-a 0.0)
(defvar rgb-current-component 'r)
(defun rgb-current-string ()
(format nil
"(set-colour ~f ~f ~f ~f)"
rgb-current-r
rgb-current-g
rgb-current-b
rgb-current-a))
(defun set-rgb-current-colour ()
(setf current-colour
(rgb-current-string)))
#|(defun rgb-set-component (component to)
(cond
((> to
1.0)
(rgb-set-current-component
1.0))
((< to
0.0)
(rgb-set-current-component
0.0))
(t
(rgb-set-current-component
to))))|#
(defun rgb-current-component ()
(case rgb-current-component
('r rgb-current-r)
('g rgb-current-g)
('b rgb-current-b)
('a rgb-current-a)))
(defun rgb-set-current-component (to)
(case %rgb-current-component
('r (setf rgb-current-r to))
('g (setf rgb-current-g to))
('b (setf rgb-current-b to))
('a (setf rgb-current-a to))))
(defun rgb-current-status-update (window)
(minara-window-draw-status window
(format nil
"- Red: ~f Green: ~f Blue: ~f Alpha: ~f"
rgb-current-r
rgb-current-g
rgb-current-b
rgb-current-a)))
(defun rgb-current-buffer-make (window)
(make-window-buffer window
"rgb"))
(defun rgb-current-buffer-destroy (window)
(remove-window-buffer window
"rgb"))
(defun rgb-current-buffer (window)
(window-buffer window
"rgb"))
(defun rgb-current-sample-update (window)
(let ((buff (rgb-current-buffer window)))
(buffer-erase buff)
(buffer-insert-undoable buff
nil
(rgb-current-string))
(buffer-insert-undoable buff
nil
"(push-matrix)\n(identity-matrix)\n")
(buffer-insert-undoable buff
nil
"(path-begin)\n(move-to 10 40)\n(line-to 10 90)\n (line-to 60 90)\n(line-to 60 40)\n(path-end)\n")
(buffer-insert-undoable buff
nil
"(pop-matrix)\n")
(buffer-undo-mark buff)
(buffer-invalidate buff)))
(defun rgb-current-refresh()
(let ((window (window-current))) ;; Update for multi-window
(rgb-current-status-update window)
(rgb-current-sample-update window)
(window-redraw window)))
(defun rgb-update-current-component (to)
(rgb-set-current-component to)
(rgb-current-refresh))
(defun rgb-add-current-component (to)
(rgb-set-current-component (+ (rgb-current-component)
to)))
;; The tool's keymap
(defvar %rgb-keymap (make-keymap))
;; Install/uninstall the tool
(defun rgb-current-tool-install ()
(let ((window (window-current)))
(rgb-current-buffer-make window)
(keymap-current-root-set %rgb-keymap)
(rgb-current-refresh)))
(defun rgb-current-tool-uninstall ()
(let ((window (window-current)))
(set-rgb-current-colour)
(keymap-current-root-reset)
(set-window-status window
"")
(rgb-current-buffer-destroy window)
(window-redraw window)))
;; Key presses
(keymap-add-fun %rgb-keymap
(lambda ()
(setf rgb-current-component 'r))
"r")
(keymap-add-fun %rgb-keymap
(lambda ()
(setf rgb-current-component 'g))
"g")
(keymap-add-fun %rgb-keymap
(lambda ()
(setf rgb-current-component 'b))
"b")
(keymap-add-fun %rgb-keymap
(lambda ()
(set rgb-current-component 'a))
"a")
(keymap-add-fun %rgb-keymap
(lambda ()
(rgb-add-current-component rgb-minor-amount))
"=")
(keymap-add-fun %rgb-keymap
(lambda ()
(rgb-add-current-component rgb-major-amount))
"+")
(keymap-add-fun %rgb-keymap
(lambda ()
(rgb-add-current-component (- rgb-minor-amount)))
"-")
(keymap-add-fun %rgb-keymap
(lambda ()
(rgb-add-current-component (- rgb-major-amount)))
"_")
(keymap-add-fun %rgb-keymap
(lambda ()
(rgb-update-current-component 0.0))
"0")
(keymap-add-fun %rgb-keymap
(lambda ()
(rgb-update-current-component 0.1))
"1")
(keymap-add-fun %rgb-keymap
(lambda ()
(rgb-update-current-component 0.2))
"2")
(keymap-add-fun %rgb-keymap
(lambda ()
(rgb-update-current-component 0.3))
"3")
(keymap-add-fun %rgb-keymap
(lambda ()
(rgb-update-current-component 0.4))
"4")
(keymap-add-fun %rgb-keymap
(lambda ()
(rgb-update-current-component 0.5))
"5")
(keymap-add-fun %rgb-keymap
(lambda ()
(rgb-update-current-component 0.6))
"6")
(keymap-add-fun %rgb-keymap
(lambda ()
(rgb-update-current-component 0.7))
"7")
(keymap-add-fun %rgb-keymap
(lambda ()
(rgb-update-current-component 0.8))
"8")
(keymap-add-fun %rgb-keymap
(lambda ()
(rgb-update-current-component 0.9))
"9")
(keymap-add-fun %rgb-keymap
(lambda ()
(rgb-update-current-component 1.0))
"!")
(keymap-add-fun %rgb-keymap
#'rgb-current-tool-uninstall
"q")
;; Register
(install-tool #'rgb-current-tool-install
#'rgb-current-tool-uninstall
"RGB"
"c" "r") | 7,234 | Common Lisp | .lisp | 215 | 23.883721 | 126 | 0.547059 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | e9cd56d9d163112cff1044dd7f5ab6a58cbeadeb4e0efaa5c5a6140d6e4cbf6c | 21,747 | [
-1
] |
21,748 | glut-gui.lisp | rheaplex_minara/src/glut-gui.lisp |
(in-package minara)
;; Menus
(defvar *main-menu* (glut:create-menu (cffi:null-pointer)))
(cffi:defcallback minara-menu-select-callback :void ((value :int))
(menu-select-hook value))
(defun minara-menu-make ()
(let ((id (glut:create-menu (cffi:callback minara-menu-select-callback))))
(glut:set-menu *main-menu*)
id))
(defun minara-menu-install (menu-id title)
(glut:set-menu *main-menu*)
(glut:add-sub-menu title menu-id))
(defun minara-menu-add-entry (menu-id entry-name entry-id)
(glut:set-menu menu-id)
(glut:add-menu-entry entry-name entry-id)
(glut:set-menu *main-menu*))
(defun minara-menu-remove-entry (id)
(glut:remove-menu-item id))
;; Windows
;(defun window-for-id (id)
; (aref cl-glut::*id->window* id))
(defun window-current ()
(glut:get-window))
(defun glut-window-set (win)
(when (\= win 0)
(glut:set-window win)))
(defun window-height (win)
(glut:height win))
(defun window-width (win)
(glut:width win))
;;(defun minara-window-make (width height))
(defmethod glut:display ((w window))
(draw-hook w))
(defmethod glut:reshape ((w window) width height)
(gl:viewport 0 0 width height)
(gl:matrix-mode :projection)
(gl:load-identity)
(glu:ortho-2d 0.0 width 0.0 height)
(gl:matrix-mode :modelview)
(gl:load-identity)
(resize-hook w width height))
(defmethod glut:passive-motion ((w window) x y)
(mouse-move-hook w x y))
(defmethod glut:motion ((w window) x y)
(mouse-move-hook w x y))
(defmethod glut:keyboard ((w window) key x y)
(let ((modifiers (glut:get-modifier-values)))
(key-press-hook (string key) modifiers)))
(defmethod glut:keyboard-up ((w window) key x y)
(let ((modifiers (glut:get-modifier-values)))
(key-release-hook w (string key) modifiers)))
(defmethod glut:mouse ((w window) button state x y)
(if (eq state :up)
(mouse-up-hook w
(case button
(:left-button 1)
(:middle-button 2)
(otherwise 3)) ;; GLUT_RIGHT_BUTTON
x
y)
(mouse-down-hook w
(case button
(:left-button 1)
(:middle-button 2)
(otherwise 3)) ;; GLUT_RIGHT_BUTTON
x
y)))
(defmethod glut:menu-state ((w window) id)
(menu-select-hook w id))
(defun minara-window-invalidate (win)
(glut:post-window-redisplay win))
(defun minara-window-set-title (win title)
(setf (glut:title win)
title))
(defun minara-window-draw-status (text)
(gl:push-matrix)
;; De-hardcode all this!
(gl:color 0.9 0.8 0.8)
(gl:raster-pos 5.2 4.8)
(loop for c across text
do (glut:bitmap-character glut:+bitmap-helvetica-12+ (char-int c)))
(gl:color 0.1 0.1 0.25)
(gl:raster-pos 5.0 5.0)
(loop for c across text
do (glut:bitmap-character glut:+bitmap-helvetica-12+ (char-int c)))
;; End de-hardcode
(gl:pop-matrix))
(defun minara-window-draw-begin (win)
(declare (ignore win))
(gl:shade-model :flat)
(gl:disable :dither)
(gl:disable :depth-test)
(gl:clear-color 1.0 1.0 1.0 1.0)
(gl:clear :color-buffer-bit))
(defun minara-window-draw-end (win)
(declare (ignore win))
(gl:flush)
(glut:swap-buffers))
(defgeneric display-window (glut:window))
(defmethod display-window ((win window))
(glut:display-window win)) | 3,218 | Common Lisp | .lisp | 101 | 28.346535 | 76 | 0.682216 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | d905678f665940fbaee81412f3d18f33369b81fee7edf607e484d5df824e69d9 | 21,748 | [
-1
] |
21,749 | undo.lisp | rheaplex_minara/src/undo.lisp | ;; undo.lisp : undo and redo support for minara
;;
;; Copyright (c) 2004,2007 Rob Myers, [email protected]
;;
;; This file is part of Minara.
;;
;; Minara is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; Minara is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Minara. If not, see <http://www.gnu.org/licenses/>.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Undo/redo
;; Memoization-based.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(in-package minara)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Buffer-level undo handling
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; The undo class
;; A linked list node containing an undo and redo method for the action
(defclass undoer ()
((undo :initarg :undo
:accessor undoer-undo)
(redo :initarg :redo
:accessor undoer-redo)
(next :initarg :next
:accessor undoer-next)
(previous :initarg :previous
:accessor undoer-previous)))
;; Get the buffer undo stack
(defun buffer-undo-stack (buffer)
(buffer-variable buffer "undo-stack"))
(defun set-buffer-undo-stack (buffer new-stack)
(set-buffer-variable buffer
"undo-stack"
new-stack))
;; Push the undo/redo methods & double link them into the undo list
(defun buffer-undo-stack-push (buffer undo redo)
(let* ((current-undo (buffer-undo-stack buffer))
(new-undo (make-instance 'undoer
:undo undo
:redo redo
:next current-undo
:previous nil)))
(if (not (eq current-undo nil))
(setf (undoer-next current-undo)
new-undo))
(set-buffer-undo-stack buffer
new-undo)))
;; Placed at the bottom of / before a series of events
;; When we undo to this, it makes the *next* item the current undo & stop
;; When we redo to it, it makes the *previous* item the current undo & stop
(defun buffer-undo-mark (buffer)
(buffer-undo-stack-push buffer nil nil))
(defun create-buffer-undo-stack (buffer)
(set-buffer-undo-stack buffer '())
(buffer-undo-mark buffer) ;; Make sure there's a mark at the bottom
(buffer-variable buffer '_undo-stack))
;; Add an undo stack to every buffer when it is made
(defmethod initialize-instance :after ((b buffer) &rest initargs &key)
(declare (ignore initargs))
(create-buffer-undo-stack b)
b)
;; Undo the buffer until we hit the next mark or the end of the undo list
(defun buffer-undo-aux (buffer undos)
(let ((undo (undoer-undo undos))
(previous (undoer-previous undos)))
(if undo ;; If we haven't hit the next mark down
(progn
(funcall undo) ;; Call the undo action
(buffer-undo-aux buffer ;; Then recurse
previous))
(progn ;; If there isn't an undo it's a mark
(set-buffer-undo-stack buffer ;; So set current to mark
undos)
(buffer-invalidate buffer)))))
(defun buffer-undo (buffer)
(let* ((undos (buffer-undo-stack buffer)) ;; Get mark at top of stack
(previous (undoer-previous undos))) ;; Get previous undo (or nil)
(if (not (eq previous nil)) ;; If we are not at the base of the undo stack
(buffer-undo-aux buffer ;; Move past the mark and start undoing
previous))))
;; Redo the buffer until we hit the next mark or the beginning of the undo list
(defun buffer-redo-aux (buffer redos)
(let ((redo (undoer-redo redos))
(next (undoer-next redos)))
(if redo ;; If we haven't hit the next mark up
(progn
(funcall redo) ;; Call the redo action
(buffer-redo-aux buffer ;; Then recurse
next))
(progn ;; If there isn't a redo it's a mark
(set-buffer-undo-stack buffer ;; So set current to mark
redos)
(buffer-invalidate buffer)))))
(defun buffer-redo (buffer)
(let* ((undos (buffer-undo-stack buffer)) ;; Get the redos
(redos (undoer-next undos))) ;; Get redo after current undo
(if (not (eq redos nil)) ;; If it exists
(buffer-redo-aux buffer
redos))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Buffer undoable actions
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Set a variable in an undoable way
(defun buffer-variable-set-undoable (buffer variable-name value)
(let ((old-value (buffer-variable buffer variable-name)))
(buffer-undo-stack-push buffer
(lambda ()
(set-buffer-variable buffer
variable-name
old-value))
(lambda ()
(set-buffer-variable buffer
variable-name
value))))
(set-buffer-variable buffer variable-name value))
;; Insert text into a buffer.
(defun buffer-insert-undoable (buffer pos text)
(let ((position (or pos
(buffer-end (buffer-gap-buffer buffer))))
(text-length (length text)))
(buffer-undo-stack-push buffer
(lambda ()
(buffer-delete-no-undo buffer
position
text-length))
(lambda ()
(buffer-insert-no-undo buffer
position
text)))
(buffer-insert-no-undo buffer position text)))
;; Delete text from a buffer
(defun buffer-delete-undoable (buffer pos len)
(let* ((position (or pos
(buffer-start (buffer-gap-buffer buffer))))
(text (buffer-range-to-string buffer position (+ position len))))
(buffer-undo-stack-push buffer
(lambda ()
(buffer-insert-no-undo buffer position text))
(lambda ()
(buffer-delete-no-undo buffer position len)))
(buffer-delete-no-undo buffer position len)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Window-level undo handling
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Set a buffer as the current undo target: user calls for undo will target it
(defun window-undo-stack-push (window buffer)
(push buffer
(window-undo-stack window)))
;; Set the undo target to the previous one (possibly none)
(defun window-undo-stack-pop (window)
(pop (window-undo-stack window)))
;; Ask the window to get its current undo target to undo
(defun window-undo (window)
(let ((current-undo-buffer (car (window-undo-stack window))))
(if current-undo-buffer
(buffer-undo current-undo-buffer))))
;; Ask the window to get its current undo target to redo
(defun window-redo (window)
(let ((current-undo-buffer (car (window-undo-stack window))))
(if current-undo-buffer
(buffer-redo current-undo-buffer))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Hook into window creation
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defmethod make-window :around ()
(let ((win (call-next-method)))
(window-undo-stack-push win
(window-buffer-main win))
win))
(defmethod make-window-from-file :around (file-path)
(let ((win (call-next-method)))
(window-undo-stack-push win
(window-buffer-main win))
win))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Keymap
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun call-window-undo ()
(let ((win (window-current)))
(window-undo win)
(window-redraw win)))
(keymap-add-fun *global-keymap*
#'call-window-undo
"z")
(defun call-window-redo ()
(let ((win (window-current)))
(window-redo win)
(window-redraw win)))
(keymap-add-fun *global-keymap*
#'call-window-redo
"Z")
| 8,835 | Common Lisp | .lisp | 201 | 35.487562 | 79 | 0.543463 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 4409058058738a71a738139c3ee2bd5df2ca62be6b16cfb7f4a32a530b9db63c | 21,749 | [
-1
] |
21,750 | buffer-stream.lisp | rheaplex_minara/src/buffer-stream.lisp | ;; buffer-stream.lisp : buffer streams and file loading/saving for minara
;;
;; Derived from buffer-stream.lisp from Drei
;; http://common-lisp.net/cgi-bin/viewcvs.cgi/mcclim/Drei/buffer-streams.lisp
;;; (c) copyright 2006-2007 by
;;; Troels Henriksen ([email protected])
;;
;; Additions and alterations Copyright (c) 2007 Rob Myers, [email protected]
;;
;; This file is part of Minara.
;;
;; Minara is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; Minara is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Minara. If not, see <http://www.gnu.org/licenses/>.
(in-package minara)
(defclass buffer-stream (fundamental-character-input-stream
fundamental-character-output-stream)
((%buffer :initarg :buffer
:initform (error "A buffer must be provided")
:reader buffer
:documentation "The buffer from which this stream
will read data.")
(%start-mark :initarg :start-mark
:reader start-mark
:documentation "A mark into the buffer of the
stream that indicates from which point on the stream will read
data from the buffer. By default, the beginning of the
buffer. This mark should not be changed.")
(%end-mark :initarg :end-mark
:reader end-mark
:documentation "A mark into the buffer of the
stream that indicates the buffer position that the stream will
consider end-of-file. By default, the end of the buffer. This
mark should not be changed.")
(%point :accessor point-of
:documentation "A mark indicating the current position
in the buffer of the stream."))
(:documentation "A bidirectional stream that performs I/O on an
underlying Drei buffer. Marks can be provided to let the stream
operate on only a specific section of the buffer."))
(defmethod initialize-instance :after
((stream buffer-stream) &key)
(unless (slot-boundp stream '%start-mark)
(setf (slot-value stream '%start-mark)
(clone-mark (point-of (buffer stream)) :left))
(flexichain:at-beginning-p (start-mark stream)))
(unless (slot-boundp stream '%end-mark)
(setf (slot-value stream '%end-mark)
(clone-mark (start-mark stream) :right))
(flexichain:at-end-p (end-mark stream)))
(setf (point-of stream)
(narrow-mark (clone-mark (start-mark stream) :right)
(start-mark stream)
(end-mark stream))))
;;; Input methods.
(defmethod stream-read-char ((stream buffer-stream))
(if (flexichain:at-end-p (point-of stream))
:eof
(prog1 (flexichain:element> (point-of stream))
(forward-object (point-of stream)))))
(defmethod stream-unread-char ((stream buffer-stream) (char character))
(unless (flexichain:at-beginning-p (point-of stream))
(flexichain:element< (point-of stream))
nil))
(defmethod stream-read-char-no-hang ((stream buffer-stream))
(stream-read-char stream))
(defmethod stream-peek-char ((stream buffer-stream))
(if (flexichain:at-end-p (point-of stream))
:eof
(flexichain:element> (point-of stream))))
(defmethod stream-listen ((stream buffer-stream))
(not (flexichain:at-end-p (point-of stream))))
(defmethod stream-read-line ((stream buffer-stream))
(let ((orig-offset (offset (point-of stream)))
(end-of-line-offset (offset (end-of-line (point-of stream)))))
(unless (flexichain:at-end-p (point-of stream))
(forward-object (point-of stream)))
(values (buffer-substring (buffer stream)
orig-offset
end-of-line-offset)
(end-of-buffer-p (point-of stream)))))
(defmethod stream-clear-input ((stream buffer-stream))
nil)
;;; Output methods.
(defmethod stream-write-char ((stream buffer-stream) char)
(flexichain:insert (point-of stream) char))
(defmethod stream-line-column ((stream buffer-stream))
(column-number (point-of stream)))
(defmethod stream-start-line-p ((stream buffer-stream))
(or (eq (point-of stream)
(start-mark stream))
(beginning-of-line-p (point-of stream))))
(defmethod stream-write-string ((stream buffer-stream) string
&optional (start 0) end)
(flexichain:insert-sequence (point-of stream)
(subseq string start end)))
(defmethod stream-terpri ((stream buffer-stream))
(flexichain:insert (point-of stream) #\Newline))
(defmethod stream-fresh-line ((stream buffer-stream))
(unless (stream-start-line-p stream)
(stream-terpri stream)))
(defmethod stream-finish-output ((stream buffer-stream))
(declare (ignore stream))
nil)
(defmethod stream-force-output ((stream buffer-stream))
(declare (ignore stream))
nil)
(defmethod stream-clear-output ((stream buffer-stream))
(declare (ignore stream))
nil)
(defmethod stream-advance-to-column ((stream buffer-stream) (column integer))
(call-next-method))
(defmethod interactive-stream-p ((stream buffer-stream))
nil)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Interface functions.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun make-flexichain-stream (&key (buffer (current-buffer))
(start-mark nil start-mark-p)
(end-mark nil end-mark-p))
(apply #'make-instance 'buffer-stream
:buffer buffer
(append (when start-mark-p
(list :start-mark start-mark))
(when end-mark-p
(list :end-mark end-mark)))))
(defun make-buffer-stream (buffer)
(make-instance 'buffer-stream
:buffer buffer))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Buffer from stream
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun set-buffer-file-timestamp (buffer timestamp)
(set-buffer-variable buffer '_t timestamp))
(defun buffer-file-timestamp (buffer)
(buffer-variable buffer '_t))
;; The file path for a buffer than has been loaded from file
(defun set-buffer-file-path (buf filename)
(set-buffer-variable buf '_filename filename))
(defun buffer-file-path (buf)
(buffer-variable buf '_filename))
(defun load-buffer-from-file (buffer file-path)
(with-open-file
(file-stream file-path)
(let ((buffer-stream (make-buffer-stream (buffer-content buffer))))
(loop while (stream-listen file-stream)
do (write-line buffer-stream (read-line file-stream)))))
(set-buffer-file-timestamp buffer (file-write-date file-path))
(set-buffer-file-path buffer file-path)
(set-buffer-changed buffer)
buffer)
(defun make-buffer-from-file (file-path)
(load-buffer-from-file (make-instance 'buffer) file-path))
;; Reload the buffer from file.
(defun buffer-file-reload (buf)
(buffer-delete-undoable buf nil nil)
(load-buffer-from-file buf (buffer-file-path buf))
(buffer-undo-mark buf)
(buffer-invalidate buf))
| 7,411 | Common Lisp | .lisp | 168 | 38.940476 | 80 | 0.663659 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 571d22583a86d568d252588f8a778b6e7952be81294f91f07b7ba8d00a7cbf60 | 21,750 | [
-1
] |
21,751 | glut-rendering.lisp | rheaplex_minara/src/glut-rendering.lisp | ;; rendering.lisp : rendering hooks
;;
;; Copyright (c) 2004, 2007 Rob Myers, [email protected]
;;
;; This file is part of Minara.
;;
;; Minara is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; Minara is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Minara. If not, see <http://www.gnu.org/licenses/>.
(in-package minara-rendering)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; The Rendering Protocol
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Caches
(defun cache-make ()
(gl:gen-lists 1))
(defun cache-dispose (cache)
(gl:delete-lists cache 1))
(defun cache-draw (cache)
(gl:call-list cache)
(gl:flush))
(defun cache-record-begin (cache)
(gl:new-list cache :compile-and-execute))
(defun cache-record-end (cache)
(declare (ignore cache))
(gl:flush)
(gl:end-list))
;; Rendering
#|
See also rendering.lisp .
We use OpenGL to render code into the current GLUT window.
Since we're doing beziers, we use a glu_tesselator and have a cache for the
resulting points. There's only one cache at the moment, which needs
making threadsafe...
Only rgb colour is supported at this level. Any other colour should be done
in Lisp.
Only filled shapes are supported at this level. Any stroking should be
implemented in Lisp. This will remove compatibility, conversion and
pre-press headaches.
|#
(defvar *glu-tesselator* nil)
(defvar *path-started* nil)
(defvar *rendering-previous-x* nil)
(defvar *rendering-previous-y* nil)
;; The tesselator requires lots of vertices stored in memory that persists
;; until tesselation is finished.
;; We allocate these as individual blocks
;; and keep a list of them for deallocation.
;; Replace with a block-based system like the old C one,
;; or with a grow-only pool of vertices.
;; Our vertices are single floats.
(defvar *vertices-to-deallocate* '())
(defun cache-vertex (&rest xyz)
(let ((vertex (cffi:foreign-alloc :float :count 3 :initial-contents xyz)))
(setf *vertices-to-deallocate*
(push vertex *vertices-to-deallocate*))
vertex))
(defun deallocate-vertices ()
(dolist (vertex *vertices-to-deallocate*)
(cffi:foreign-free vertex))
(setf *vertices-to-deallocate*
'()))
(defun render-mask-begin ()
(gl:clear :stencil-buffer-bit)
(gl:stencil-func :always 1 1)
(gl:stencil-op :replace :replace :replace))
(defun render-mask-end ()
nil)
(defun render-masking-begin ()
(gl:clear-stencil 0)
(gl:enable :stencil-test))
(defun render-masking-end ()
(gl:disable :stencil-test)
(gl:clear :stencil-buffer-bit))
(cffi:defcallback tesselator-error-callback :void ((err :int ))
(error (format t "Tesselation error: ~d" err)))
(cffi:defcallback tesselator-combine-callback :void
((coords :pointer) (vertex-data :pointer)
(weights :pointer) (data-out :pointer))
(declare (ignore vertex-data) (ignore weights))
(setf (cffi:mem-ref data-out :float 3)
(cache-vertex (cffi:mem-aref coords :double 0)
(cffi:mem-aref coords :double 1)
(cffi:mem-aref coords :double 2))))
(defcvar )
(defun tesselator-startup ()
(setf *glu-tesselator* (glu::new-tess))
(glu::tess-callback *glu-tesselator* :glu-tess-vertex
(get-var-pointer ))
(glu::tess-callback *glu-tesselator* :glu-tess-begin #'gl:begin)
(glu::tess-callback *glu-tesselator* :glu-tess-end #'gl:end)
(glu::tess-callback *glu-tesselator* :glu-tess-error
(cffi:callback tesselator-error-callback))
(glu::tess-callback *glu-tesselator* :glu-tess-combine
(cffi:callback tesselator-combine-callback)))
;; Note we have rotate/translate/scale as well as matrix concatenate.
;; This is because OpenGL and PS have these as optimised operations
;; so it makes sense to allow them to be called from code.
;; Graphics toolkits without them can simulate them.
(defun set-colour (r g b a)
(gl:color r g b a))
(defun path-begin ()
(glu::tess-begin-polygon *glu-tesselator* 0)
(setf *path-started* nil)
(setf *rendering-previous-x* 0.0)
(setf *rendering-previous-y* 0.0))
(defun path-end ()
(when *path-started*
(glu::tess-end-contour *glu-tesselator*)
(setf *path-started* nil))
(glu::tess-end-polygon *glu-tesselator*))
(defun move-to (h v)
(when *path-started*
(glu::tess-end-contour *glu-tesselator*))
(glu::tess-begin-contour *glu-tesselator*)
(let ((coords (cache-vertex h v 0.0)))
(glu::tess-vertex *glu-tesselator* coords coords))
(setf *path-started* t)
(setf *rendering-previous-x* h)
(setf *rendering-previous-y* v))
(defun line-to (h v)
(let ((coords (cache-vertex h v 0.0)))
(glu::tess-vertex *glu-tesselator* coords coords))
(setf *rendering-previous-x* h)
(setf *rendering-previous-y* v))
;; This can be optimized to reduce repeated calculation
;; e.g (* t t) and (* t t t) and (* 3) and -
(defparameter %bezier-steps 20)
(defun curve-to (h1 v1 h2 v2 h3 v3)
(loop for i from 0.0 to 1.0 by (/ 1.0 %bezier-steps)
do (let* ((q1 (+ (* i i i -1.0) (* i i 3.0) (* i -3.0) 1.0))
(q2 (+ (* i i i 3.0) (* i i -6.0) (* i 3.0)))
(q3 (+ (* i i i -3.0) (* i i 3.0)))
(q4 (* i i i))
(qx (+ (* q1 *rendering-previous-x*)
(* q2 h1) (* q3 h2) (* q4 h3)))
(qy (+ (* q1 *rendering-previous-y*)
(* q2 v1) (* q3 v2) (* q4 v3)))
(coords (cache-vertex qx qy 0.0)))
(glu::tess-vertex *glu-tesselator* coords coords)))
(let ((coords (cache-vertex h3 h3 0.0)))
(glu::tess-vertex *glu-tesselator* coords coords))
(setf *rendering-previous-x* h3)
(setf *rendering-previous-y* v3))
(defun push-matrix ()
(gl:push-matrix))
(defun pop-matrix ()
(gl:pop-matrix))
(defun concatenate-matrix (m11 m12 m21 m22 m31 m32)
(gl:mult-matrix (vector m11 m12 0.0 0.0
m21 m22 0.0 0.0
m31 m32 1.0 0.0
0.0 0.0 0.0 1.0)))
(defun set-matrix (m11 m12 m21 m22 m31 m32)
(gl:load-matrix (vector m11 m12 0.0 0.0
m21 m22 0.0 0.0
m31 m32 1.0 0.0
0.0 0.0 0.0 1.0)))
(defun identity-matrix ()
(gl:load-identity))
(defun translate (sx sy)
(gl:translate sx sy 0.0))
(defun rotate (sr)
(gl:rotate sr 0.0 0.0 1.0))
(defun scale (sx sy)
(gl:scale sx sy 0.0))
;; Initialize the tesselator
(tesselator-startup) | 6,795 | Common Lisp | .lisp | 177 | 34.836158 | 79 | 0.66621 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 81b95bb96e88ef6b924d04847025f876cbca717d08fede380fef91ffe5b7b03d | 21,751 | [
-1
] |
21,752 | development.lisp | rheaplex_minara/src/development.lisp | ;; development.lisp : loading and reloading develoment tool and library files
;;
;; Copyright (c) 2007 Rob Myers, [email protected]
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, write to the Free Software
;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
;; Reload libraries, tools and .minara file
(keymap-add-fun *global-keymap*
load-and-initialise
"d" "I")
;; Reload tools
(defun reload-tool-files ()
(format t "Reloading tool files~%")
(remove-current-tool)
(load-tools)
(bind-event-hooks)
(format t "Reloaded tool files~%"))
(keymap-add-fun *global-keymap*
reload-tool-files
"d" "t")
;; Reload .minara file
(defun reload-dot-minara-file ()
(format t "Reloading .minara file~%")
(remove-current-tool)
(load-user-config)
;;(bind-event-hooks)
(format t "Reloaded .minara file~%"))
(keymap-add-fun *global-keymap*
reload-dot-minara-file
"d" "d")
;; Edit minara file
(defun external-edit-current-window ()
(external-edit-file "~/.minara"))
;; Register keys for editing a window
(keymap-add-fun *global-keymap* external-edit-current-window "x" "d")
| 1,755 | Common Lisp | .lisp | 46 | 34.304348 | 77 | 0.701061 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 78d9922f1e82dcc9b87630cc29ec6538bb0cd5780d7291f5eb7fa7201a0a063a | 21,752 | [
-1
] |
21,753 | minibuffer.lisp | rheaplex_minara/src/minibuffer.lisp | ;; minibuffer.lisp : hacky Emacs-style minibuffers
;;
;; Copyright (c) 2004, 2007 Rob Myers, [email protected]
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, write to the Free Software
;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
(in-package minara)
;; Have an uneditable section or prefix string
(defclass minibuffer ()
((gap-buffer :accessor minibuffer-gap-buffer
:initarg :gap-buffer
:initform (make-instance 'standard-cursorchain))
(window :accessor minibuffer-window
:initarg :window)
(return-callback :accessor minibuffer-return
:initarg :return)
(cancel-callback :accessor minibuffer-cancel
:initarg :cancel)))
(defun minibuffer-length (mini)
(flexichain:nb-elements (minibuffer-gap-buffer mini)))
(defun minibuffer-position (mini)
(flexichain:cursor-pos (minibuffer-gap-buffer mini)))
(defun minibuffer-string (mini)
(let ((content (minibuffer-gap-buffer mini)))
(loop with result = (make-string (flexichain:nb-elements content))
for source from 0 below (flexichain:nb-elements content)
for dest upfrom 0
do (setf (flexichain:cursor-pos content)
source)
do (setf (aref result dest)
(flexichain:element< content))
finally (return result))))
(defun minibuffer-redraw (mini)
(let ((window (minibuffer-window mini)))
(minara-window-draw-status window
(minibuffer-string mini))
(window-redraw window)))
(defun minibuffer-insert (mini char)
(flexichain:insert (minibuffer-gap-buffer mini)
char)
(minibuffer-redraw mini))
(defun minibuffer-delete (mini)
(when (> 0 (minibuffer-position mini))
(flexichain:delete* (minibuffer-gap-buffer mini)
(1- (minibuffer-position mini))))
(minibuffer-redraw mini))
(defun minibuffer-erase (mini)
(setf (minibuffer-gap-buffer mini)
(make-instance 'standard-cursorchain))
(minibuffer-redraw mini))
(defun minibuffer-go-start (mini)
(setf (flexichain:cursor-pos (minibuffer-gap-buffer mini))
0)
(minibuffer-redraw mini))
(defun minibuffer-go-end (mini)
(setf (flexichain:cursor-pos (minibuffer-gap-buffer mini))
(1- (flexichain:nb-elements (minibuffer-gap-buffer mini))))
(minibuffer-redraw mini))
(defun minibuffer-go-forward (mini)
(when (> (flexichain:nb-elements (minibuffer-gap-buffer mini))
(flexichain:cursor-pos (minibuffer-gap-buffer mini)))
(incf (flexichain:cursor-pos (minibuffer-gap-buffer mini))))
(minibuffer-redraw mini))
(defun minibuffer-go-back (mini)
(when (> 1 (flexichain:cursor-pos (minibuffer-gap-buffer mini)))
(decf (flexichain:cursor-pos (minibuffer-gap-buffer mini))))
(minibuffer-redraw mini))
(defun minibuffer-make (window initial-text ok cancel)
(let ((mini (make-instance 'minibuffer
:window window
:ok ok
:cancel cancel)))
(flexichain:insert-sequence (minibuffer-gap-buffer mini) initial-text)
(minibuffer-go-end mini)
mini))
;; Adding & removing to window
(defun window-minibuffer (window)
(buffer-variable (window-buffer-main window)
'_minibuffer))
;; Will need fixing for multi-window operation
;; How should window & global event handlers interact?
;; Tools must ensure their buffers on mouse-down rather than create on install?
;; Key handler
(defun minibuffer-key-handler (mini k)
(let ((key (aref k 0)))
(case key
((GLUT_KEY_LEFT)
(minibuffer-go-back mini))
((GLUT_KEY_RIGHT)
(minibuffer-go-forward mini))
((GLUTKEY_UP)
(minibuffer-go-end mini))
((GLUTKEY_DOWN)
(minibuffer-go-start mini))
((#\del)
(minibuffer-delete mini))
((#\return) ;; #\nl
;; (window-remove-minibuffer (minibuffer-window mini))
(funcall (minibuffer-return mini)))
((#\esc)
;; (window-remove-minibuffer (minibuffer-window mini))
(funcall (minibuffer-cancel mini)))
(else
(minibuffer-insert mini
key)))))
(defun window-minibuffer-key-handler (window key modifiers)
(declare (ignore modifiers))
(minibuffer-key-handler (window-minibuffer window)
key))
(defvar *previous-key-handlers* nil)
(defun install-minibuffer-key-handler ()
(setf *key-release-funs* (list #'window-minibuffer-key-handler)))
(defun uninstall-minibuffer-key-handler ()
(setf *key-release-funs* *previous-key-handlers*)
(setf *previous-key-handlers* nil))
(defun window-add-minibuffer (window initial-text ok cancel)
(set-buffer-variable (window-buffer-main window)
'_minibuffer
(minibuffer-make window
initial-text
ok
cancel))
(install-minibuffer-key-handler)
(minibuffer-redraw (window-minibuffer window)))
(defun window-remove-minibuffer (window)
(kill-buffer-variable (window-buffer-main window)
'_minibuffer)
(uninstall-minibuffer-key-handler)
(window-redraw window))
| 5,819 | Common Lisp | .lisp | 140 | 34.571429 | 79 | 0.667788 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 00c26beb1faa3ef54827fb74c8f60613403d7aad11b403c6d0bf43e3985742e8 | 21,753 | [
-1
] |
21,754 | command-line.lisp | rheaplex_minara/src/command-line.lisp | ;; command-line.scm : minara scheme development file
;;
;; Copyright (c) 2004 Rob Myers, [email protected]
;;
;; This file is part of Minara.
;;
;; Minara is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; Minara is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Minara. If not, see <http://www.gnu.org/licenses/>.
(in-package minara)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Our help message in response to --help
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun cli-help ()
(write-line "Usage: minara [OPTION]...")
(write-line "")
(write-line "Run minara, a programmable graphics program editor.")
(write-line "")
(write-line "Initialization options:")
(write-line "")
(write-line "-f --file <path>\t\tLoad the file given by <path>")
(write-line "-h --help\t\tdisplay this message and exit")
(write-line "-v --version\t\tdisplay version information and exit"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Our version info in response to --version
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun cli-version ()
(write-line "minara 0.1")
(write-line "Copyright (C) 2004-2007 Rob Myers")
(write-line "You may redistribute copies of Emacs")
(write-line "under the terms of the GNU General Public License v3 or later.")
(write-line
"For more information about these matters, see the file named COPYING."))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Handling command-line arguments
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
| 2,154 | Common Lisp | .lisp | 45 | 45.955556 | 79 | 0.56619 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 82563938b15bb27ec13422d8f8e98c3147b4b8601e12d7dfbd36719374807a2d | 21,754 | [
-1
] |
21,755 | tool.lisp | rheaplex_minara/src/tool.lisp | ;; tool.lisp : tool handling
;;
;; Copyright (c) 2004,2007 Rob Myers, [email protected]
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, write to the Free Software
;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
(in-package minara)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Tools
;; A tool is a set of event handlers and routines to install/uninstall them,
;; hooked up to the main keymap and the tool menu.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Install a tool
;; This gives access to the tool from the menu and keyboard,
;; And installs an uninstall function (setup can be done by install-fun)
;; The install has to add the event handlers, the uninstall has to remove them
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Handle a tool stopping being the current tool
(defvar *remove-current-tool-hook* nil)
;; Keep track of the current tool name
(defvar *current-tool-name* "")
(defun set-current-tool-name (name)
(setf *current-tool-name* name)
(window-redraw (window-current)))
;; Draw the status with the tool name after the main redraw
(defmethod window-redraw-event :around (window &optional (prefix ""))
(declare (ignore prefix))
(call-next-method window
(concatenate 'string
*current-tool-name*
" ")))
(defun remove-current-tool ()
(if *remove-current-tool-hook*
(funcall *remove-current-tool-hook*))
(setf *remove-current-tool-hook* nil)
(setf *current-tool-name* "")
;;(install-window-rendering-protocol)
(window-redraw (window-current)))
(defun install-tool (install-fun uninstall-fun menu-name &rest key-combo)
(let ((install-fun-with-boilerplate
(lambda ()
(remove-current-tool)
(set-current-tool-name menu-name)
(setf *remove-current-tool-hook* uninstall-fun)
(funcall install-fun))))
(menu-callback-add menu-name install-fun-with-boilerplate)
(funcall #'keymap-add-fun
*global-keymap*
install-fun-with-boilerplate
key-combo)))
| 2,723 | Common Lisp | .lisp | 62 | 41.225806 | 79 | 0.647659 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | cffd89e7daec495ea21a238aea19e09a6ab49d6a73d17700e0b402c3891aa870 | 21,755 | [
-1
] |
21,756 | geometry.lisp | rheaplex_minara/src/geometry.lisp | ;; geometry.lisp : minara scheme development file
;;
;; Copyright (c) 2004, 2007 Rob Myers, [email protected]
;;
;; This file is part of Minara.
;;
;; Minara is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; Minara is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Minara. If not, see <http://www.gnu.org/licenses/>.
(in-package minara)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Mathematical functions for geometric calculations.
;; Particularly for hit-testing.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Find the distance between the points x1,y1 and x2,y2
(defun distance-between-points (x1 y1 x2 y2)
(abs (sqrt (+ (expt (- x2
x1)
2.0)
(expt (- y2
y1)
2.0)))))
;; Find polar angle of point px,py around point ox,oy
(defun angle-around-point (ox oy px py)
(let ((x (- px
ox))
(y (- py
oy)))
(case x
((0.0)
(cond
((< y 0.0)
270.0)
((> y 0.0)
90.0)
((= y 0.0)
0.0)))
(otherwise
(let ((r (* (atan (/ y
x))
(/ 180.0
3.14159))))
(if (< x 0.0)
(+ r
180.0)
r))))))
(defparameter degrees-to-radians
(/ pi
180.0))
(defun degrees-to-radians (degrees)
(* degrees
degrees-to-radians))
(defun rotate-point-around-point (x1 y1 x2 y2 theta)
(let ((st (sin (degrees-to-radians theta)))
(ct (cos (degrees-to-radians theta)))
(x (- x2
x1))
(y (- y2
y1)))
(cons (+ x1
(- (* x
ct)
(* y
st)))
(+ y1
(+ (* y
ct)
(* x
st))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Line-line intersection
;; http://astronomy.swin.edu.au/~pbourke/geometry/lineline2d/
;; Returns the t where the second line intersects the first line
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun lines-intersect-vertices (p1x p1y p2x p2y ;; First line
p3x p3y p4x p4y);; Second line
(let ((denominator (- (* (- p4y p3y)
(- p2x p1x))
(* (- p4x p3x)
(- p2y p1y)))))
(if (= denominator 0.0)
nil ;; Parallel lines
(let ((ua (/ (- (* (- p4x p3x)
(- p1y p3y))
(* (- p4y p3y)
(- p1x p3x)))
denominator))
(ub (/ (- (* (- p2x p1x)
(- p1y p3y))
(* (- p2y p1y)
(- p1x p3x)))
denominator)))
(if (and (>= ua 0.0)
(<= ua 1.0)
(>= ub 0.0)
(<= ub 1.0)) ;; Intersection (or not)
ua
nil)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Point mathematics
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defclass point ()
((x :initarg :x
:initform 0.0
:accessor point-x)
(y :initarg :y
:initform 0.0
:accessor point-y)))
(defun add-point (p1 p2)
(make-instance 'point
:x (+ (point-x p1) (point-x p2))
:y(+ (point-y p1) (point-y p2))))
(defun divide-point (p d)
(make-instance 'point :x (/ (point-x p) d) :y (/ (point-y p) d)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Find out which side of an infinite line through p1 and p2 that p0 lies on.
;; < 0 = left, > 0 = right, == 0 = exactly on.
;; From draw-something :-)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun point-line-side (p0 p2 p1)
(- (* (- (point-x p1) (point-x p0)) (- (point-y p2) (point-y p0)))
(* (- (point-x p2) (point-x p0)) (- (point-y p1) (point-y p0)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Beziers
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Have a bezier class?
;; Evaluate the bezier at time t
;; Converted from the C in minara_rendering.c
(defun bezier-eval (h0 v0 h1 v1 h2 v2 h3 v3 time)
(let ((q1 (+ (* time time time -1.0) (* time time 3) (* time -3.0) 1.0))
(q2 (+ (* time time time 3.0) (* time time -6.0) (* time 3.0)))
(q3 (+ (* time time time -3.0) (* time time 3.0)))
(q4 (* time time time)))
(let ((qx (+ (* q1 h0) (* q2 h1) (* q3 h2) (* q4 h3)))
(qy (+ (* q1 v0) (* q2 v1) (* q3 v2) (* q4 v3))))
(values qx qy))))
;; Divide the bezier into two equal halves
;; Left first, then right. Two lists of vertex co-ordinates
#|(defun split-bezier (h0 v0 h1 v1 h2 v2 h3 v3)
(let* ((p01 (/ (add-point h0 v0 h1 v1) 2.0))
(p12 (/ (add-point h1 v1 h2 v2) 2.0))
(p23 (/ (add-point h2 v2 h3 v2) 2.0))?
(p012 (/ (add-point (point-x p01) (point-y p01)
(point-x p12) (point-y p12)) 2.0))
(p123 (/ (add-point (point-x p12) (point-y p12)
(point-x p23) (point-y p23)) 2.0))
(p0123 (/ (add-point (point-x p012) (point-y p012)
(point-x p123) (point-y p123)) 2.0)))
(list (list h0 v0 h01 v01 (point-x 012) (point-y 012)
(point-x 0123) (point-y 0123))
(list (point-x 0123) (point-y 0123) (point-x 123) (point-y 123)
h23 v23 h3 v3))))|#
;; Decide the flatness of the bezier
;; Line-bezier intersection
;; Terrible. Almost as good as our bezier drawing
;; Replace with something less embarrasingly awful,
;; recursive subdivision at least
;; And the name is bad, too
(defparameter *bez-eval-steps* 10)
(defparameter *bez-eval-step* (/ 1.0 *bez-eval-steps*))
;; Doesn't handle pathological cases
(defun line-bezier-intersection-count-vertices (ax ay bx by h0 v0 h1 v1 h2 v2
h3 v3)
(let ((crossings '())
(ph h0)
(pv v0))
;; Step through the bezier at a very coarse resolution
(loop for time from 0.0 to 1.0 by *bez-eval-step*
;; Return the count of intersections
do (let* ((p (bezier-eval h0 v0 h1 v1 h2 v2 h3 v3 time))
(h (point-x p))
(v (point-y p))
(ti (lines-intersect-vertices ph pv h v
ax ay bx by)))
;; Counting the number of intersections
;; Ignoring intersections at 0.0 because
;; they are the same as the previous 1.0 intersection...
(if (and ti
(> ti
0.0))
(let ((intersection (cons h v)))
;; Avoid duplicating points from adjacent sections
;; when the ray passes exactly through the point
(setf crossings (assoc intersection
crossings))))
(setf ph h)
(setf pv v))
finally (length crossings))))
;; Get the normal of the bezier at point t
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; tests
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#|(test-section "geometry: intersection")
(test 0.0 (lines-intersect-vertices 0.0 0.0 0.0 100.0
0.0 0.0 100.0 0.0))
(test 0.5 (lines-intersect-vertices 0.0 0.0 0.0 100.0
0.0 50.0 100.0 50.0))
(test 1.0 (lines-intersect-vertices 0.0 0.0 0.0 100.0
0.0 100.0 100.0 100.0))
(test 0.5 (lines-intersect-vertices 0.0 0.0 100.0 100.0
0.0 50.0 100.0 50.0))
(test nil (lines-intersect-vertices 0.0 0.0 100.0 100.0
1000.0 1000.0 1000.0 1000.0))
(test 0 (line-bezier-intersection-count-vertices 20 0 80 0
0 0 0 100 100 100 100 0))
;; Aligned with end-point of a subdivision (given t step of 0.1)
(test 1 (line-bezier-intersection-count-vertices 50 0 50 150
0 0 0 100 100 100 100 0))
;; Not aligned with end-point of subdivision (given t step of 0.1)
(test 1 (line-bezier-intersection-count-vertices 52 0 52 150
0 0 0 100 100 100 100 0))
(test 2 (line-bezier-intersection-count-vertices 0 50 100 50
0 0 0 100 100 100 100 0))|# | 7,977 | Common Lisp | .lisp | 222 | 31.797297 | 79 | 0.535182 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 2134425faba91575a33a2dd46c14ff68970e62b0987a0d829cdfb6e08a9e2806 | 21,756 | [
-1
] |
21,757 | packages.lisp | rheaplex_minara/src/packages.lisp | ;; package.lisp : the minara packages
;;
;; Copyright (c) 2007 Rob Myers, [email protected]
;;
;; This file is part of Minara.
;;
;; Minara is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; Minara is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Minara. If not, see <http://www.gnu.org/licenses/>.
(in-package cl-user)
(eval-when (:COMPILE-TOPLEVEL :LOAD-TOPLEVEL :EXECUTE)
(defpackage minara
(:documentation
"Minara public API.")
(:use :cl)
(:export :minara
;; Transformations
:matrix :make-matrix-identity :make-matrix-scale
:make-matrix-translate :make-matrix-rotate :matrix-to-string
:matrix-concatenate :matrix-point-transform
;; Keymaps
:make-keymap :keymap-add-fun :keymap-current-set
:reset-current-keymap
;; Buffers
:buffer :buffer-variable :set-buffer-variable
:ensure-buffer-variable :kill-buffer-variable
:kill-all-buffer-variables :buffer-invalidate
:make-buffer-from-file :write-buffer-to-file
:reload-buffer-file
;; Windows
:window :window-buffer :window-buffer-main
:make-window-buffer :ensure-window-buffer :remove-window-buffer
:window-buffer-path :set-window-title-info :window-redraw
:make-window :make-window-from-file :reload-window-buffer
:reload-current-window :buffer-has-file-p :save-window
:save-current-window
;; Minibuffer
:minibuffer :minibuffer-string :minibuffer-insert
:minibuffer-delete :minibuffer-erase :minibuffer-go-start
:minibufer-go-end :minibuffer-go-forward :minibuffer-go-back
:window-minibuffer :window-add-minibuffer
:window-remove-minibuffer
;; Undo
:buffer-undo-mark :buffer-variable-set-undoable
:buffer-insert-undoable :buffer-delete-undoable
:window-undo-stack-push :window-undo-stack-pop
;; Menus
:menu-make-toplevel :menu-make-entry :menu-delete-entry
:menu-install-toplevel
;; Geometry
:distance-between-points :angle-around-point
:degrees-to-radians :rotate-point-around-point
:lines-intersect-vertices
:point :add-point :divide-point :point-line-side
:bezier-eval :line-bezier-intersection-count-vertices
;; Tools
:install-tool)))
(eval-when (:COMPILE-TOPLEVEL :LOAD-TOPLEVEL :EXECUTE)
(defpackage minara-rendering
(:documentation
"Minara rendering API.")
(:use :cl)
(:export :set-colour :path-begin :path-end :move-to :line-to :curve-to
:push-matrix :pop-matrix :concatenate-matrix :set-matrix
:identity-matrix :translate :rotate :scale
:cache-draw :cache-record-begin :cache-record-end
:rendering-begin :rendering-end)))
(eval-when (:COMPILE-TOPLEVEL :LOAD-TOPLEVEL :EXECUTE)
(defpackage minara-picking
(:documentation
"Minara picking API.")
(:use :cl :minara)
(:export :set-colour :path-begin :path-end :move-to :line-to :curve-to
:push-matrix :pop-matrix :concatenate-matrix :set-matrix
:identity-matrix :translate :rotate :scale)))
| 3,336 | Common Lisp | .lisp | 84 | 36.52381 | 72 | 0.746149 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 41829438a9627f17b74379e0686256a71f7581c12681fd5bfa769fd8487fe5ae | 21,757 | [
-1
] |
21,758 | view-tools.lisp | rheaplex_minara/src/view-tools.lisp | ;; view-tools.lisp : tools for viewing windows for minara
;;
;; Copyright (c) 2004, 2007 Rob Myers, [email protected]
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, write to the Free Software
;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
(in-package minara)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Zoom limits
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defparameter $zoom-max-out 0.0625)
(defparameter $zoom-normal 1.0)
(defparameter $zoom-max-in 16.0)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; View buffer
;; The window buffer below the main buffer that gives the window view
;; view when evaluated.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun window-view-buffer (window)
(window-buffer window '_view))
(defun window-view-buffer-current()
(window-view-buffer (window-current)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Property accessors
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Zoom
(defun buffer-scale (buffer)
(buffer-variable buffer
"scale"))
(defun window-scale (window)
(buffer-scale (window-view-buffer window)))
;; Pan
(defun buffer-scale-tx (buffer)
(buffer-variable buffer
"scale-tx"))
(defun buffer-scale-ty (buffer)
(buffer-variable buffer
"scale-ty"))
(defun window-scale-tx (window)
(buffer-scale-tx (window-view-buffer window)))
(defun window-scale-ty (window)
(buffer-scale-ty (window-view-buffer window)))
(defun buffer-tx (buffer)
(buffer-variable buffer
"tx"))
(defun buffer-ty (buffer)
(buffer-variable buffer
"ty"))
(defun set-buffer-tx (buffer tx)
(set-buffer-variable buffer
"tx"
tx))
(defun set-buffer-ty (buffer ty)
(set-buffer-variable buffer
"ty"
ty))
;; The temporary translate used by the pan tool.
;; Rename
(defun buffer-pan-tx (buffer)
(buffer-variable buffer
"pan-tx"))
(defun buffer-pan-ty (buffer)
(buffer-variable buffer
"pan-ty"))
(defun set-buffer-pan-tx (buffer tx)
(set-buffer-variable buffer
"pan-tx"
tx))
(defun set-buffer-pan-ty (buffer ty)
(set-buffer-variable buffer
"pan-ty"
ty))
;; Tilt
(defun buffer-rotation (buffer)
(buffer-variable buffer
"angle"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Updating the view buffer
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; This is called in the window constructor. Don't call it in your own code.
(defun window-view-buffer-make (window)
(make-window-buffer window '_view)
(let ((buffer (window-view-buffer window)))
(set-buffer-variable buffer
"resize-ty"
0.0)
(set-buffer-variable buffer
"scale"
$zoom-normal)
(set-buffer-variable buffer
"scale-tx"
0.0)
(set-buffer-variable buffer
"scale-ty"
0.0)
(set-buffer-variable buffer
"tx"
0.0)
(set-buffer-variable buffer
"ty"
0.0)
(set-buffer-variable buffer
"pan-tx"
0.0)
(set-buffer-variable buffer
"pan-ty"
0.0)
(set-buffer-variable buffer
"angle"
0.0)))
(defun view-buffer-update (buffer)
(let ((scale (buffer-scale buffer))
(text (buffer-gap-buffer buffer)))
(buffer-erase buffer)
(flexichain:insert-sequence
text
(format nil
"(translate 0 ~f) ;; Window resize offset~%"
(* scale
(buffer-variable buffer "resize-ty"))))
(flexichain:insert-sequence
text
(format nil
"(translate ~f ~f) ;; Scale translate~%"
(buffer-scale-tx buffer)
(buffer-scale-ty buffer)))
(flexichain:insert-sequence
text
(format nil
"(translate ~f ~f) ;; Pan translate~%"
(* scale
(buffer-tx buffer))
(* scale
(buffer-ty buffer))))
(flexichain:insert-sequence
text
(format nil
"(translate ~f ~f) ;; Pan tool temp translate~%"
(buffer-pan-tx buffer)
(buffer-pan-ty buffer)))
(flexichain:insert-sequence
text
(format nil
"(rotate ~f)~%"
(buffer-rotation buffer)))
(flexichain:insert-sequence
text
(format nil
"(scale ~f ~f)"
scale
scale))
;;(format t "~A~%~%" (buffer-to-string text))
(buffer-invalidate buffer)))
(defun window-view-update (window)
(view-buffer-update (window-view-buffer window))
(window-redraw window))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Zoom
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Scale factors and view translation factors.
;; If anyone can explain this to me I'd be very grateful... - Rob.
(defun next-zoom-out-level (current)
(if (= current
$zoom-max-out)
nil
(/ current
2.0)))
(defun next-zoom-in-level (current)
(if (= current
$zoom-max-in)
nil
(* current
2.0)))
(defun next-zoom-level (current in?)
(if in?
(next-zoom-in-level current)
(next-zoom-out-level current)))
(defun buffer-zoom-update (buffer zoom)
(set-buffer-variable buffer
"scale"
zoom))
(defun window-zoom-update (window zoom)
(buffer-zoom-update (window-view-buffer window)
zoom)
(let* ((buffer (window-view-buffer window))
(scale (buffer-scale buffer)))
(set-buffer-variable buffer
"scale-tx"
(/ (- (window-width window)
(* (window-width window)
scale))
2.0))
(set-buffer-variable buffer
"scale-ty"
(/ (- (window-height window)
(* (window-height window)
scale))
2.0)))
(window-view-update window))
(defun zoom (in)
;; Ultimately zoom & pan with same click here
(let* ((window (window-current))
(buffer (window-view-buffer window))
(current-zoom (buffer-scale buffer))
(zoom (next-zoom-level current-zoom
in)))
(if zoom
(window-zoom-update window
zoom))))
(defun zoom-default()
(window-zoom-update (window-current)
$zoom-normal))
(defun zoom-in ()
(zoom t))
(defun zoom-out ()
(zoom nil))
(keymap-add-fun *global-keymap*
#'zoom-in
"i")
(keymap-add-fun *global-keymap*
#'zoom-out
"I")
(keymap-add-fun *global-keymap*
#'zoom-default
"Ai")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Pan
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun pan-zoom-factor (zoom)
(/ 1.0 zoom))
(defun buffer-pan-zoom-factor (buffer)
(pan-zoom-factor (buffer-scale buffer)))
(defun window-pan-zoom-factor (window)
(buffer-pan-zoom-factor (window-view-buffer window)))
(defun window-tx (window)
(buffer-tx (window-view-buffer window)))
(defun window-ty (window)
(buffer-ty (window-view-buffer window)))
(defun set-window-tx (window tx)
(set-buffer-tx (window-view-buffer window)
tx))
(defun set-window-ty (window ty)
(set-buffer-ty (window-view-buffer window)
ty))
(defun set-window-transform (window)
(let ((buffer (window-view-buffer window)))
(set-buffer-tx buffer
(+ (/ (buffer-pan-tx buffer)
(buffer-scale buffer))
(buffer-tx buffer)))
(set-buffer-ty buffer
(+ (/ (buffer-pan-ty buffer)
(buffer-scale buffer))
(buffer-ty buffer)))
(set-buffer-pan-tx buffer 0.0)
(set-buffer-pan-ty buffer 0.0)))
(defvar pan-tool-mouse-down nil)
(defvar pan-tool-mousedown-x nil)
(defvar pan-tool-mousedown-y nil)
(defun pan-mouse-down (window button x y)
(declare (ignore window)
(ignore button))
(setf pan-tool-mouse-down t)
(setf pan-tool-mousedown-x
x)
(setf pan-tool-mousedown-y
y))
(defun pan-mouse-move (window x y)
(if pan-tool-mouse-down
(let ((buffer (window-view-buffer window)))
(set-buffer-pan-tx buffer(- x;;(window-view-x window x)
pan-tool-mousedown-x))
(set-buffer-pan-ty buffer
(- y;;(window-view-y window y)
pan-tool-mousedown-y))
(window-view-update window))))
(defun pan-mouse-up (window button x y)
(declare (ignore button)
(ignore x)
(ignore y))
(setf pan-tool-mouse-down nil)
(set-window-transform window)
(window-view-update window))
(defun pan-default ()
(let ((window (window-current)))
(set-window-tx window
0.0)
(set-window-ty window
0.0)
(set-window-transform window)
(window-view-update window)))
;; Install
(defun pan-tool-install ()
(add-mouse-down-hook #'pan-mouse-down)
(add-mouse-move-hook #'pan-mouse-move)
(add-mouse-up-hook #'pan-mouse-up))
;; Uninstall
(defun pan-tool-uninstall ()
(remove-mouse-down-hook #'pan-mouse-down)
(remove-mouse-move-hook #'pan-mouse-move)
(remove-mouse-up-hook #'pan-mouse-up))
;; Register
(install-tool #'pan-tool-install
#'pan-tool-uninstall
"Pan"
"p")
(keymap-add-fun *global-keymap*
#'pan-default
"Ap")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Reset the view to the identity matrix
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun view-panic ()
(zoom-default)
(pan-default))
(keymap-add-fun *global-keymap*
#'view-panic
"AP")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Tilt
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; View/window co-ordinate conversion
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun window-view-width (window)
(/ (window-width window)
(window-scale window)))
(defun window-view-height (window)
(/ (window-height window)
(window-scale window)))
(defun window-view-left (window)
(- (/ (- (window-scale-tx window))
(window-scale window))
(window-tx window)))
(defun window-view-right (window)
(+ (window-view-width window)
(window-tx window)))
(defun window-view-bottom (window)
(- (/ (- (window-scale-ty window))
(window-scale window))
(window-ty window)))
(defun window-view-top (window)
(+ (window-view-height window)
(window-ty window)))
(defun window-view-x (window x)
(+ (/ x
(window-scale window))
(window-view-left window)))
(defun window-view-y (window y)
(+ (/ (- y
(* (- (window-height window)
*window-height*)
(window-scale window)))
(window-scale window))
(window-view-bottom window)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Window resize offset
;; The window co-ordinate system starts at the bottom left
;; So when the window is resized, it shifts and the page moves
;; which doesn't look good, so we counteract that here
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun window-resizing-buffer-make (window)
(make-window-buffer window "resizing-buffer"))
(defun window-previous-height (window)
(or (buffer-variable (window-view-buffer window)
"old-height")
*window-height*))
(defun update-window-previous-height (window)
(set-buffer-variable (window-view-buffer window)
"old-height"
(window-height window)))
(defun window-view-resize (window x y)
(declare (ignore x)
(ignore y))
(let* ((height (window-height window)))
(if (not (= height
-1))
(let* ((buffer (window-view-buffer window))
(old-ty (buffer-variable buffer
"resize-ty")))
(set-buffer-variable buffer
"resize-ty"
(+ old-ty
(/ (- height
(window-previous-height window))
(window-scale window))))
(window-view-update window)
(update-window-previous-height window)))))
(add-resize-hook #'window-view-resize)
| 14,307 | Common Lisp | .lisp | 400 | 27.16 | 80 | 0.50362 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 1f46751c2946ac45ca40c12e613c51001d2d862635d6e982065e6a199430a2b8 | 21,758 | [
-1
] |
21,759 | cairo-rendering.lisp | rheaplex_minara/src/cairo-rendering.lisp | ;; cairo-rendering.lisp : rendering implementation using Cairo and OpenGL
;;
;; Copyright (c) 2008 Rob Myers, [email protected]
;;
;; This file is part of Minara.
;;
;; Minara is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; Minara is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Minara. If not, see <http://www.gnu.org/licenses/>.
(in-package minara-rendering)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; The Rendering Protocol
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar *matrix-stack* '()
"Cairo doesn't have a matrix stack so we manage it in Lisp.")
;; Caches
(defclass render-cache ()
((width :accessor cache-width
:initarg :width)
(height :accessor cache-height
:initarg :height)
(cairo-texture :accessor cache-cairo-texture
:initarg :cairo-texture)
(cairo-context :accessor cache-cairo-context
:initarg :cairo-context)
(opengl-texure-id :accessor cache-opengl-texture-id
:initarg :opengl-texture-id)))
(defun make-cache (width height)
(let ((texture (cairo:create-image-surface :argb32 width height)))
(make-instance 'render-cache
:width width
:height height
:cairo-texture texture
:cairo-context (cairo:create-context texture)
:opengl-texture-id (first (gl:gen-textures 1)))))
(defun cache-dispose (cache)
(cairo:destroy (cache-cairo-context cache)) ;; Also disposes of the surface
;; dispose of the gl texture
(format t "cache-dispose needs to dispose of gl texture~%")
)
(defun cache-resize (cache width height)
(if (and (= (cache-width cache) width)
(= (cache-height cache) height))
cache
(progn
(cache-dispose cache)
(make-cache width height))))
(defun cache-draw (cache)
; (gl:active-texture 0)
(gl:bind-texture :texture-2d (cache-opengl-texture-id cache))
; (gl:color 0 1 1)
(gl:with-primitives :quads
(gl:tex-coord 0 1)
(gl:vertex 0 0)
(gl:tex-coord 1 1)
(gl:vertex 0 400)
(gl:tex-coord 1 0)
(gl:vertex 600 400)
(gl:tex-coord 0 0)
(gl:vertex 600 0)))
(defun cache-record-begin (cache)
(setf cairo:*context* (cache-cairo-context cache)))
(defun cache-record-end (cache)
(setf cairo:*context* nil)
(gl:bind-texture :texture-2d (cache-opengl-texture-id cache))
(gl:tex-image-2d :texture-2d 0
:rgba (cache-width cache) (cache-height cache)
0 :bgra :unsigned-byte
(cairo:image-surface-get-data (cache-cairo-texture cache)
:pointer-only t)))
(defmethod glut:reshape :after ((w minara::window) width height)
(dolist (buf-cons (minara::window-buffers w))
(when (minara::buffer-cache (cdr buf-cons))
(cache-dispose (minara::buffer-cache (cdr buf-cons))))
(setf (minara::buffer-cache (cdr buf-cons))
(make-cache width height))))
;; Rendering
#|
We use Cairo to render code into an OpenGL texture.
Then we use OpenGL to blit the textures into the current GLUT window.
Only rgb colour is supported at this level. Any other colour should be done
in Lisp.
Only filled shapes are supported at this level. Any lines or stroking should
be implemented in Lisp. This will remove compatibility, conversion and
pre-press headaches.
|#
(defvar *path-started* nil)
(defvar *rendering-previous-x* nil)
(defvar *rendering-previous-y* nil)
(defun render-mask-begin ()
nil)
(defun render-mask-end ()
nil)
(defun render-masking-begin ()
nil)
(defun render-masking-end ()
nil)
;; Note we have rotate/translate/scale as well as matrix concatenate.
;; This is because they are often optimised operations
;; so it makes sense to allow them to be called from code.
;; Graphics toolkits without them can simulate them.
(defun set-colour (r g b a)
(cairo:set-source-rgba r g b a))
(defun path-begin ()
(setf *path-started* t)
(setf *rendering-previous-x* 0.0)
(setf *rendering-previous-y* 0.0))
(defun path-end ()
(when *path-started*
(cairo:close-path))
(cairo:fill-path))
(defun move-to (h v)
(when *path-started*
(cairo:close-path))
(cairo:move-to h v)
(setf *path-started* t)
(setf *rendering-previous-x* h)
(setf *rendering-previous-y* v))
(defun line-to (h v)
(cairo:line-to h v)
(setf *rendering-previous-x* h)
(setf *rendering-previous-y* v))
;; This can be optimized to reduce repeated calculation
;; e.g (* t t) and (* t t t) and (* 3) and -
(defparameter %bezier-steps 20)
(defun curve-to (h1 v1 h2 v2 h3 v3)
(cairo:curve-to h1 v1 h2 v2 h3 v3)
(setf *rendering-previous-x* h3)
(setf *rendering-previous-y* v3))
(defun push-matrix ()
(push (cairo:get-trans-matrix)
*matrix-stack*))
(defun pop-matrix ()
(cairo:set-trans-matrix (pop *matrix-stack*)))
(defun concatenate-matrix (m11 m12 m21 m22 m31 m32)
(cairo:transform (cairo:make-trans-matrix m11 m12 m21 m22 m31 m32)))
(defun set-matrix (m11 m12 m21 m22 m31 m32)
(cairo:set-trans-matrix (cairo:make-trans-matrix m11 m12 m21 m22 m31 m32)))
(defun identity-matrix ()
(cairo:reset-trans-matrix))
(defun translate (sx sy)
(cairo:translate sx sy))
(defun rotate (sr)
(cairo:rotate sr))
(defun scale (sx sy)
(cairo:scale sx sy))
(defun rendering-begin ()
(gl:blend-func :src-alpha :one)
(setf *matrix-stack* '())
(push (cairo:make-trans-matrix)
*matrix-stack*))
(defun rendering-end ()
(setf *matrix-stack* '())) | 5,820 | Common Lisp | .lisp | 162 | 32.907407 | 79 | 0.691459 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | d1173ab001b9a258087746b7709818ba80667d4abc698f87933ff5671cc7c67c | 21,759 | [
-1
] |
21,760 | test.lisp | rheaplex_minara/src/test.lisp | ;; test.lisp : minara minimal test harness
;;
;; Copyright (c) 2004, 2007 Rob Myers, [email protected]
;;
;; This file is part of Minara.
;;
;; Minara is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; Minara is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Minara. If not, see <http://www.gnu.org/licenses/>.
(in-package minara)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Globals
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Store all the tests as they are defined
(defvar *tests* '())
;; The total number of tests run
(defvar *tests-run* 0)
;; And the total number of tests failed
(defvar *tests-failed* 0)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Defining tests
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; A single test assertion
(defmacro test-assert (comparison comment expected &rest code)
`(setf *tests*
(cons
(lambda ()
(setf *tests-run* (+ *tests-run* 1))
(let ((result ,code))
(if (not (,comparison ,expected result))
(begin
(format t "~a: " ,comment)
(write @,code)
(format t "~% Expected ~a, got ~a.~%" ,expected result)
(setf *tests-failed* (+ *tests-failed* 1))))))
*tests*)))
(defmacro test (expected code)
`(test-assert equal? "Test unexpectedly failed" ,expected ,code))
(defmacro test-fail (expected code)
`(test-assert (lambda (a b) (not (equal a b)))
"Test unexpectedly succeeded" ,expected ,code))
(defmacro test-section (name)
`(setf *tests*
(cons
,name
*tests*)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Running tests
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun run-tests-aux (tests)
(if (consp tests)
(progn
(if (stringp (car tests))
(format t "---->~a~%" (car tests))
(funcall (car tests)))
(run-tests-aux (cdr tests)))))
(defun run-tests ()
"Run all the tests"
(format t "Running tests.~%")
(run-tests-aux (reverse *tests*))
(format t "Total tests passed: ~a/~a~%"
(- *tests-run* *tests-failed*)
*tests-run*)) | 2,668 | Common Lisp | .lisp | 72 | 34.277778 | 79 | 0.552672 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | e0652b30bc499f9d63abc3fdef2058e5bd2fb14af738617dcb638926f234a3ed | 21,760 | [
-1
] |
21,761 | trivial-garbage.asd | rheaplex_minara/lib/trivial-garbage/trivial-garbage.asd | ;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; trivial-garbage.asd --- ASDF system definition for trivial-garbage.
;;;
;;; This software is placed in the public domain by Luis Oliveira
;;; <[email protected]> and is provided with absolutely no
;;; warranty.
#-(or cmu scl sbcl allegro clisp openmcl corman lispworks ecl)
(error "Sorry, your Lisp is not supported by trivial-garbage.")
(defsystem trivial-garbage
:description "Portable finalizers, weak hash-tables and weak pointers."
:author "Luis Oliveira <[email protected]>"
:version "0.17"
:licence "Public Domain"
:components ((:file "trivial-garbage")))
(defmethod perform ((op test-op) (sys (eql (find-system :trivial-garbage))))
(operate 'test-op :trivial-garbage-tests))
(defsystem trivial-garbage-tests
:description "Unit tests for TRIVIAL-GARBAGE."
:depends-on (trivial-garbage rt)
:components ((:file "tests")))
(defmethod perform ((op test-op)
(sys (eql (find-system :trivial-garbage-tests))))
(operate 'load-op :trivial-garbage-tests)
(funcall (find-symbol (string '#:do-tests) '#:rtest)))
;; vim: ft=lisp et
| 1,145 | Common Lisp | .asd | 26 | 41.192308 | 76 | 0.715184 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | a42f97d1312b91d33a9e0f5685de53002401d02a9ea65985add2788253824322 | 21,761 | [
122112
] |
21,762 | trivial-features-tests.asd | rheaplex_minara/lib/trivial-features/trivial-features-tests.asd | ;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; trivial-features-tests.asd --- ASDF definition.
;;;
;;; Copyright (C) 2007, Luis Oliveira <[email protected]>
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
;;; files (the "Software"), to deal in the Software without
;;; restriction, including without limitation the rights to use, copy,
;;; modify, merge, publish, distribute, sublicense, and/or sell copies
;;; of the Software, and to permit persons to whom the Software is
;;; furnished to do so, subject to the following conditions:
;;;
;;; The above copyright notice and this permission notice shall be
;;; included in all copies or substantial portions of the Software.
;;;
;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
;;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
;;; DEALINGS IN THE SOFTWARE.
(eval-when (:load-toplevel :execute)
(oos 'load-op 'cffi-grovel)
(oos 'load-op 'trivial-features))
(defsystem trivial-features-tests
:description "Unit tests for TRIVIAL-FEATURES."
:depends-on (trivial-features rt cffi alexandria)
:components
((:module tests
:serial t
:components
((:file "package")
#-windows (cffi-grovel:grovel-file "utsname")
#+windows (:file "sysinfo")
(:file "tests")))))
(defmethod perform
((o test-op) (c (eql (find-system 'trivial-features-tests))))
(let ((*package* (find-package 'trivial-features-tests)))
(funcall (find-symbol (symbol-name '#:do-tests)))))
;; vim: ft=lisp et
| 1,933 | Common Lisp | .asd | 44 | 41.727273 | 70 | 0.724668 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 7ef210c532d956d8ed93af8c978b526a8c2e640280758096a66d195f243ce43b | 21,762 | [
145552
] |
21,763 | trivial-features.asd | rheaplex_minara/lib/trivial-features/trivial-features.asd | ;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; trivial-features.asd --- ASDF system definition.
;;;
;;; Copyright (C) 2007, Luis Oliveira <[email protected]>
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
;;; files (the "Software"), to deal in the Software without
;;; restriction, including without limitation the rights to use, copy,
;;; modify, merge, publish, distribute, sublicense, and/or sell copies
;;; of the Software, and to permit persons to whom the Software is
;;; furnished to do so, subject to the following conditions:
;;;
;;; The above copyright notice and this permission notice shall be
;;; included in all copies or substantial portions of the Software.
;;;
;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
;;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
;;; DEALINGS IN THE SOFTWARE.
#-(or sbcl clisp allegro openmcl lispworks ecl cmu scl cormanlisp)
(error "Sorry, your Lisp is not supported. Patches welcome.")
(defsystem trivial-features
:description "Ensures consistent *FEATURES* across multiple CLs."
:author "Luis Oliveira <[email protected]>"
:version "0.4"
:licence "MIT"
:components
((:module src
:serial t
:components
(#+allegro (:file "tf-allegro")
#+clisp (:file "tf-clisp")
#+cmu (:file "tf-cmucl")
#+cormanlisp (:file "tf-cormanlisp")
#+ecl (:file "tf-ecl")
#+lispworks (:file "tf-lispworks")
#+openmcl (:file "tf-openmcl")
#+sbcl (:file "tf-sbcl")
#+scl (:file "tf-scl")
))))
(defmethod perform ((o test-op) (c (eql (find-system 'trivial-features))))
(operate 'load-op 'trivial-features-tests)
(operate 'test-op 'trivial-features-tests))
;; vim: ft=lisp et
| 2,191 | Common Lisp | .asd | 50 | 41.28 | 74 | 0.699579 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | b8ba57c8725c8ca41544ca031c1528de39fb87a84ba996a20303d08b97d864e2 | 21,763 | [
495352
] |
21,765 | alexandria.asd | rheaplex_minara/lib/alexandria/alexandria.asd | (defsystem :alexandria
:version "0.0.0"
:licence "Public Domain / 0-clause MIT"
:components
((:static-file "LICENCE")
(:static-file "tests.lisp")
(:file "package")
(:file "definitions" :depends-on ("package"))
(:file "binding" :depends-on ("package"))
(:file "strings" :depends-on ("package"))
(:file "conditions" :depends-on ("package"))
(:file "hash-tables" :depends-on ("package"))
(:file "io" :depends-on ("package" "macros" "lists"))
(:file "macros" :depends-on ("package" "strings" "symbols"))
(:file "control-flow" :depends-on ("package" "definitions" "macros"))
(:file "symbols" :depends-on ("package"))
(:file "functions" :depends-on ("package" "symbols" "macros"))
(:file "lists" :depends-on ("package" "functions"))
(:file "types" :depends-on ("package" "symbols" "lists"))
(:file "arrays" :depends-on ("package" "types"))
(:file "sequences" :depends-on ("package" "lists" "types"))
(:file "numbers" :depends-on ("package" "sequences"))
(:file "features" :depends-on ("package" "control-flow"))))
(defmethod operation-done-p ((o test-op) (c (eql (find-system :alexandria))))
nil)
(defmethod perform ((o test-op) (c (eql (find-system :alexandria))))
(operate 'load-op :alexandria-tests)
(operate 'test-op :alexandria-tests)) | 1,304 | Common Lisp | .asd | 28 | 43.107143 | 77 | 0.647843 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 5d64f1d8c2095e4495b7e2471e2b8aa1a7e83aeaeccf69609e6ac78f6f2f22f1 | 21,765 | [
-1
] |
21,766 | cl-colors.asd | rheaplex_minara/lib/cl-colors/cl-colors.asd | (defpackage #:cl-colors-asd
(:use :cl :asdf))
(in-package :cl-colors-asd)
(defsystem #:cl-colors
:description "Simple color library for Common Lisp"
:version "0.1"
:author "Tamas K Papp"
:license "GPL"
:components ((:file "package")
(:file "colors" :depends-on ("package"))
(:file "colornames" :depends-on ("colors")))
:depends-on (:cl-utilities))
| 387 | Common Lisp | .asd | 12 | 28 | 55 | 0.643432 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | f9de0a5f114583db24b6516e4d1871df0fb72a0f7b830f4a1f10d12faa0b962a | 21,766 | [
-1
] |
21,767 | cl-opengl.asd | rheaplex_minara/lib/cl-opengl/cl-opengl.asd | ;;; -*- Mode: Lisp; indent-tabs-mode: nil -*-
;;;
;;; Copyright (c) 2004, Oliver Markovic <[email protected]>
;;; All rights reserved.
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions are met:
;;;
;;; o Redistributions of source code must retain the above copyright notice,
;;; this list of conditions and the following disclaimer.
;;; o Redistributions in binary form must reproduce the above copyright
;;; notice, this list of conditions and the following disclaimer in the
;;; documentation and/or other materials provided with the distribution.
;;; o Neither the name of the author nor the names of the contributors may be
;;; used to endorse or promote products derived from this software without
;;; specific prior written permission.
;;;
;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
;;; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
;;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
;;; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
;;; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
;;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
;;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
;;; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
;;; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
;;; POSSIBILITY OF SUCH DAMAGE.
(defsystem cl-opengl
:depends-on (cffi)
:components
((:module "gl"
:components
((:file "bindings-package")
(:file "bindings" :depends-on ("bindings-package"))
(:file "types" :depends-on ("bindings-package"))
(:file "library" :depends-on ("bindings-package"))
(:file "constants" :depends-on ("bindings"))
(:file "funcs" :depends-on ("bindings" "constants" "library" "types"))
;; Lispifications.
(:file "package" :depends-on ("bindings-package"))
(:file "util" :depends-on ("constants" "types" "package"))
(:file "opengl" :depends-on ("funcs" "util"))
(:file "rasterization" :depends-on ("funcs" "util"))
(:file "framebuffer" :depends-on ("funcs" "util"))
(:file "special" :depends-on ("funcs" "util" "constants"))
(:file "state" :depends-on ("funcs" "util"))
(:file "extensions" :depends-on ("funcs" "util"))))))
| 2,559 | Common Lisp | .asd | 48 | 50.541667 | 79 | 0.710359 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 312b2cc0ebac01c9099ebc78dbe8b65b02aeb0aba9984bf4752b618915496a9a | 21,767 | [
411759
] |
21,768 | cl-glut-examples.asd | rheaplex_minara/lib/cl-opengl/cl-glut-examples.asd | ;;; -*- Mode: Lisp; indent-tabs-mode: nil -*-
;;;
;;; cl-glut-examples.asd --- ASDF system definition for various examples.
;;;
;;; Copyright (c) 2006-2007, Luis Oliveira <[email protected]>
;;; All rights reserved.
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;;
;;; o Redistributions of source code must retain the above copyright
;;; notice, this list of conditions and the following disclaimer.
;;; o Redistributions in binary form must reproduce the above copyright
;;; notice, this list of conditions and the following disclaimer in the
;;; documentation and/or other materials provided with the distribution.
;;; o Neither the name of the author nor the names of the contributors may
;;; be used to endorse or promote products derived from this software
;;; without specific prior written permission.
;;;
;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
;;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
;;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
;;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
;;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
;;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
;;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
;;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
;;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
;;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
(defsystem cl-glut-examples
:description "Examples using cl-opengl, cl-glu and cl-glut."
:depends-on (cffi cl-opengl cl-glu cl-glut)
:components
((:module "examples"
:components
((:file "examples")
(:module "redbook"
:depends-on ("examples")
:components
((:file "hello")
(:file "double")
(:file "lines")
(:file "polys")
(:file "cube")
(:file "model")
(:file "clip")
(:file "planet")
(:file "robot")
(:file "list")
(:file "stroke")
(:file "smooth")
(:file "movelight")))
(:module "mesademos"
:depends-on ("examples")
:components
((:file "gears-raw")
#+nil(:file "bounce")
#+nil(:file "gamma")
(:file "gears")
#+nil(:file "offset")
#+nil(:file "reflect")
#+nil(:file "spin")
#+nil(:file "tess-demo")
#+nil(:file "texobj")
#+nil(:file "trdemo")))
(:module "misc"
:depends-on ("examples")
:components
((:file "glut-teapot")
(:file "render-to-texture")
(:file "opengl-array")))))))
;;; vim: ft=lisp et
| 2,901 | Common Lisp | .asd | 74 | 34.851351 | 75 | 0.665841 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | af64310f263d82a504c81f2c7134830ee2ab79846fce96512d2cb2cfc773d56f | 21,768 | [
313421
] |
21,769 | cl-glut.asd | rheaplex_minara/lib/cl-opengl/cl-glut.asd | ;;; -*- Mode: Lisp; indent-tabs-mode: nil -*-
;;;
;;; cl-glut.asd --- ASDF system definition for cl-glut.
;;;
;;; Copyright (C) 2006, Luis Oliveira <[email protected]>
;;; All rights reserved.
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;;
;;; o Redistributions of source code must retain the above copyright
;;; notice, this list of conditions and the following disclaimer.
;;; o Redistributions in binary form must reproduce the above copyright
;;; notice, this list of conditions and the following disclaimer in the
;;; documentation and/or other materials provided with the distribution.
;;; o Neither the name of the author nor the names of the contributors may
;;; be used to endorse or promote products derived from this software
;;; without specific prior written permission.
;;;
;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
;;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
;;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
;;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
;;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
;;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
;;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
;;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
;;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
;;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
(defsystem cl-glut
:description "Common Lisp bindings to Freeglut."
:author "Luis Oliveira <[email protected]>"
:version "0.1.0"
:licence "BSD"
:depends-on (cffi cl-opengl)
:components
((:module "glut"
:components
((:file "package")
(:file "library" :depends-on ("package"))
(:file "state" :depends-on ("library"))
(:file "init" :depends-on ("library" "state"))
(:file "main" :depends-on ("library" "init"))
(:file "window" :depends-on ("library"))
(:file "overlay" :depends-on ("library"))
(:file "menu" :depends-on ("library"))
(:file "callbacks" :depends-on ("library"))
(:file "misc" :depends-on ("library"))
(:file "fonts" :depends-on ("library"))
(:file "geometry" :depends-on ("library"))
(:file "interface"
:depends-on ("init" "main" "window" "library" "callbacks"))))))
;; vim: ft=lisp et
| 2,672 | Common Lisp | .asd | 55 | 45.836364 | 75 | 0.695602 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | a7f25e61deb1e4e341d4d2f29629cb5f165ebc5899902890cd68cac4785d103f | 21,769 | [
237941
] |
21,770 | cl-glu.asd | rheaplex_minara/lib/cl-opengl/cl-glu.asd | ;;; -*- Mode: Lisp; indent-tabs-mode: nil -*-
;;;
;;; cl-glu.asd --- ASDF system definition for cl-glu.
;;;
;;; Copyright (C) 2006, Luis Oliveira <[email protected]>
;;; All rights reserved.
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;;
;;; o Redistributions of source code must retain the above copyright
;;; notice, this list of conditions and the following disclaimer.
;;; o Redistributions in binary form must reproduce the above copyright
;;; notice, this list of conditions and the following disclaimer in the
;;; documentation and/or other materials provided with the distribution.
;;; o Neither the name of the author nor the names of the contributors may
;;; be used to endorse or promote products derived from this software
;;; without specific prior written permission.
;;;
;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
;;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
;;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
;;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
;;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
;;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
;;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
;;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
;;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
;;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
(defsystem cl-glu
:description "Common Lisp bindings to the GLU API v1.3"
:author "Luis Oliveira <[email protected]>"
:version "0.1.0"
:licence "BSD"
:depends-on (cffi cl-opengl)
:components
((:module "glu"
:serial t
:components
((:file "package")
(:file "library")
(:file "glu")))))
;; vim: ft=lisp et
| 2,081 | Common Lisp | .asd | 45 | 44.4 | 75 | 0.737463 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 00627fbab5c837fd7be3b8573a2c9f621eccbf1b2cab4966e31050294da4540f | 21,770 | [
173088
] |
21,771 | cffi-grovel.asd | rheaplex_minara/lib/cffi/cffi-grovel.asd | ;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; cffi-grovel.asd --- ASDF system definition for cffi-grovel.
;;;
;;; Copyright (C) 2007, Luis Oliveira <[email protected]>
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
;;; files (the "Software"), to deal in the Software without
;;; restriction, including without limitation the rights to use, copy,
;;; modify, merge, publish, distribute, sublicense, and/or sell copies
;;; of the Software, and to permit persons to whom the Software is
;;; furnished to do so, subject to the following conditions:
;;;
;;; The above copyright notice and this permission notice shall be
;;; included in all copies or substantial portions of the Software.
;;;
;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
;;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
;;; DEALINGS IN THE SOFTWARE.
;;;
(asdf:defsystem cffi-grovel
:description "The CFFI Groveller"
:author "Dan Knapp <[email protected]>"
:depends-on (cffi alexandria)
:licence "MIT"
:components
((:module grovel
:serial t
:components
((:file "grovel")
(:file "asdf")))))
;; vim: ft=lisp et
| 1,577 | Common Lisp | .asd | 38 | 39.684211 | 70 | 0.731945 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 37295cc4a2a25cf561e9c84f41cdca06ae22c6ed8bb733bb7f876c45681b2922 | 21,771 | [
81242
] |
21,774 | cffi.asd | rheaplex_minara/lib/cffi/cffi.asd | ;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; cffi.asd --- ASDF system definition for CFFI.
;;;
;;; Copyright (C) 2005-2006, James Bielman <[email protected]>
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
;;; files (the "Software"), to deal in the Software without
;;; restriction, including without limitation the rights to use, copy,
;;; modify, merge, publish, distribute, sublicense, and/or sell copies
;;; of the Software, and to permit persons to whom the Software is
;;; furnished to do so, subject to the following conditions:
;;;
;;; The above copyright notice and this permission notice shall be
;;; included in all copies or substantial portions of the Software.
;;;
;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
;;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
;;; DEALINGS IN THE SOFTWARE.
;;;
#-(or openmcl sbcl cmu scl clisp lispworks ecl allegro cormanlisp)
(error "Sorry, this Lisp is not yet supported. Patches welcome!")
(defsystem cffi
:description "The Common Foreign Function Interface"
:author "James Bielman <[email protected]>"
:version "0.10.3"
:licence "MIT"
:depends-on (alexandria trivial-features babel)
:components
((:module src
:serial t
:components
(#+openmcl (:file "cffi-openmcl")
#+sbcl (:file "cffi-sbcl")
#+cmu (:file "cffi-cmucl")
#+scl (:file "cffi-scl")
#+clisp (:file "cffi-clisp")
#+lispworks (:file "cffi-lispworks")
#+ecl (:file "cffi-ecl")
#+allegro (:file "cffi-allegro")
#+cormanlisp (:file "cffi-corman")
(:file "package")
(:file "utils")
(:file "libraries")
(:file "early-types")
(:file "types")
(:file "enum")
(:file "strings")
(:file "functions")
(:file "foreign-vars")
(:file "features")))))
(defmethod operation-done-p ((o test-op) (c (eql (find-system :cffi))))
nil)
(defmethod perform ((o test-op) (c (eql (find-system :cffi))))
(operate 'asdf:load-op :cffi-tests)
(operate 'asdf:test-op :cffi-tests))
;; vim: ft=lisp et
| 2,517 | Common Lisp | .asd | 63 | 36.936508 | 71 | 0.679461 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 75f80135d722f00005c96b4a3b752120aeb0f812ea7b7da82948f30cb6a54a9e | 21,774 | [
-1
] |
21,775 | cffi-tests.asd | rheaplex_minara/lib/cffi/cffi-tests.asd | ;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; cffi-tests.asd --- ASDF system definition for CFFI unit tests.
;;;
;;; Copyright (C) 2005-2006, James Bielman <[email protected]>
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
;;; files (the "Software"), to deal in the Software without
;;; restriction, including without limitation the rights to use, copy,
;;; modify, merge, publish, distribute, sublicense, and/or sell copies
;;; of the Software, and to permit persons to whom the Software is
;;; furnished to do so, subject to the following conditions:
;;;
;;; The above copyright notice and this permission notice shall be
;;; included in all copies or substantial portions of the Software.
;;;
;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
;;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
;;; DEALINGS IN THE SOFTWARE.
;;;
(defpackage #:cffi-tests-system
(:use #:cl #:asdf))
(in-package #:cffi-tests-system)
(defvar *tests-dir* (append (pathname-directory *load-truename*) '("tests")))
(defclass c-test-lib (c-source-file)
())
(defmethod perform ((o load-op) (c c-test-lib))
nil)
(defmethod perform ((o load-source-op) (c c-test-lib))
nil)
(defmethod perform ((o compile-op) (c c-test-lib))
#-(or win32 mswindows)
(unless (zerop (run-shell-command
"cd ~A; make"
(namestring (make-pathname :name nil :type nil
:directory *tests-dir*))))
(error 'operation-error :component c :operation o)))
;; For the convenience of ECL users.
#+ecl (require 'rt)
(defsystem cffi-tests
:description "Unit tests for CFFI."
:depends-on (cffi #-ecl rt)
:components
((:module "tests"
:serial t
:components
((:c-test-lib "libtest")
(:file "package")
(:file "bindings")
(:file "funcall")
(:file "defcfun")
(:file "callbacks")
(:file "foreign-globals")
(:file "memory")
(:file "strings")
(:file "struct")
(:file "union")
(:file "enum")
(:file "misc-types")
(:file "misc")))))
(defmethod operation-done-p ((o test-op) (c (eql (find-system :cffi-tests))))
nil)
(defmethod perform ((o test-op) (c (eql (find-system :cffi-tests))))
(flet ((run-tests (&rest args)
(apply (intern (string '#:run-cffi-tests) '#:cffi-tests) args)))
(run-tests :compiled nil)
(run-tests :compiled t)))
;;; vim: ft=lisp et
| 2,858 | Common Lisp | .asd | 74 | 34.702703 | 77 | 0.666426 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 3e76c1a9aae8534671e83e3d2764df84b356bf4851d08d735a86643dd7415301 | 21,775 | [
-1
] |
21,777 | cl-utilities.asd | rheaplex_minara/lib/cl-utilities/cl-utilities.asd | ;; -*- Lisp -*-
(defpackage #:cl-utilities-system
(:use #:common-lisp #:asdf))
(in-package #:cl-utilities-system)
(defsystem cl-utilities
:author "Maintained by Peter Scott"
:components ((:file "package")
(:file "split-sequence" :depends-on ("package"))
(:file "extremum" :depends-on ("package"
"with-unique-names"
"once-only"))
(:file "read-delimited" :depends-on ("package"))
(:file "expt-mod" :depends-on ("package"))
(:file "with-unique-names" :depends-on ("package"))
(:file "collecting" :depends-on ("package"
"with-unique-names"
"compose"))
(:file "once-only" :depends-on ("package"))
(:file "rotate-byte" :depends-on ("package"))
(:file "copy-array" :depends-on ("package"))
(:file "compose" :depends-on ("package"))))
;; Sometimes we can accelerate byte rotation on SBCL by using the
;; SB-ROTATE-BYTE extension. This loads it.
#+sbcl
(eval-when (:compile-toplevel :load-toplevel :execute)
(handler-case (progn
(require :sb-rotate-byte)
(pushnew :sbcl-uses-sb-rotate-byte *features*))
(error () (delete :sbcl-uses-sb-rotate-byte *features*)))) | 1,138 | Common Lisp | .asd | 29 | 35.310345 | 65 | 0.657324 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 45a52cdc73080195ce2d9792736a979d133106533401bf2fd317d3e461baffdd | 21,777 | [
151293
] |
21,778 | babel.asd | rheaplex_minara/lib/babel/babel.asd | ;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; babel.asd --- ASDF system definition for Babel.
;;;
;;; Copyright (C) 2007, Luis Oliveira <[email protected]>
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
;;; files (the "Software"), to deal in the Software without
;;; restriction, including without limitation the rights to use, copy,
;;; modify, merge, publish, distribute, sublicense, and/or sell copies
;;; of the Software, and to permit persons to whom the Software is
;;; furnished to do so, subject to the following conditions:
;;;
;;; The above copyright notice and this permission notice shall be
;;; included in all copies or substantial portions of the Software.
;;;
;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
;;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
;;; DEALINGS IN THE SOFTWARE.
(defsystem babel
:description "Babel, a charset conversion library."
:author "Luis Oliveira <[email protected]>"
:version "0.3.0"
:licence "MIT"
:depends-on (trivial-features alexandria)
:components
((:module src
:serial t
:components
((:file "packages")
(:file "encodings")
(:file "enc-ascii")
(:file "enc-ebcdic")
(:file "enc-iso-8859")
(:file "enc-unicode")
(:file "external-format")
(:file "strings")
(:file "sharp-backslash")))))
(defmethod perform ((o test-op) (c (eql (find-system :babel))))
(operate 'load-op :babel-tests)
(operate 'test-op :babel-tests))
(defmethod operation-done-p ((o test-op) (c (eql (find-system :babel))))
nil)
;;; vim: ft=lisp et
| 2,022 | Common Lisp | .asd | 50 | 37.92 | 72 | 0.70935 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 91b08dab8687feb5ce6d27425c38558696b021257d7d8d545693cc4f2ad12ab6 | 21,778 | [
315706
] |
21,779 | babel-tests.asd | rheaplex_minara/lib/babel/babel-tests.asd | ;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; babel-tests.asd --- ASDF system definition for Babel unit tests.
;;;
;;; Copyright (C) 2007, Luis Oliveira <[email protected]>
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
;;; files (the "Software"), to deal in the Software without
;;; restriction, including without limitation the rights to use, copy,
;;; modify, merge, publish, distribute, sublicense, and/or sell copies
;;; of the Software, and to permit persons to whom the Software is
;;; furnished to do so, subject to the following conditions:
;;;
;;; The above copyright notice and this permission notice shall be
;;; included in all copies or substantial portions of the Software.
;;;
;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
;;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
;;; DEALINGS IN THE SOFTWARE.
(defsystem babel-tests
:description "Unit tests for Babel."
:depends-on (babel stefil)
:components
((:module "tests"
:serial t
:components
((:file "tests")))))
(defmethod perform ((o test-op) (c (eql (find-system :babel-tests))))
(funcall (intern (string '#:run-tests) '#:babel-tests)))
(defmethod operation-done-p ((o test-op) (c (eql (find-system :babel-tests))))
nil)
;;; vim: ft=lisp et
| 1,712 | Common Lisp | .asd | 38 | 43.315789 | 78 | 0.727545 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | fa274aa392360f898755585a2ab5e6826613db9291f85d928b7d7a240298ed04 | 21,779 | [
308002
] |
21,781 | flexichain.asd | rheaplex_minara/lib/flexichain/flexichain.asd | ;;; Flexichain
;;; ASDF system definition
;;;
;;; Copyright (C) 2003-2004 Robert Strandh ([email protected])
;;; Copyright (C) 2003-2004 Matthieu Villeneuve ([email protected])
;;;
;;; This library is free software; you can redistribute it and/or
;;; modify it under the terms of the GNU Lesser General Public
;;; License as published by the Free Software Foundation; either
;;; version 2.1 of the License, or (at your option) any later version.
;;;
;;; This library is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;;; Lesser General Public License for more details.
;;;
;;; You should have received a copy of the GNU Lesser General Public
;;; License along with this library; if not, write to the Free Software
;;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
;; The tester is not included, for it depends on clim. The stupid
;; implementation has also been left out, since it seems mostly useful
;; for testing.
(asdf:defsystem :flexichain
:name "flexichain"
:version "1.2"
:components ((:file "flexichain-package")
(:file "utilities" :depends-on ("flexichain-package"))
(:file "flexichain" :depends-on ("utilities" "flexichain-package"))
(:file "flexicursor" :depends-on ("flexichain"))
(:file "flexirank" :depends-on ("flexichain"))))
| 1,487 | Common Lisp | .asd | 30 | 46.266667 | 82 | 0.713402 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | be07a109793bdebfee91924a678399b20f0c403b00b009f4ef52497ec28fe4f3 | 21,781 | [
-1
] |
21,782 | cl-cairo2-mac.asd | rheaplex_minara/lib/cl-cairo2/cl-cairo2-mac.asd | ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
(defpackage #:cl-cairo2-mac-asd
(:use :cl :asdf :cl-cairo2))
(in-package #:cl-cairo2-mac-asd)
(defsystem cl-cairo2-mac
:description "Cairo 1.6 bindings, X11, GTK and Quartz(not yet) extension"
:version "0.1"
:author "Tamas K Papp, Kei Suzuki"
:license "GPL"
:components ((:file "cl-cairo2-mac-swig")
(:file "libraries-x11" :depends-on ("cl-cairo2-mac-swig"))
(:file "xlib" :depends-on ("libraries-x11"))
(:file "xlib-image-context" :depends-on ("xlib"))
(:file "gtk-context" :depends-on ("libraries-x11")))
:depends-on (:cl-cairo2))
| 642 | Common Lisp | .asd | 15 | 38.533333 | 75 | 0.6416 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 6e4554077e812885f11b0ee20bbc21a8b85841cd8710a0b769977ae4050e387a | 21,782 | [
-1
] |
21,783 | cl-cairo2-win.asd | rheaplex_minara/lib/cl-cairo2/cl-cairo2-win.asd | ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
(defpackage #:cl-cairo2-win-asd
(:use :cl :asdf :cl-cairo2))
(in-package #:cl-cairo2-win-asd)
(defsystem cl-cairo2-win
:description "Cairo 1.6 bindings, MS-Windows extension"
:version "0.1"
:author "Tamas K Papp, Kei Suzuki"
:license "GPL"
:components ((:file "cl-cairo2-win-swig")
(:file "win32" :depends-on ("cl-cairo2-win-swig")))
:depends-on (:cl-cairo2))
| 444 | Common Lisp | .asd | 12 | 34 | 59 | 0.662791 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 7e63c31e8f10d869c6113fcd6d2052ca477def89765073a8ddff282dcf69bde3 | 21,783 | [
-1
] |
21,784 | cl-cairo2.asd | rheaplex_minara/lib/cl-cairo2/cl-cairo2.asd | (defpackage #:cl-cairo2-asd
(:use :cl :asdf))
(in-package #:cl-cairo2-asd)
(defsystem cl-cairo2
:description "Cairo 1.6 bindings"
:version "0.4"
:author "Tamas K Papp"
:license "GPL"
:components ((:file "package")
(:file "cairo" :depends-on ("package"))
(:file "my-double" :depends-on ("package"))
(:file "cl-cairo2-swig" :depends-on ("cairo" "my-double"))
(:file "tables" :depends-on ("cl-cairo2-swig"))
(:file "surface" :depends-on ("cairo" "tables" "cl-cairo2-swig"))
(:file "context" :depends-on ("surface" "tables" "cl-cairo2-swig"))
(:file "pattern" :depends-on ("context" "surface" "tables"
"cl-cairo2-swig"
"transformations"))
(:file "path" :depends-on ("context"))
(:file "text" :depends-on ("context"))
(:file "transformations" :depends-on ("context")))
:depends-on (:cffi :cl-colors :cl-utilities :trivial-garbage
:trivial-features))
| 1,032 | Common Lisp | .asd | 23 | 35.73913 | 82 | 0.566038 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 688d6bade4c1441d5780867c67524dbca045716793872c4880567faba1529c27 | 21,784 | [
-1
] |
21,785 | cl-cairo2-x11.asd | rheaplex_minara/lib/cl-cairo2/cl-cairo2-x11.asd | (defpackage #:cl-cairo2-x11-asd
(:use :cl :asdf))
(in-package #:cl-cairo2-x11-asd)
(defsystem cl-cairo2-x11
:description "Cairo 1.6 bindings, X11 and GTK extension"
:version "0.1"
:author "Tamas K Papp"
:license "GPL"
:serial t
:components ((:file "cl-cairo2-x11-swig")
(:file "libraries-x11" :depends-on ("cl-cairo2-x11-swig"))
(:file "xlib" :depends-on ("libraries-x11"))
(:file "xlib-image-context" :depends-on ("xlib"))
(:file "gtk-context" :depends-on ("libraries-x11")))
:depends-on (:cl-cairo2))
| 553 | Common Lisp | .asd | 15 | 32.533333 | 66 | 0.643657 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 92ae19f5c09c50f0343beafd9e79485e35a8f252414ecd72602e31017ca2fe60 | 21,785 | [
-1
] |
21,786 | minara.asd | rheaplex_minara/src/minara.asd | (defpackage :minara
(:use :cl :asdf))
(in-package :minara)
(asdf:defsystem :minara
:name "minara"
:version "0.1"
:depends-on (:flexichain :cl-cairo2 :cl-opengl :cl-glu :cl-glut)
:serial t
:components
((:file "packages")
(:file "test")
(:file "transformations")
(:file "events")
(:file "keymap")
(:file "buffer")
(:file "evaluation")
(:file "window")
(:file "cairo-rendering")
(:file "glut-gui")
(:file "minibuffer")
(:file "undo")
;;(:file "buffer-stream")
(:file "command-line")
(:file "menu")
(:file "geometry")
;;(:file "picking")
(:file "tool")
(:file "minara")
))
;;(load "view-tools.lisp")
;;; (load "colour-tools.lisp")
;;-
;;; (load "pen-tools.lisp")
;;;(load "shape-tools.lisp") | 983 | Common Lisp | .asd | 34 | 19.235294 | 80 | 0.460317 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 75683dc9c9e0cb07a58f8bbb6f673c6293aef71925415a105e16144b9a305032 | 21,786 | [
-1
] |
21,800 | install | rheaplex_minara/tools/pstoedit/install | Installation.
Download the pstoedit sources.
Add drvminara.c and drvminara.h to the pstoedit/src directory.
Add the following line to the specific_drivers_src section
of pstoedit/src/makefile.am:
drvminara.cpp drvminara.h \
Run automake and then .configure && make && make install .
If anyone knows how to make dynamically loadable pstoedit drivers, let me know...
| 370 | Common Lisp | .l | 8 | 44.875 | 81 | 0.805556 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 190bf63e058af94f11f3bd092c148b6d2db1591f8c40d5bd17ed2b0a23d1be97 | 21,800 | [
-1
] |
21,803 | release.sh | rheaplex_minara/lib/trivial-garbage/release.sh | #!/bin/bash
### Configuration
PROJECT_NAME='trivial-garbage'
ASDF_FILE="$PROJECT_NAME.asd"
HOST="common-lisp.net"
RELEASE_DIR="public_html/tarballs/$PROJECT_NAME"
VERSION_FILE=""
#VERSION_FILE="VERSION"
#VERSION_FILE_DIR="/project/$PROJECT_NAME/public_html"
set -e
### Process options
FORCE=0
VERSION=""
while [ $# -gt 0 ]; do
case "$1" in
-h|--help)
echo "No help, sorry. Read the source."
exit 0
;;
-f|--force)
FORCE=1
shift
;;
-v|--version)
VERSION="$2"
shift 2
;;
*)
echo "Unrecognized argument '$1'"
exit 1
;;
esac
done
### Check for unrecorded changes
if darcs whatsnew; then
echo -n "Unrecorded changes. "
if [ "$FORCE" -ne 1 ]; then
echo "Aborting."
echo "Use -f or --force if you want to make a release anyway."
exit 1
else
echo "Continuing anyway."
fi
fi
### Determine new version number
if [ -z "$VERSION" ]; then
CURRENT_VERSION=$(grep :version $ASDF_FILE | cut -d\" -f2)
dots=$(echo "$CURRENT_VERSION" | tr -cd '.')
count=$(expr length "$dots" + 1)
declare -a versions
for i in $(seq $count); do
new=""
for j in $(seq $(expr $i - 1)); do
p=$(echo "$CURRENT_VERSION" | cut -d. -f$j)
new="$new$p."
done
part=$(expr 1 + $(echo "$CURRENT_VERSION" | cut -d. -f$i))
new="$new$part"
for j in $(seq $(expr $i + 1) $count); do new="$new.0"; done
versions[$i]=$new
done
while true; do
echo "Current version is $CURRENT_VERSION. Which will be the next one?"
for i in $(seq $count); do echo " $i) ${versions[$i]}"; done
echo -n "? "
read choice
if ((choice > 0)) && ((choice <= ${#versions[@]})); then
VERSION=${versions[$choice]}
break
fi
done
fi
### Do it
TARBALL_NAME="${PROJECT_NAME}_${VERSION}"
TARBALL="$TARBALL_NAME.tar.gz"
SIGNATURE="$TARBALL.asc"
echo "Updating $ASDF_FILE with new version: $VERSION"
sed -e "s/:version \"$CURRENT_VERSION\"/:version \"$VERSION\"/" \
"$ASDF_FILE" > "$ASDF_FILE.tmp"
mv "$ASDF_FILE.tmp" "$ASDF_FILE"
darcs record -m "update $ASDF_FILE for version $VERSION"
echo "Tagging the tree..."
darcs tag "$VERSION"
echo "Creating distribution..."
darcs dist -d "$TARBALL_NAME"
echo "Signing tarball..."
gpg -b -a "$TARBALL"
echo "Copying tarball to web server..."
scp "$TARBALL" "$SIGNATURE" "$HOST:$RELEASE_DIR"
echo "Uploaded $TARBALL and $SIGNATURE."
echo "Updating ${PROJECT_NAME}_latest links..."
ssh $HOST ln -sf "$TARBALL" "$RELEASE_DIR/${PROJECT_NAME}_latest.tar.gz"
ssh $HOST ln -sf "$SIGNATURE" "$RELEASE_DIR/${PROJECT_NAME}_latest.tar.gz.asc"
if [ "$VERSION_FILE" ]; then
echo "Uploading $VERSION_FILE..."
echo -n "$VERSION" > "$VERSION_FILE"
scp "$VERSION_FILE" "$HOST":"$VERSION_FILE_DIR"
rm "$VERSION_FILE"
fi
while true; do
echo -n "Clean local tarball and signature? [y] "
read -n 1 response
case "$response" in
y|'')
echo
rm "$TARBALL" "$SIGNATURE"
break
;;
n)
break
;;
*)
echo "Invalid response '$response'. Try again."
;;
esac
done
#echo "Building and uploading documentation..."
#make -C doc upload-docs
echo "Pushing changes..."
darcs push
| 3,496 | Common Lisp | .l | 120 | 23.141667 | 79 | 0.575993 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 03f00766ed8605884fde39b4a7c953ea4412132240b134e42350b33c53b1ae89 | 21,803 | [
-1
] |
21,841 | Makefile | rheaplex_minara/lib/alexandria/doc/Makefile | .PHONY: clean html pdf
clean:
rm -rf include *.aux *.cp *.fn *.fns *.ky *.log *.pg *.toc *.tp *.tps *.vr *.pdf *.html
# Hook into the super sekrit texinfo generator in the SBCL tree -- this is just a quick way
# to bootrap documentation for now.
include:
sbcl --eval '(progn (require :asdf) (require :alexandria) (rename-package :alexandria :alexandria))' \
--eval '(load (merge-pathnames "doc/manual/docstrings" (posix-getenv "SBCL_SOURCE_ROOT")))' \
--eval '(sb-texinfo:generate-includes "include/" :alexandria)' \
--eval '(quit)'
mv include/fun-alexandria-type=.texinfo include/fun-alexandria-type-equal.texinfo
pdf: include
texi2pdf alexandria.texinfo
html: include
texi2html alexandria.texinfo
| 711 | Common Lisp | .l | 15 | 45.6 | 103 | 0.732659 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 9ac2b435c0ae5cb2baefc5d377992ce3844fc6f56b284103b3c7b36ed906a661 | 21,841 | [
-1
] |
21,842 | alexandria.texinfo | rheaplex_minara/lib/alexandria/doc/alexandria.texinfo | \input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename alexandria.info
@settitle Alexandria Manual
@c %**end of header
@settitle Alexandria Manual -- draft version
@c for install-info
@dircategory Software development
@direntry
* alexandria: Common Lisp utilities.
@end direntry
@copying
@quotation
Alexandria software and associated documentation are in the public
domain:
Authors dedicate this work to public domain, for the benefit of the
public at large and to the detriment of the authors' heirs and
successors. Authors intends this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights under
copyright law, whether vested or contingent, in the work. Authors
understands that such relinquishment of all rights includes the
relinquishment of all rights to enforce (by lawsuit or otherwise)
those copyrights in the work.
Authors recognize that, once placed in the public domain, the work
may be freely reproduced, distributed, transmitted, used, modified,
built upon, or otherwise exploited by anyone for any purpose,
commercial or non-commercial, and in any way, including by methods
that have not yet been invented or conceived.
In those legislations where public domain dedications are not
recognized or possible, Alexandria is distributed under the following
terms and conditions:
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@end quotation
@end copying
@titlepage
@title Alexandria Manual
@subtitle draft version
@c The following two commands start the copyright page.
@page
@vskip 0pt plus 1filll
@insertcopying
@end titlepage
@contents
@ifnottex
@menu
* Hash Table Utilities::
* Higher Order Functions::
* List Manipulation::
* Sequence Manipulation::
* Macro Writing Utilities::
* Symbol Utilities::
* Array Utilities::
* Type Designator Manipulation::
* Mathematical Utilities::
* Features::
@end menu
@node Top
@comment node-name, next, previous, up
@top sbcl
@insertcopying
@menu
@end menu
@end ifnottex
@node Hash Table Utilities
@comment node-name, next, previous, up
@section Hash Table Utilities
@include include/fun-alexandria-copy-hash-table.texinfo
@include include/fun-alexandria-maphash-keys.texinfo
@include include/fun-alexandria-maphash-values.texinfo
@include include/fun-alexandria-hash-table-keys.texinfo
@include include/fun-alexandria-hash-table-values.texinfo
@include include/fun-alexandria-hash-table-alist.texinfo
@include include/fun-alexandria-hash-table-plist.texinfo
@include include/fun-alexandria-alist-hash-table.texinfo
@include include/fun-alexandria-plist-hash-table.texinfo
@node Higher Order Functions
@comment node-name, next, previous, up
@section Higher Order Functions
@include include/fun-alexandria-disjoin.texinfo
@include include/fun-alexandria-conjoin.texinfo
@include include/fun-alexandria-compose.texinfo
@include include/fun-alexandria-multiple-value-compose.texinfo
@include include/fun-alexandria-curry.texinfo
@include include/fun-alexandria-rcurry.texinfo
@node List Manipulation
@comment node-name, next, previous, up
@section List Manipulation
@include include/type-alexandria-proper-list.texinfo
@include include/type-alexandria-circular-list.texinfo
@include include/macro-alexandria-appendf.texinfo
@include include/macro-alexandria-nconcf.texinfo
@include include/fun-alexandria-circular-list.texinfo
@include include/fun-alexandria-circular-list-p.texinfo
@include include/fun-alexandria-circular-tree-p.texinfo
@include include/fun-alexandria-proper-list-p.texinfo
@include include/fun-alexandria-lastcar.texinfo
@include include/fun-alexandria-setf-lastcar.texinfo
@include include/fun-alexandria-make-circular-list.texinfo
@include include/fun-alexandria-ensure-list.texinfo
@include include/fun-alexandria-sans.texinfo
@include include/fun-alexandria-mappend.texinfo
@include include/fun-alexandria-map-product.texinfo
@include include/fun-alexandria-set-equal.texinfo
@include include/fun-alexandria-setp.texinfo
@include include/fun-alexandria-flatten.texinfo
@node Sequence Manipulation
@comment node-name, next, previous, up
@section Sequence Manipulation
@include include/type-alexandria-proper-sequence.texinfo
@include include/macro-alexandria-deletef.texinfo
@include include/macro-alexandria-removef.texinfo
@include include/fun-alexandria-rotate.texinfo
@include include/fun-alexandria-suffle.texinfo
@include include/fun-alexandria-random-elt.texinfo
@include include/fun-alexandria-emptyp.texinfo
@include include/fun-alexandria-sequence-of-length-p.texinfo
@include include/fun-alexandria-copy-sequence.texinfo
@include include/fun-alexandria-first-elt.texinfo
@include include/fun-alexandria-setf-first-elt.texinfo
@include include/fun-alexandria-last-elt.texinfo
@include include/fun-alexandria-setf-last-elt.texinfo
@include include/fun-alexandria-starts-with.texinfo
@include include/fun-alexandria-ends-with.texinfo
@node Macro Writing Utilities
@comment node-name, next, previous, up
@section Macro Writing Utilities
@include include/macro-alexandria-with-unique-names.texinfo
@include include/macro-alexandria-once-only.texinfo
@node Symbol Utilities
@comment node-name, next, previous, up
@section Symbol Utilities
@include include/fun-alexandria-ensure-symbol.texinfo
@include include/fun-alexandria-format-symbol.texinfo
@include include/fun-alexandria-make-keyword.texinfo
@include include/fun-alexandria-make-gensym-list.texinfo
@node Array Utilities
@comment node-name, next, previous, up
@section Array Utilities
@include include/type-alexandria-array-index.texinfo
@include include/fun-alexandria-copy-array.texinfo
@node Type Designator Manipulation
@comment node-name, next, previous, up
@section Type Designator Manipulation
@include include/fun-alexandria-of-type.texinfo
@include include/fun-alexandria-type-equal.texinfo
@include include/macro-alexandria-coercef.texinfo
@node Mathematical Utilities
@comment node-name, next, previous, up
@section Mathematical Utilities
@include include/macro-alexandria-maxf.texinfo
@include include/macro-alexandria-minf.texinfo
@include include/fun-alexandria-clamp.texinfo
@include include/fun-alexandria-lerp.texinfo
@include include/fun-alexandria-gaussian-random.texinfo
@include include/fun-alexandria-iota.texinfo
@include include/fun-alexandria-mean.texinfo
@include include/fun-alexandria-median.texinfo
@include include/fun-alexandria-variance.texinfo
@include include/fun-alexandria-standard-deviation.texinfo
@c FIXME: get a better section name
@node Features
@comment node-name, next, previous, up
@section Features
@include include/fun-alexandria-featurep.texinfo
@bye
| 7,673 | Common Lisp | .l | 178 | 41.05618 | 72 | 0.820988 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 97b6ac2b7b5853c365c7850737d4ae804fd7d9689bf509e96040a99e23cd31e9 | 21,842 | [
-1
] |
21,846 | Makefile | rheaplex_minara/lib/cl-colors/Makefile | ## note: this works on my system, you don't need to run it because the
## distribution contains the generated file
SBCL=/usr/bin/sbcl
colornames.lisp: /usr/share/X11/rgb.txt parse-x11.lisp
rm -f colornames.lisp
$(SBCL) --load parse-x11.lisp --eval '(quit)'
| 261 | Common Lisp | .l | 6 | 41.833333 | 70 | 0.747036 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 4058adf750cf804673fb819706f207412e9a348bad65f7691e6d4b8e88e101ff | 21,846 | [
-1
] |
21,852 | Makefile | rheaplex_minara/lib/cl-opengl/Makefile | # -*- Mode: Makefile; tab-width: 3; indent-tabs-mode: t -*-
enums:
@sbcl --noinform --disable-debugger --no-userinit --load "tools/generate-enums.lisp" --eval "(main)"
funcs:
@sbcl --noinform --disable-debugger --load "tools/generate-funcs.lisp" --eval "(spec-parser:main)"
specs:
cd spec && wget -N http://www.opengl.org/registry/api/enum.spec
cd spec && wget -N http://www.opengl.org/registry/api/enumext.spec
cd spec && wget -N http://www.opengl.org/registry/api/gl.spec
clean:
find . -name ".fasls" | xargs rm -rf
find . \( -name "*.dfsl" -o -name "*.fasl" -o -name "*.fas" -o -name "*.lib" -o -name "*.x86f" -o -name "*.ppcf" -o -name "*.nfasl" -o -name "*.fsl" \) -exec rm {} \;
.PHONY: enums funcs specs clean
# vim: ft=make ts=3 noet
| 754 | Common Lisp | .l | 14 | 52 | 167 | 0.651701 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 0b8ff1f894c4a3f33ee0126773a39be34480475a0c09ab50e4de8506fe2f56ca | 21,852 | [
-1
] |
21,856 | gl.tm | rheaplex_minara/lib/cl-opengl/tools/gl.tm | AccumOp,*,*, GLenum,*,*
AlphaFunction,*,*, GLenum,*,*
AttribMask,*,*, GLbitfield,*,*
BeginMode,*,*, GLenum,*,*
BinormalPointerTypeEXT,*,*, GLenum,*,*
BlendEquationMode,*,*, GLenum,*,*
BlendEquationModeEXT,*,*, GLenum,*,*
BlendFuncSeparateParameterEXT,*,*, GLenum,*,*
BlendingFactorDest,*,*, GLenum,*,*
BlendingFactorSrc,*,*, GLenum,*,*
Boolean,*,*, GLboolean,*,*
BooleanPointer,*,*, GLboolean*,*,*
Char,*,*, GLchar,*,*
CharPointer,*,*, GLchar*,*,*
CheckedFloat32,*,*, GLfloat,*,*
CheckedInt32,*,*, GLint,*,*
ClampColorTargetARB,*,*, GLenum,*,*
ClampColorModeARB,*,*, GLenum,*,*
ClampedColorF,*,*, GLclampf,*,*
ClampedFloat32,*,*, GLclampf,*,*
ClampedFloat64,*,*, GLclampd,*,*
ClampedStencilValue,*,*, GLint,*,*
ClearBufferMask,*,*, GLbitfield,*,*
ClientAttribMask,*,*, GLbitfield,*,*
ClipPlaneName,*,*, GLenum,*,*
ColorB,*,*, GLbyte,*,*
ColorD,*,*, GLdouble,*,*
ColorF,*,*, GLfloat,*,*
ColorI,*,*, GLint,*,*
ColorIndexValueD,*,*, GLdouble,*,*
ColorIndexValueF,*,*, GLfloat,*,*
ColorIndexValueI,*,*, GLint,*,*
ColorIndexValueS,*,*, GLshort,*,*
ColorIndexValueUB,*,*, GLubyte,*,*
ColorMaterialParameter,*,*, GLenum,*,*
ColorPointerType,*,*, GLenum,*,*
ColorS,*,*, GLshort,*,*
ColorTableParameterPName,*,*, GLenum,*,*
ColorTableParameterPNameSGI,*,*, GLenum,*,*
ColorTableTarget,*,*, GLenum,*,*
ColorTableTargetSGI,*,*, GLenum,*,*
ColorUB,*,*, GLubyte,*,*
ColorUI,*,*, GLuint,*,*
ColorUS,*,*, GLushort,*,*
CombinerBiasNV,*,*, GLenum,*,*
CombinerComponentUsageNV,*,*, GLenum,*,*
CombinerMappingNV,*,*, GLenum,*,*
CombinerParameterNV,*,*, GLenum,*,*
CombinerPortionNV,*,*, GLenum,*,*
CombinerRegisterNV,*,*, GLenum,*,*
CombinerScaleNV,*,*, GLenum,*,*
CombinerStageNV,*,*, GLenum,*,*
CombinerVariableNV,*,*, GLenum,*,*
CompressedTextureARB,*,*, GLvoid,*,*
ControlPointNV,*,*, GLvoid,*,*
ControlPointTypeNV,*,*, GLenum,*,*
ConvolutionParameter,*,*, GLenum,*,*
ConvolutionParameterEXT,*,*, GLenum,*,*
ConvolutionTarget,*,*, GLenum,*,*
ConvolutionTargetEXT,*,*, GLenum,*,*
CoordD,*,*, GLdouble,*,*
CoordF,*,*, GLfloat,*,*
CoordI,*,*, GLint,*,*
CoordS,*,*, GLshort,*,*
CullFaceMode,*,*, GLenum,*,*
CullParameterEXT,*,*, GLenum,*,*
DepthFunction,*,*, GLenum,*,*
DrawBufferMode,*,*, GLenum,*,*
DrawElementsType,*,*, GLenum,*,*
ElementPointerTypeATI,*,*, GLenum,*,*
EnableCap,*,*, GLenum,*,*
ErrorCode,*,*, GLenum,*,*
EvalMapsModeNV,*,*, GLenum,*,*
EvalTargetNV,*,*, GLenum,*,*
FeedbackElement,*,*, GLfloat,*,*
FeedbackType,*,*, GLenum,*,*
FenceNV,*,*, GLuint,*,*
FenceConditionNV,*,*, GLenum,*,*
FenceParameterNameNV,*,*, GLenum,*,*
FfdMaskSGIX,*,*, GLbitfield,*,*
FfdTargetSGIX,*,*, GLenum,*,*
Float32,*,*, GLfloat,*,*
Float32Pointer,*,*, GLfloat*,*,*
Float64,*,*, GLdouble,*,*
Float64Pointer,*,*, GLdouble*,*,*
FogParameter,*,*, GLenum,*,*
FogPointerTypeEXT,*,*, GLenum,*,*
FogPointerTypeIBM,*,*, GLenum,*,*
FragmentLightModelParameterSGIX,*,*,GLenum,*,*
FragmentLightNameSGIX,*,*, GLenum,*,*
FragmentLightParameterSGIX,*,*, GLenum,*,*
FramebufferAttachment,*,*, GLenum,*,*
FramebufferTarget,*,*, GLenum,*,*
FrontFaceDirection,*,*, GLenum,*,*
FunctionPointer,*,*, _GLfuncptr,*,*
GetColorTableParameterPName,*,*, GLenum,*,*
GetColorTableParameterPNameSGI,*,*, GLenum,*,*
GetConvolutionParameterPName,*,*, GLenum,*,*
GetHistogramParameterPName,*,*, GLenum,*,*
GetHistogramParameterPNameEXT,*,*, GLenum,*,*
GetMapQuery,*,*, GLenum,*,*
GetMinmaxParameterPName,*,*, GLenum,*,*
GetMinmaxParameterPNameEXT,*,*, GLenum,*,*
GetPName,*,*, GLenum,*,*
GetPointervPName,*,*, GLenum,*,*
GetTextureParameter,*,*, GLenum,*,*
HintMode,*,*, GLenum,*,*
HintTarget,*,*, GLenum,*,*
HintTargetPGI,*,*, GLenum,*,*
HistogramTarget,*,*, GLenum,*,*
HistogramTargetEXT,*,*, GLenum,*,*
IglooFunctionSelectSGIX,*,*, GLenum,*,*
IglooParameterSGIX,*,*, GLvoid,*,*
ImageTransformPNameHP,*,*, GLenum,*,*
ImageTransformTargetHP,*,*, GLenum,*,*
IndexFunctionEXT,*,*, GLenum,*,*
IndexMaterialParameterEXT,*,*, GLenum,*,*
IndexPointerType,*,*, GLenum,*,*
Int16,*,*, GLshort,*,*
Int32,*,*, GLint,*,*
Int8,*,*, GLbyte,*,*
InterleavedArrayFormat,*,*, GLenum,*,*
LightEnvParameterSGIX,*,*, GLenum,*,*
LightModelParameter,*,*, GLenum,*,*
LightName,*,*, GLenum,*,*
LightParameter,*,*, GLenum,*,*
LightTextureModeEXT,*,*, GLenum,*,*
LightTexturePNameEXT,*,*, GLenum,*,*
LineStipple,*,*, GLushort,*,*
List,*,*, GLuint,*,*
ListMode,*,*, GLenum,*,*
ListNameType,*,*, GLenum,*,*
ListParameterName,*,*, GLenum,*,*
LogicOp,*,*, GLenum,*,*
MapAttribParameterNV,*,*, GLenum,*,*
MapParameterNV,*,*, GLenum,*,*
MapTarget,*,*, GLenum,*,*
MapTargetNV,*,*, GLenum,*,*
MapTypeNV,*,*, GLenum,*,*
MaskedColorIndexValueF,*,*, GLfloat,*,*
MaskedColorIndexValueI,*,*, GLuint,*,*
MaskedStencilValue,*,*, GLuint,*,*
MaterialFace,*,*, GLenum,*,*
MaterialParameter,*,*, GLenum,*,*
MatrixIndexPointerTypeARB,*,*, GLenum,*,*
MatrixMode,*,*, GLenum,*,*
MatrixTransformNV,*,*, GLenum,*,*
MeshMode1,*,*, GLenum,*,*
MeshMode2,*,*, GLenum,*,*
MinmaxTarget,*,*, GLenum,*,*
MinmaxTargetEXT,*,*, GLenum,*,*
NormalPointerType,*,*, GLenum,*,*
NurbsCallback,*,*, GLenum,*,*
NurbsObj,*,*, GLUnurbs*,*,*
NurbsProperty,*,*, GLenum,*,*
NurbsTrim,*,*, GLenum,*,*
OcclusionQueryParameterNameNV,*,*, GLenum,*,*
PixelCopyType,*,*, GLenum,*,*
PixelFormat,*,*, GLenum,*,*
PixelInternalFormat,*,*, GLenum,*,*
PixelMap,*,*, GLenum,*,*
PixelStoreParameter,*,*, GLenum,*,*
PixelTexGenModeSGIX,*,*, GLenum,*,*
PixelTexGenParameterNameSGIS,*,*, GLenum,*,*
PixelTransferParameter,*,*, GLenum,*,*
PixelTransformPNameEXT,*,*, GLenum,*,*
PixelTransformTargetEXT,*,*, GLenum,*,*
PixelType,*,*, GLenum,*,*
PointParameterNameARB,*,*, GLenum,*,*
PolygonMode,*,*, GLenum,*,*
ProgramNV,*,*, GLuint,*,*
ProgramCharacterNV,*,*, GLubyte,*,*
ProgramParameterNV,*,*, GLenum,*,*
ProgramParameterPName,*,*, GLenum,*,*
QuadricCallback,*,*, GLenum,*,*
QuadricDrawStyle,*,*, GLenum,*,*
QuadricNormal,*,*, GLenum,*,*
QuadricObj,*,*, GLUquadric*,*,*
QuadricOrientation,*,*, GLenum,*,*
ReadBufferMode,*,*, GLenum,*,*
RenderbufferTarget,*,*, GLenum,*,*
RenderingMode,*,*, GLenum,*,*
ReplacementCodeSUN,*,*, GLuint,*,*
ReplacementCodeTypeSUN,*,*, GLenum,*,*
SamplePassARB,*,*, GLenum,*,*
SamplePatternEXT,*,*, GLenum,*,*
SamplePatternSGIS,*,*, GLenum,*,*
SecondaryColorPointerTypeIBM,*,*, GLenum,*,*
SelectName,*,*, GLuint,*,*
SeparableTarget,*,*, GLenum,*,*
SeparableTargetEXT,*,*, GLenum,*,*
ShadingModel,*,*, GLenum,*,*
SizeI,*,*, GLsizei,*,*
SpriteParameterNameSGIX,*,*, GLenum,*,*
StencilFunction,*,*, GLenum,*,*
StencilFaceDirection,*,*, GLenum,*,*
StencilOp,*,*, GLenum,*,*
StencilValue,*,*, GLint,*,*
String,*,*, GLstring,*,*
StringName,*,*, GLenum,*,*
TangentPointerTypeEXT,*,*, GLenum,*,*
TessCallback,*,*, GLenum,*,*
TessContour,*,*, GLenum,*,*
TessProperty,*,*, GLenum,*,*
TesselatorObj,*,*, GLUtesselator*,*,*
TexCoordPointerType,*,*, GLenum,*,*
Texture,*,*, GLuint,*,*
TextureComponentCount,*,*, GLint,*,*
TextureCoordName,*,*, GLenum,*,*
TextureEnvParameter,*,*, GLenum,*,*
TextureEnvTarget,*,*, GLenum,*,*
TextureFilterSGIS,*,*, GLenum,*,*
TextureGenParameter,*,*, GLenum,*,*
TextureNormalModeEXT,*,*, GLenum,*,*
TextureParameterName,*,*, GLenum,*,*
TextureTarget,*,*, GLenum,*,*
TextureUnit,*,*, GLenum,*,*
UInt16,*,*, GLushort,*,*
UInt32,*,*, GLuint,*,*
UInt8,*,*, GLubyte,*,*
VertexAttribEnum,*,*, GLenum,*,*
VertexAttribEnumNV,*,*, GLenum,*,*
VertexAttribPointerTypeNV,*,*, GLenum,*,*
VertexPointerType,*,*, GLenum,*,*
VertexWeightPointerTypeEXT,*,*, GLenum,*,*
Void,*,*, GLvoid,*,*
VoidPointer,*,*, GLvoid*,*,*
ConstVoidPointer,*,*, GLvoid* const,*,*
WeightPointerTypeARB,*,*, GLenum,*,*
WinCoord,*,*, GLint,*,*
void,*,*, *,*,*
ArrayObjectPNameATI,*,*, GLenum,*,*
ArrayObjectUsageATI,*,*, GLenum,*,*,
ConstFloat32,*,*, GLfloat,*,*
ConstInt32,*,*, GLint,*,*
ConstUInt32,*,*, GLuint,*,*
ConstVoid,*,*, GLvoid,*,*
DataTypeEXT,*,*, GLenum,*,*
FragmentOpATI,*,*, GLenum,*,*
GetTexBumpParameterATI,*,*, GLenum,*,*
GetVariantValueEXT,*,*, GLenum,*,*
ParameterRangeEXT,*,*, GLenum,*,*
PreserveModeATI,*,*, GLenum,*,*
ProgramFormatARB,*,*, GLenum,*,*
ProgramTargetARB,*,*, GLenum,*,*
ProgramTarget,*,*, GLenum,*,*
ProgramPropertyARB,*,*, GLenum,*,*
ProgramStringPropertyARB,*,*, GLenum,*,*
ScalarType,*,*, GLenum,*,*
SwizzleOpATI,*,*, GLenum,*,*
TexBumpParameterATI,*,*, GLenum,*,*
VariantCapEXT,*,*, GLenum,*,*
VertexAttribPointerPropertyARB,*,*, GLenum,*,*
VertexAttribPointerTypeARB,*,*, GLenum,*,*
VertexAttribPropertyARB,*,*, GLenum,*,*
VertexShaderCoordOutEXT,*,*, GLenum,*,*
VertexShaderOpEXT,*,*, GLenum,*,*
VertexShaderParameterEXT,*,*, GLenum,*,*
VertexShaderStorageTypeEXT,*,*, GLenum,*,*
VertexShaderTextureUnitParameter,*,*, GLenum,*,*
VertexShaderWriteMaskEXT,*,*, GLenum,*,*
VertexStreamATI,*,*, GLenum,*,*
PNTrianglesPNameATI,*,*, GLenum,*,*
# ARB_vertex_buffer_object types and core equivalents for new types
BufferOffset,*,*, GLintptr,*,*
BufferSize,*,*, GLsizeiptr,*,*
BufferAccessARB,*,*, GLenum,*,*
BufferOffsetARB,*,*, GLintptrARB,*,*
BufferPNameARB,*,*, GLenum,*,*
BufferPointerNameARB,*,*, GLenum,*,*
BufferSizeARB,*,*, GLsizeiptrARB,*,*
BufferTargetARB,*,*, GLenum,*,*
BufferUsageARB,*,*, GLenum,*,*
# APPLE_fence
ObjectTypeAPPLE,*,*, GLenum,*,*
# APPLE_vertex_array_range
VertexArrayPNameAPPLE,*,*, GLenum,*,*
# ATI_draw_buffers
DrawBufferModeATI,*,*, GLenum,*,*
# NV_half
Half16NV,*,*, GLhalfNV,*,*
# NV_pixel_data_range
PixelDataRangeTargetNV,*,*, GLenum,*,*
# Generic types for as-yet-unspecified enums
GLenum,*,*, GLenum,*,*
handleARB,*,*, GLhandleARB,*,*
charARB,*,*, GLcharARB,*,*
charPointerARB,*,*, GLcharARB*,*,*
# EXT_timer_query
Int64EXT,*,*, GLint64EXT,*,*
UInt64EXT,*,*, GLuint64EXT,*,*
| 10,871 | Common Lisp | .l | 291 | 36.357388 | 67 | 0.598204 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | e74f66c5d4023aac6f76d4bf63d1b00c02b9089366a5bad110334525211ec853 | 21,856 | [
-1
] |
21,893 | gl.spec | rheaplex_minara/lib/cl-opengl/spec/gl.spec | # gl.spec file
# DON'T REMOVE PREVIOUS LINE!!! libspec depends on it!
#
# License Applicability. Except to the extent portions of this file are
# made subject to an alternative license as permitted in the SGI Free
# Software License B, Version 1.1 (the "License"), the contents of this
# file are subject only to the provisions of the License. You may not use
# this file except in compliance with the License. You may obtain a copy
# of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
# Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
#
# http://oss.sgi.com/projects/FreeB
#
# Note that, as provided in the License, the Software is distributed on an
# "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
# DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
# CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
# PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
#
# Original Code. The Original Code is: OpenGL Sample Implementation,
# Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
# Inc. The Original Code is Copyright (c) 1991-2005 Silicon Graphics, Inc.
# Copyright in any portions created by third parties is as indicated
# elsewhere herein. All Rights Reserved.
#
# Additional Notice Provisions: This software was created using the
# OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
# not been independently verified as being compliant with the OpenGL(R)
# version 1.2.1 Specification.
# @@ NOTE - need to distinguish extensions via some (new?) flag for glext.pl
# @@ NOTE - 'alias' commands are not yet used in SI generator scripts, but should be
# @@ NOTE - SI should support GLX protocol for at least these extensions:
# AreTexturesResidentEXT BindTextureEXT DeleteTexturesEXT GenTexturesEXT IsTextureEXT
required-props:
param: retval retained
dlflags: notlistable handcode
glxflags: client-intercept client-handcode server-handcode EXT SGI ignore ARB
vectorequiv: *
category: display-list drawing drawing-control feedback framebuf misc modeling pixel-op pixel-rw state-req xform 1_1 VERSION_1_2 VERSION_1_3 VERSION_1_4 VERSION_1_5 VERSION_2_0 VERSION_2_1 ATI_element_array ATI_envmap_bumpmap ATI_fragment_shader ATI_pn_triangles ATI_vertex_array_object ATI_vertex_streams EXT_blend_color EXT_blend_minmax EXT_convolution EXT_copy_texture EXT_histogram EXT_polygon_offset EXT_subtexture EXT_texture3D EXT_texture_object EXT_vertex_array EXT_vertex_shader SGIS_detail_texture SGIS_multisample SGIS_pixel_texture ARB_point_parameters EXT_point_parameters SGIS_point_parameters SGIS_sharpen_texture SGIS_texture4D SGIS_texture_filter4 SGIX_async SGIX_flush_raster SGIX_fragment_lighting SGIX_framezoom SGIX_igloo_interface SGIX_instruments SGIX_list_priority SGIX_pixel_texture SGIX_polynomial_ffd SGIX_reference_plane SGIX_sprite SGIX_tag_sample_buffer SGI_color_table ARB_multitexture ARB_multisample ARB_texture_compression ARB_transpose_matrix ARB_vertex_blend ARB_matrix_palette EXT_compiled_vertex_array EXT_cull_vertex EXT_index_func EXT_index_material EXT_draw_range_elements EXT_vertex_weighting INGR_blend_func_separate NV_evaluators NV_fence NV_occlusion_query NV_point_sprite NV_register_combiners NV_register_combiners2 NV_vertex_array_range NV_vertex_program NV_vertex_program1_1_dcc MESA_resize_buffers MESA_window_pos PGI_misc_hints EXT_fog_coord EXT_blend_func_separate EXT_color_subtable EXT_coordinate_frame EXT_light_texture EXT_multi_draw_arrays EXT_paletted_texture EXT_pixel_transform EXT_secondary_color EXT_texture_perturb_normal HP_image_transform IBM_multimode_draw_arrays IBM_vertex_array_lists INTEL_parallel_arrays SUNX_constant_data SUN_global_alpha SUN_mesh_array SUN_triangle_list SUN_vertex 3DFX_tbuffer EXT_multisample SGIS_fog_function SGIS_texture_color_mask ARB_window_pos EXT_stencil_two_side EXT_depth_bounds_test EXT_blend_equation_separate ARB_vertex_program ARB_fragment_program ARB_vertex_buffer_object ARB_occlusion_query ARB_shader_objects ARB_vertex_shader ARB_fragment_shader S3_s3tc ATI_draw_buffers ATI_texture_env_combine3 ATI_texture_float NV_float_buffer NV_fragment_program NV_half_float NV_pixel_data_range NV_primitive_restart NV_texture_expand_normal NV_texture_expand_normal NV_vertex_program2 APPLE_element_array APPLE_fence APPLE_vertex_array_object APPLE_vertex_array_range ATI_draw_buffers NV_fragment_program NV_half_float NV_pixel_data_range NV_primitive_restart ATI_map_object_buffer ATI_separate_stencil ATI_vertex_attrib_array_object ARB_draw_buffers ARB_texture_rectangle ARB_color_buffer_float EXT_framebuffer_object GREMEDY_string_marker EXT_stencil_clear_tag EXT_framebuffer_blit EXT_framebuffer_multisample MESAX_texture_stack EXT_timer_query EXT_gpu_program_parameters APPLE_flush_buffer_range NV_gpu_program4 NV_geometry_program4 EXT_geometry_shader4 NV_vertex_program4 EXT_gpu_shader4 EXT_draw_instanced EXT_texture_buffer_object NV_depth_buffer_float NV_framebuffer_multisample_coverage NV_parameter_buffer_object EXT_draw_buffers2 NV_transform_feedback EXT_bindable_uniform EXT_texture_integer GREMEDY_frame_terminator
# categories for extensions with no functions - need not be included now
# ARB_texture_env_add ARB_texture_cube_map ARB_texture_border_clamp ARB_shading_language_100 ARB_texture_non_power_of_two ARB_point_sprite ARB_half_float_pixel ARB_texture_float ARB_pixel_buffer_object EXT_abgr EXT_texture SGI_color_matrix SGI_texture_color_table EXT_cmyka EXT_packed_pixels SGIS_texture_lod EXT_rescale_normal EXT_misc_attribute SGIS_generate_mipmap SGIX_clipmap SGIX_shadow SGIS_texture_edge_clamp SGIS_texture_border_clamp EXT_blend_subtract EXT_blend_logic_op SGIX_async_histogram SGIX_async_pixel SGIX_interlace SGIX_pixel_tiles SGIX_texture_select SGIX_texture_multi_buffer SGIX_texture_scale_bias SGIX_depth_texture SGIX_fog_offset HP_convolution_border_modes SGIX_texture_add_env PGI_vertex_hints EXT_clip_volume_hint SGIX_ir_instrument1 SGIX_calligraphic_fragment SGIX_texture_lod_bias SGIX_shadow_ambient EXT_index_texture EXT_index_array_formats SGIX_ycrcb IBM_rasterpos_clip HP_texture_lighting WIN_phong_shading WIN_specular_fog SGIX_blend_alpha_minmax EXT_bgra HP_occlusion_test EXT_pixel_transform_color_table EXT_shared_texture_palette EXT_separate_specular_color EXT_texture_env REND_screen_coordinates EXT_texture_env_combine APPLE_specular_vector APPLE_transform_hint SGIX_fog_scale INGR_color_clamp INGR_interlace_read EXT_stencil_wrap EXT_422_pixels NV_texgen_reflection SUN_convolution_border_modes SUN_slice_accum EXT_texture_env_add EXT_texture_lod_bias EXT_texture_filter_anisotropic NV_light_max_exponent NV_fog_distance NV_texgen_emboss NV_blend_square NV_texture_env_combine4 NV_packed_depth_stencil NV_texture_compression_vtc NV_texture_rectangle NV_texture_shader NV_texture_shader2 NV_vertex_array_range2 IBM_cull_vertex SGIX_subsample SGIX_ycrcba SGIX_ycrcb_subsample SGIX_depth_pass_instrument 3DFX_texture_compression_FXT1 3DFX_multisample SGIX_vertex_preclip SGIX_convolution_accuracy SGIX_resample SGIX_scalebias_hint SGIX_texture_coordinate_clamp EXT_shadow_funcs MESA_pack_invert MESA_ycbcr_texture EXT_packed_float EXT_texture_array EXT_texture_compression_latc EXT_texture_compression_rgtc EXT_texture_shared_exponent NV_fragment_program4 EXT_framebuffer_sRGB NV_geometry_shader4
version: 1.0 1.1 1.2 1.3 1.4 1.5 2.0 2.1
glxsingle: *
glxropcode: *
glxvendorpriv: *
glsflags: capture-handcode client get gl-enum ignore matrix pixel-null pixel-pack pixel-unpack
glsopcode: *
glsalias: *
wglflags: client-handcode server-handcode small-data batchable
extension: future not_implemented soft WINSOFT NV10 NV20 NV50
alias: *
offset: *
# These properties are picked up from NVIDIA .spec files, we don't use them
glfflags: *
beginend: *
glxvectorequiv: *
###############################################################################
#
# GLX opcodes
# glxsingle: 101-159 (1.0-1.2 core)
# 160 (ARB_texture_compression)
# glxropcode: 1-196 (1.2 core; ropcode 140 unused?!)
# 197-213 (ARB_multitexture)
# 214-219 (ARB_texture_compression)
# 220-228 (ARB_vertex_blend)
# 229 (ARB_multisample)
# 230 (ARB_window_pos)
# 2048-2082 (SGI extensions)
# 4096-4123 (1.2 core and multivendor EXT)
# 4124-4142 (EXT extensions)
# XFree86 dispatch offsets: 0-645
# 578-641 NV_vertex_program
# GLS opcodes: 0x0030-0x0269
#
# New opcodes and offsets must be allocated by SGI in the master registry file;
# a copy of this is in doc/registry/extensions/extensions.reserved, but only
# the copy maintained by SGI is the official and current version.
#
###############################################################################
###############################################################################
#
# things to remember when adding an extension command
#
# - append new ARB and non-ARB extensions to the appropriate portion of
# the spec file, in extension number order.
# - use tabs, not spaces
# - set glsflags to "ignore" until GLS is updated to support the new command
# - set glxflags to "ignore" until GLX is updated to support the new command
# - add new data types to typemaps/spec2wire.map
# - add extension name in alphabetical order to category list
# - add commands within an extension in spec order
# - use existing command entries as a model (where possible)
# - when reserving new glxropcodes, update
# gfx/lib/opengl/doc/glspec/extensions.reserved to indicate this
#
###############################################################################
# New type declarations
passthru: #include <stddef.h>
passthru: #ifndef GL_VERSION_2_0
passthru: /* GL type for program/shader text */
passthru: typedef char GLchar; /* native character */
passthru: #endif
passthru:
passthru: #ifndef GL_VERSION_1_5
passthru: /* GL types for handling large vertex buffer objects */
passthru: typedef ptrdiff_t GLintptr;
passthru: typedef ptrdiff_t GLsizeiptr;
passthru: #endif
passthru:
passthru: #ifndef GL_ARB_vertex_buffer_object
passthru: /* GL types for handling large vertex buffer objects */
passthru: typedef ptrdiff_t GLintptrARB;
passthru: typedef ptrdiff_t GLsizeiptrARB;
passthru: #endif
passthru:
passthru: #ifndef GL_ARB_shader_objects
passthru: /* GL types for handling shader object handles and program/shader text */
passthru: typedef char GLcharARB; /* native character */
passthru: typedef unsigned int GLhandleARB; /* shader object handle */
passthru: #endif
passthru:
passthru: /* GL types for "half" precision (s10e5) float data in host memory */
passthru: #ifndef GL_ARB_half_float_pixel
passthru: typedef unsigned short GLhalfARB;
passthru: #endif
passthru:
passthru: #ifndef GL_NV_half_float
passthru: typedef unsigned short GLhalfNV;
passthru: #endif
passthru:
passthru: #ifndef GLEXT_64_TYPES_DEFINED
passthru: /* This code block is duplicated in glext.h, so must be protected */
passthru: #define GLEXT_64_TYPES_DEFINED
passthru: /* Define int32_t, int64_t, and uint64_t types for UST/MSC */
passthru: /* (as used in the GL_EXT_timer_query extension). */
passthru: #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
passthru: #include <inttypes.h>
passthru: #elif defined(__sun__)
passthru: #include <inttypes.h>
passthru: #if defined(__STDC__)
passthru: #if defined(__arch64__)
passthru: typedef long int int64_t;
passthru: typedef unsigned long int uint64_t;
passthru: #else
passthru: typedef long long int int64_t;
passthru: typedef unsigned long long int uint64_t;
passthru: #endif /* __arch64__ */
passthru: #endif /* __STDC__ */
passthru: #elif defined( __VMS )
passthru: #include <inttypes.h>
passthru: #elif defined(__SCO__) || defined(__USLC__)
passthru: #include <stdint.h>
passthru: #elif defined(__UNIXOS2__) || defined(__SOL64__)
passthru: typedef long int int32_t;
passthru: typedef long long int int64_t;
passthru: typedef unsigned long long int uint64_t;
passthru: #elif defined(_WIN32) && defined(__GNUC__)
passthru: #include <stdint.h>
passthru: #elif defined(_WIN32)
passthru: typedef __int32 int32_t;
passthru: typedef __int64 int64_t;
passthru: typedef unsigned __int64 uint64_t;
passthru: #else
passthru: #include <inttypes.h> /* Fallback option */
passthru: #endif
passthru: #endif
passthru:
passthru: #ifndef GL_EXT_timer_query
passthru: typedef int64_t GLint64EXT;
passthru: typedef uint64_t GLuint64EXT;
passthru: #endif
passthru:
###############################################################################
#
# display-list commands
#
###############################################################################
NewList(list, mode)
return void
param list List in value
param mode ListMode in value
dlflags notlistable
category display-list
version 1.0
glxsingle 101
glsopcode 0x0030
wglflags batchable
offset 0
EndList()
return void
dlflags notlistable
category display-list
version 1.0
glxsingle 102
glsopcode 0x0031
wglflags batchable
offset 1
CallList(list)
return void
param list List in value
category display-list
version 1.0
glxropcode 1
glsopcode 0x0032
offset 2
CallLists(n, type, lists)
return void
param n SizeI in value
param type ListNameType in value
param lists Void in array [COMPSIZE(n/type)]
category display-list
glxflags client-handcode server-handcode
version 1.0
glxropcode 2
glsopcode 0x0033
offset 3
DeleteLists(list, range)
return void
param list List in value
param range SizeI in value
dlflags notlistable
category display-list
version 1.0
glxsingle 103
glsopcode 0x0034
wglflags batchable
offset 4
GenLists(range)
return List
param range SizeI in value
dlflags notlistable
category display-list
version 1.0
glxsingle 104
glsopcode 0x0035
offset 5
ListBase(base)
return void
param base List in value
category display-list
version 1.0
glxropcode 3
glsopcode 0x0036
offset 6
###############################################################################
#
# drawing commands
#
###############################################################################
Begin(mode)
return void
param mode BeginMode in value
category drawing
version 1.0
glxropcode 4
glsopcode 0x0037
offset 7
Bitmap(width, height, xorig, yorig, xmove, ymove, bitmap)
return void
param width SizeI in value
param height SizeI in value
param xorig CoordF in value
param yorig CoordF in value
param xmove CoordF in value
param ymove CoordF in value
param bitmap UInt8 in array [COMPSIZE(width/height)]
category drawing
dlflags handcode
glxflags client-handcode server-handcode
version 1.0
glxropcode 5
glsflags pixel-unpack
glsopcode 0x0038
wglflags client-handcode server-handcode
offset 8
Color3b(red, green, blue)
return void
param red ColorB in value
param green ColorB in value
param blue ColorB in value
category drawing
vectorequiv Color3bv
version 1.0
offset 9
Color3bv(v)
return void
param v ColorB in array [3]
category drawing
version 1.0
glxropcode 6
glsopcode 0x0039
offset 10
Color3d(red, green, blue)
return void
param red ColorD in value
param green ColorD in value
param blue ColorD in value
category drawing
vectorequiv Color3dv
version 1.0
offset 11
Color3dv(v)
return void
param v ColorD in array [3]
category drawing
version 1.0
glxropcode 7
glsopcode 0x003A
offset 12
Color3f(red, green, blue)
return void
param red ColorF in value
param green ColorF in value
param blue ColorF in value
category drawing
vectorequiv Color3fv
version 1.0
offset 13
Color3fv(v)
return void
param v ColorF in array [3]
category drawing
version 1.0
glxropcode 8
glsopcode 0x003B
offset 14
Color3i(red, green, blue)
return void
param red ColorI in value
param green ColorI in value
param blue ColorI in value
category drawing
vectorequiv Color3iv
version 1.0
offset 15
Color3iv(v)
return void
param v ColorI in array [3]
category drawing
version 1.0
glxropcode 9
glsopcode 0x003C
offset 16
Color3s(red, green, blue)
return void
param red ColorS in value
param green ColorS in value
param blue ColorS in value
category drawing
vectorequiv Color3sv
version 1.0
offset 17
Color3sv(v)
return void
param v ColorS in array [3]
category drawing
version 1.0
glxropcode 10
glsopcode 0x003D
offset 18
Color3ub(red, green, blue)
return void
param red ColorUB in value
param green ColorUB in value
param blue ColorUB in value
category drawing
vectorequiv Color3ubv
version 1.0
offset 19
Color3ubv(v)
return void
param v ColorUB in array [3]
category drawing
version 1.0
glxropcode 11
glsopcode 0x003E
offset 20
Color3ui(red, green, blue)
return void
param red ColorUI in value
param green ColorUI in value
param blue ColorUI in value
category drawing
vectorequiv Color3uiv
version 1.0
offset 21
Color3uiv(v)
return void
param v ColorUI in array [3]
category drawing
version 1.0
glxropcode 12
glsopcode 0x003F
offset 22
Color3us(red, green, blue)
return void
param red ColorUS in value
param green ColorUS in value
param blue ColorUS in value
category drawing
vectorequiv Color3usv
version 1.0
offset 23
Color3usv(v)
return void
param v ColorUS in array [3]
category drawing
version 1.0
glxropcode 13
glsopcode 0x0040
offset 24
Color4b(red, green, blue, alpha)
return void
param red ColorB in value
param green ColorB in value
param blue ColorB in value
param alpha ColorB in value
category drawing
vectorequiv Color4bv
version 1.0
offset 25
Color4bv(v)
return void
param v ColorB in array [4]
category drawing
version 1.0
glxropcode 14
glsopcode 0x0041
offset 26
Color4d(red, green, blue, alpha)
return void
param red ColorD in value
param green ColorD in value
param blue ColorD in value
param alpha ColorD in value
category drawing
vectorequiv Color4dv
version 1.0
offset 27
Color4dv(v)
return void
param v ColorD in array [4]
category drawing
version 1.0
glxropcode 15
glsopcode 0x0042
offset 28
Color4f(red, green, blue, alpha)
return void
param red ColorF in value
param green ColorF in value
param blue ColorF in value
param alpha ColorF in value
category drawing
vectorequiv Color4fv
version 1.0
offset 29
Color4fv(v)
return void
param v ColorF in array [4]
category drawing
version 1.0
glxropcode 16
glsopcode 0x0043
offset 30
Color4i(red, green, blue, alpha)
return void
param red ColorI in value
param green ColorI in value
param blue ColorI in value
param alpha ColorI in value
category drawing
vectorequiv Color4iv
version 1.0
offset 31
Color4iv(v)
return void
param v ColorI in array [4]
category drawing
version 1.0
glxropcode 17
glsopcode 0x0044
offset 32
Color4s(red, green, blue, alpha)
return void
param red ColorS in value
param green ColorS in value
param blue ColorS in value
param alpha ColorS in value
category drawing
vectorequiv Color4sv
version 1.0
offset 33
Color4sv(v)
return void
param v ColorS in array [4]
category drawing
version 1.0
glxropcode 18
glsopcode 0x0045
offset 34
Color4ub(red, green, blue, alpha)
return void
param red ColorUB in value
param green ColorUB in value
param blue ColorUB in value
param alpha ColorUB in value
category drawing
vectorequiv Color4ubv
version 1.0
offset 35
Color4ubv(v)
return void
param v ColorUB in array [4]
category drawing
version 1.0
glxropcode 19
glsopcode 0x0046
offset 36
Color4ui(red, green, blue, alpha)
return void
param red ColorUI in value
param green ColorUI in value
param blue ColorUI in value
param alpha ColorUI in value
category drawing
vectorequiv Color4uiv
version 1.0
offset 37
Color4uiv(v)
return void
param v ColorUI in array [4]
category drawing
version 1.0
glxropcode 20
glsopcode 0x0047
offset 38
Color4us(red, green, blue, alpha)
return void
param red ColorUS in value
param green ColorUS in value
param blue ColorUS in value
param alpha ColorUS in value
category drawing
vectorequiv Color4usv
version 1.0
offset 39
Color4usv(v)
return void
param v ColorUS in array [4]
category drawing
version 1.0
glxropcode 21
glsopcode 0x0048
offset 40
EdgeFlag(flag)
return void
param flag Boolean in value
category drawing
vectorequiv EdgeFlagv
version 1.0
offset 41
EdgeFlagv(flag)
return void
param flag Boolean in array [1]
category drawing
version 1.0
glxropcode 22
glsopcode 0x0049
offset 42
End()
return void
category drawing
version 1.0
glxropcode 23
glsopcode 0x004A
offset 43
Indexd(c)
return void
param c ColorIndexValueD in value
category drawing
vectorequiv Indexdv
version 1.0
offset 44
Indexdv(c)
return void
param c ColorIndexValueD in array [1]
category drawing
version 1.0
glxropcode 24
glsopcode 0x004B
offset 45
Indexf(c)
return void
param c ColorIndexValueF in value
category drawing
vectorequiv Indexfv
version 1.0
offset 46
Indexfv(c)
return void
param c ColorIndexValueF in array [1]
category drawing
version 1.0
glxropcode 25
glsopcode 0x004C
offset 47
Indexi(c)
return void
param c ColorIndexValueI in value
category drawing
vectorequiv Indexiv
version 1.0
offset 48
Indexiv(c)
return void
param c ColorIndexValueI in array [1]
category drawing
version 1.0
glxropcode 26
glsopcode 0x004D
offset 49
Indexs(c)
return void
param c ColorIndexValueS in value
category drawing
vectorequiv Indexsv
version 1.0
offset 50
Indexsv(c)
return void
param c ColorIndexValueS in array [1]
category drawing
version 1.0
glxropcode 27
glsopcode 0x004E
offset 51
Normal3b(nx, ny, nz)
return void
param nx Int8 in value
param ny Int8 in value
param nz Int8 in value
category drawing
vectorequiv Normal3bv
version 1.0
offset 52
Normal3bv(v)
return void
param v Int8 in array [3]
category drawing
version 1.0
glxropcode 28
glsopcode 0x004F
offset 53
Normal3d(nx, ny, nz)
return void
param nx CoordD in value
param ny CoordD in value
param nz CoordD in value
category drawing
vectorequiv Normal3dv
version 1.0
offset 54
Normal3dv(v)
return void
param v CoordD in array [3]
category drawing
version 1.0
glxropcode 29
glsopcode 0x0050
offset 55
Normal3f(nx, ny, nz)
return void
param nx CoordF in value
param ny CoordF in value
param nz CoordF in value
category drawing
vectorequiv Normal3fv
version 1.0
offset 56
Normal3fv(v)
return void
param v CoordF in array [3]
category drawing
version 1.0
glxropcode 30
glsopcode 0x0051
offset 57
Normal3i(nx, ny, nz)
return void
param nx Int32 in value
param ny Int32 in value
param nz Int32 in value
category drawing
vectorequiv Normal3iv
version 1.0
offset 58
Normal3iv(v)
return void
param v Int32 in array [3]
category drawing
version 1.0
glxropcode 31
glsopcode 0x0052
offset 59
Normal3s(nx, ny, nz)
return void
param nx Int16 in value
param ny Int16 in value
param nz Int16 in value
category drawing
vectorequiv Normal3sv
version 1.0
offset 60
Normal3sv(v)
return void
param v Int16 in array [3]
category drawing
version 1.0
glxropcode 32
glsopcode 0x0053
offset 61
RasterPos2d(x, y)
return void
param x CoordD in value
param y CoordD in value
category drawing
vectorequiv RasterPos2dv
version 1.0
offset 62
RasterPos2dv(v)
return void
param v CoordD in array [2]
category drawing
version 1.0
glxropcode 33
glsopcode 0x0054
offset 63
RasterPos2f(x, y)
return void
param x CoordF in value
param y CoordF in value
category drawing
vectorequiv RasterPos2fv
version 1.0
offset 64
RasterPos2fv(v)
return void
param v CoordF in array [2]
category drawing
version 1.0
glxropcode 34
glsopcode 0x0055
offset 65
RasterPos2i(x, y)
return void
param x CoordI in value
param y CoordI in value
category drawing
vectorequiv RasterPos2iv
version 1.0
offset 66
RasterPos2iv(v)
return void
param v CoordI in array [2]
category drawing
version 1.0
glxropcode 35
glsopcode 0x0056
offset 67
RasterPos2s(x, y)
return void
param x CoordS in value
param y CoordS in value
category drawing
vectorequiv RasterPos2sv
version 1.0
offset 68
RasterPos2sv(v)
return void
param v CoordS in array [2]
category drawing
version 1.0
glxropcode 36
glsopcode 0x0057
offset 69
RasterPos3d(x, y, z)
return void
param x CoordD in value
param y CoordD in value
param z CoordD in value
vectorequiv RasterPos3dv
category drawing
version 1.0
offset 70
RasterPos3dv(v)
return void
param v CoordD in array [3]
category drawing
version 1.0
glxropcode 37
glsopcode 0x0058
offset 71
RasterPos3f(x, y, z)
return void
param x CoordF in value
param y CoordF in value
param z CoordF in value
category drawing
vectorequiv RasterPos3fv
version 1.0
offset 72
RasterPos3fv(v)
return void
param v CoordF in array [3]
category drawing
version 1.0
glxropcode 38
glsopcode 0x0059
offset 73
RasterPos3i(x, y, z)
return void
param x CoordI in value
param y CoordI in value
param z CoordI in value
category drawing
vectorequiv RasterPos3iv
version 1.0
offset 74
RasterPos3iv(v)
return void
param v CoordI in array [3]
category drawing
version 1.0
glxropcode 39
glsopcode 0x005A
offset 75
RasterPos3s(x, y, z)
return void
param x CoordS in value
param y CoordS in value
param z CoordS in value
category drawing
vectorequiv RasterPos3sv
version 1.0
offset 76
RasterPos3sv(v)
return void
param v CoordS in array [3]
category drawing
version 1.0
glxropcode 40
glsopcode 0x005B
offset 77
RasterPos4d(x, y, z, w)
return void
param x CoordD in value
param y CoordD in value
param z CoordD in value
param w CoordD in value
vectorequiv RasterPos4dv
category drawing
version 1.0
offset 78
RasterPos4dv(v)
return void
param v CoordD in array [4]
category drawing
version 1.0
glxropcode 41
glsopcode 0x005C
offset 79
RasterPos4f(x, y, z, w)
return void
param x CoordF in value
param y CoordF in value
param z CoordF in value
param w CoordF in value
category drawing
vectorequiv RasterPos4fv
version 1.0
offset 80
RasterPos4fv(v)
return void
param v CoordF in array [4]
category drawing
version 1.0
glxropcode 42
glsopcode 0x005D
offset 81
RasterPos4i(x, y, z, w)
return void
param x CoordI in value
param y CoordI in value
param z CoordI in value
param w CoordI in value
category drawing
vectorequiv RasterPos4iv
version 1.0
offset 82
RasterPos4iv(v)
return void
param v CoordI in array [4]
category drawing
version 1.0
glxropcode 43
glsopcode 0x005E
offset 83
RasterPos4s(x, y, z, w)
return void
param x CoordS in value
param y CoordS in value
param z CoordS in value
param w CoordS in value
category drawing
vectorequiv RasterPos4sv
version 1.0
offset 84
RasterPos4sv(v)
return void
param v CoordS in array [4]
category drawing
version 1.0
glxropcode 44
glsopcode 0x005F
offset 85
Rectd(x1, y1, x2, y2)
return void
param x1 CoordD in value
param y1 CoordD in value
param x2 CoordD in value
param y2 CoordD in value
category drawing
vectorequiv Rectdv
version 1.0
offset 86
Rectdv(v1, v2)
return void
param v1 CoordD in array [2]
param v2 CoordD in array [2]
category drawing
version 1.0
glxropcode 45
glsopcode 0x0060
offset 87
Rectf(x1, y1, x2, y2)
return void
param x1 CoordF in value
param y1 CoordF in value
param x2 CoordF in value
param y2 CoordF in value
category drawing
vectorequiv Rectfv
version 1.0
offset 88
Rectfv(v1, v2)
return void
param v1 CoordF in array [2]
param v2 CoordF in array [2]
category drawing
version 1.0
glxropcode 46
glsopcode 0x0061
offset 89
Recti(x1, y1, x2, y2)
return void
param x1 CoordI in value
param y1 CoordI in value
param x2 CoordI in value
param y2 CoordI in value
category drawing
vectorequiv Rectiv
version 1.0
offset 90
Rectiv(v1, v2)
return void
param v1 CoordI in array [2]
param v2 CoordI in array [2]
category drawing
version 1.0
glxropcode 47
glsopcode 0x0062
offset 91
Rects(x1, y1, x2, y2)
return void
param x1 CoordS in value
param y1 CoordS in value
param x2 CoordS in value
param y2 CoordS in value
category drawing
vectorequiv Rectsv
version 1.0
offset 92
Rectsv(v1, v2)
return void
param v1 CoordS in array [2]
param v2 CoordS in array [2]
category drawing
version 1.0
glxropcode 48
glsopcode 0x0063
offset 93
TexCoord1d(s)
return void
param s CoordD in value
category drawing
vectorequiv TexCoord1dv
version 1.0
offset 94
TexCoord1dv(v)
return void
param v CoordD in array [1]
category drawing
version 1.0
glxropcode 49
glsopcode 0x0064
offset 95
TexCoord1f(s)
return void
param s CoordF in value
category drawing
vectorequiv TexCoord1fv
version 1.0
offset 96
TexCoord1fv(v)
return void
param v CoordF in array [1]
category drawing
version 1.0
glxropcode 50
glsopcode 0x0065
offset 97
TexCoord1i(s)
return void
param s CoordI in value
category drawing
vectorequiv TexCoord1iv
version 1.0
offset 98
TexCoord1iv(v)
return void
param v CoordI in array [1]
category drawing
version 1.0
glxropcode 51
glsopcode 0x0066
offset 99
TexCoord1s(s)
return void
param s CoordS in value
category drawing
vectorequiv TexCoord1sv
version 1.0
offset 100
TexCoord1sv(v)
return void
param v CoordS in array [1]
category drawing
version 1.0
glxropcode 52
glsopcode 0x0067
offset 101
TexCoord2d(s, t)
return void
param s CoordD in value
param t CoordD in value
category drawing
vectorequiv TexCoord2dv
version 1.0
offset 102
TexCoord2dv(v)
return void
param v CoordD in array [2]
category drawing
version 1.0
glxropcode 53
glsopcode 0x0068
offset 103
TexCoord2f(s, t)
return void
param s CoordF in value
param t CoordF in value
category drawing
vectorequiv TexCoord2fv
version 1.0
offset 104
TexCoord2fv(v)
return void
param v CoordF in array [2]
category drawing
version 1.0
glxropcode 54
glsopcode 0x0069
offset 105
TexCoord2i(s, t)
return void
param s CoordI in value
param t CoordI in value
category drawing
vectorequiv TexCoord2iv
version 1.0
offset 106
TexCoord2iv(v)
return void
param v CoordI in array [2]
category drawing
version 1.0
glxropcode 55
glsopcode 0x006A
offset 107
TexCoord2s(s, t)
return void
param s CoordS in value
param t CoordS in value
category drawing
vectorequiv TexCoord2sv
version 1.0
offset 108
TexCoord2sv(v)
return void
param v CoordS in array [2]
category drawing
version 1.0
glxropcode 56
glsopcode 0x006B
offset 109
TexCoord3d(s, t, r)
return void
param s CoordD in value
param t CoordD in value
param r CoordD in value
category drawing
vectorequiv TexCoord3dv
version 1.0
offset 110
TexCoord3dv(v)
return void
param v CoordD in array [3]
category drawing
version 1.0
glxropcode 57
glsopcode 0x006C
offset 111
TexCoord3f(s, t, r)
return void
param s CoordF in value
param t CoordF in value
param r CoordF in value
category drawing
vectorequiv TexCoord3fv
version 1.0
offset 112
TexCoord3fv(v)
return void
param v CoordF in array [3]
category drawing
version 1.0
glxropcode 58
glsopcode 0x006D
offset 113
TexCoord3i(s, t, r)
return void
param s CoordI in value
param t CoordI in value
param r CoordI in value
category drawing
vectorequiv TexCoord3iv
version 1.0
offset 114
TexCoord3iv(v)
return void
param v CoordI in array [3]
category drawing
version 1.0
glxropcode 59
glsopcode 0x006E
offset 115
TexCoord3s(s, t, r)
return void
param s CoordS in value
param t CoordS in value
param r CoordS in value
category drawing
vectorequiv TexCoord3sv
version 1.0
offset 116
TexCoord3sv(v)
return void
param v CoordS in array [3]
category drawing
version 1.0
glxropcode 60
glsopcode 0x006F
offset 117
TexCoord4d(s, t, r, q)
return void
param s CoordD in value
param t CoordD in value
param r CoordD in value
param q CoordD in value
category drawing
vectorequiv TexCoord4dv
version 1.0
offset 118
TexCoord4dv(v)
return void
param v CoordD in array [4]
category drawing
version 1.0
glxropcode 61
glsopcode 0x0070
offset 119
TexCoord4f(s, t, r, q)
return void
param s CoordF in value
param t CoordF in value
param r CoordF in value
param q CoordF in value
category drawing
vectorequiv TexCoord4fv
version 1.0
offset 120
TexCoord4fv(v)
return void
param v CoordF in array [4]
category drawing
version 1.0
glxropcode 62
glsopcode 0x0071
offset 121
TexCoord4i(s, t, r, q)
return void
param s CoordI in value
param t CoordI in value
param r CoordI in value
param q CoordI in value
category drawing
vectorequiv TexCoord4iv
version 1.0
offset 122
TexCoord4iv(v)
return void
param v CoordI in array [4]
category drawing
version 1.0
glxropcode 63
glsopcode 0x0072
offset 123
TexCoord4s(s, t, r, q)
return void
param s CoordS in value
param t CoordS in value
param r CoordS in value
param q CoordS in value
category drawing
vectorequiv TexCoord4sv
version 1.0
offset 124
TexCoord4sv(v)
return void
param v CoordS in array [4]
category drawing
version 1.0
glxropcode 64
glsopcode 0x0073
offset 125
Vertex2d(x, y)
return void
param x CoordD in value
param y CoordD in value
category drawing
vectorequiv Vertex2dv
version 1.0
offset 126
Vertex2dv(v)
return void
param v CoordD in array [2]
category drawing
version 1.0
glxropcode 65
glsopcode 0x0074
offset 127
Vertex2f(x, y)
return void
param x CoordF in value
param y CoordF in value
category drawing
vectorequiv Vertex2fv
version 1.0
offset 128
Vertex2fv(v)
return void
param v CoordF in array [2]
category drawing
version 1.0
glxropcode 66
glsopcode 0x0075
offset 129
Vertex2i(x, y)
return void
param x CoordI in value
param y CoordI in value
category drawing
vectorequiv Vertex2iv
version 1.0
offset 130
Vertex2iv(v)
return void
param v CoordI in array [2]
category drawing
version 1.0
glxropcode 67
glsopcode 0x0076
offset 131
Vertex2s(x, y)
return void
param x CoordS in value
param y CoordS in value
category drawing
vectorequiv Vertex2sv
version 1.0
offset 132
Vertex2sv(v)
return void
param v CoordS in array [2]
category drawing
version 1.0
glxropcode 68
glsopcode 0x0077
offset 133
Vertex3d(x, y, z)
return void
param x CoordD in value
param y CoordD in value
param z CoordD in value
category drawing
vectorequiv Vertex3dv
version 1.0
offset 134
Vertex3dv(v)
return void
param v CoordD in array [3]
category drawing
version 1.0
glxropcode 69
glsopcode 0x0078
offset 135
Vertex3f(x, y, z)
return void
param x CoordF in value
param y CoordF in value
param z CoordF in value
category drawing
vectorequiv Vertex3fv
version 1.0
offset 136
Vertex3fv(v)
return void
param v CoordF in array [3]
category drawing
version 1.0
glxropcode 70
glsopcode 0x0079
offset 137
Vertex3i(x, y, z)
return void
param x CoordI in value
param y CoordI in value
param z CoordI in value
category drawing
vectorequiv Vertex3iv
version 1.0
offset 138
Vertex3iv(v)
return void
param v CoordI in array [3]
category drawing
version 1.0
glxropcode 71
glsopcode 0x007A
offset 139
Vertex3s(x, y, z)
return void
param x CoordS in value
param y CoordS in value
param z CoordS in value
category drawing
vectorequiv Vertex3sv
version 1.0
offset 140
Vertex3sv(v)
return void
param v CoordS in array [3]
category drawing
version 1.0
glxropcode 72
glsopcode 0x007B
offset 141
Vertex4d(x, y, z, w)
return void
param x CoordD in value
param y CoordD in value
param z CoordD in value
param w CoordD in value
category drawing
vectorequiv Vertex4dv
version 1.0
offset 142
Vertex4dv(v)
return void
param v CoordD in array [4]
category drawing
version 1.0
glxropcode 73
glsopcode 0x007C
offset 143
Vertex4f(x, y, z, w)
return void
param x CoordF in value
param y CoordF in value
param z CoordF in value
param w CoordF in value
category drawing
vectorequiv Vertex4fv
version 1.0
offset 144
Vertex4fv(v)
return void
param v CoordF in array [4]
category drawing
version 1.0
glxropcode 74
glsopcode 0x007D
offset 145
Vertex4i(x, y, z, w)
return void
param x CoordI in value
param y CoordI in value
param z CoordI in value
param w CoordI in value
category drawing
vectorequiv Vertex4iv
version 1.0
offset 146
Vertex4iv(v)
return void
param v CoordI in array [4]
category drawing
version 1.0
glxropcode 75
glsopcode 0x007E
offset 147
Vertex4s(x, y, z, w)
return void
param x CoordS in value
param y CoordS in value
param z CoordS in value
param w CoordS in value
category drawing
vectorequiv Vertex4sv
version 1.0
offset 148
Vertex4sv(v)
return void
param v CoordS in array [4]
category drawing
version 1.0
glxropcode 76
glsopcode 0x007F
offset 149
###############################################################################
#
# drawing-control commands
#
###############################################################################
ClipPlane(plane, equation)
return void
param plane ClipPlaneName in value
param equation Float64 in array [4]
category drawing-control
version 1.0
glxropcode 77
glsopcode 0x0080
offset 150
ColorMaterial(face, mode)
return void
param face MaterialFace in value
param mode ColorMaterialParameter in value
category drawing-control
version 1.0
glxropcode 78
glsopcode 0x0081
offset 151
CullFace(mode)
return void
param mode CullFaceMode in value
category drawing-control
version 1.0
glxropcode 79
glsopcode 0x0082
offset 152
Fogf(pname, param)
return void
param pname FogParameter in value
param param CheckedFloat32 in value
category drawing-control
version 1.0
glxropcode 80
glsflags gl-enum
glsopcode 0x0083
wglflags small-data
offset 153
Fogfv(pname, params)
return void
param pname FogParameter in value
param params CheckedFloat32 in array [COMPSIZE(pname)]
category drawing-control
version 1.0
glxropcode 81
glsflags gl-enum
glsopcode 0x0084
wglflags small-data
offset 154
Fogi(pname, param)
return void
param pname FogParameter in value
param param CheckedInt32 in value
category drawing-control
version 1.0
glxropcode 82
glsflags gl-enum
glsopcode 0x0085
wglflags small-data
offset 155
Fogiv(pname, params)
return void
param pname FogParameter in value
param params CheckedInt32 in array [COMPSIZE(pname)]
category drawing-control
version 1.0
glxropcode 83
glsflags gl-enum
glsopcode 0x0086
wglflags small-data
offset 156
FrontFace(mode)
return void
param mode FrontFaceDirection in value
category drawing-control
version 1.0
glxropcode 84
glsopcode 0x0087
offset 157
Hint(target, mode)
return void
param target HintTarget in value
param mode HintMode in value
category drawing-control
version 1.0
glxropcode 85
glsopcode 0x0088
offset 158
Lightf(light, pname, param)
return void
param light LightName in value
param pname LightParameter in value
param param CheckedFloat32 in value
category drawing-control
version 1.0
glxropcode 86
glsopcode 0x0089
wglflags small-data
offset 159
Lightfv(light, pname, params)
return void
param light LightName in value
param pname LightParameter in value
param params CheckedFloat32 in array [COMPSIZE(pname)]
category drawing-control
version 1.0
glxropcode 87
glsopcode 0x008A
wglflags small-data
offset 160
Lighti(light, pname, param)
return void
param light LightName in value
param pname LightParameter in value
param param CheckedInt32 in value
category drawing-control
version 1.0
glxropcode 88
glsopcode 0x008B
wglflags small-data
offset 161
Lightiv(light, pname, params)
return void
param light LightName in value
param pname LightParameter in value
param params CheckedInt32 in array [COMPSIZE(pname)]
category drawing-control
version 1.0
glxropcode 89
glsopcode 0x008C
wglflags small-data
offset 162
LightModelf(pname, param)
return void
param pname LightModelParameter in value
param param Float32 in value
category drawing-control
version 1.0
glxropcode 90
glsflags gl-enum
glsopcode 0x008D
wglflags small-data
offset 163
LightModelfv(pname, params)
return void
param pname LightModelParameter in value
param params Float32 in array [COMPSIZE(pname)]
category drawing-control
version 1.0
glxropcode 91
glsflags gl-enum
glsopcode 0x008E
wglflags small-data
offset 164
LightModeli(pname, param)
return void
param pname LightModelParameter in value
param param Int32 in value
category drawing-control
version 1.0
glxropcode 92
glsflags gl-enum
glsopcode 0x008F
wglflags small-data
offset 165
LightModeliv(pname, params)
return void
param pname LightModelParameter in value
param params Int32 in array [COMPSIZE(pname)]
category drawing-control
version 1.0
glxropcode 93
glsflags gl-enum
glsopcode 0x0090
wglflags small-data
offset 166
LineStipple(factor, pattern)
return void
param factor CheckedInt32 in value
param pattern LineStipple in value
category drawing-control
version 1.0
glxropcode 94
glsopcode 0x0091
offset 167
LineWidth(width)
return void
param width CheckedFloat32 in value
category drawing-control
version 1.0
glxropcode 95
glsopcode 0x0092
offset 168
Materialf(face, pname, param)
return void
param face MaterialFace in value
param pname MaterialParameter in value
param param CheckedFloat32 in value
category drawing-control
version 1.0
glxropcode 96
glsopcode 0x0093
wglflags small-data
offset 169
Materialfv(face, pname, params)
return void
param face MaterialFace in value
param pname MaterialParameter in value
param params CheckedFloat32 in array [COMPSIZE(pname)]
category drawing-control
version 1.0
glxropcode 97
glsopcode 0x0094
wglflags small-data
offset 170
Materiali(face, pname, param)
return void
param face MaterialFace in value
param pname MaterialParameter in value
param param CheckedInt32 in value
category drawing-control
version 1.0
glxropcode 98
glsopcode 0x0095
wglflags small-data
offset 171
Materialiv(face, pname, params)
return void
param face MaterialFace in value
param pname MaterialParameter in value
param params CheckedInt32 in array [COMPSIZE(pname)]
category drawing-control
version 1.0
glxropcode 99
glsopcode 0x0096
wglflags small-data
offset 172
PointSize(size)
return void
param size CheckedFloat32 in value
category drawing-control
version 1.0
glxropcode 100
glsopcode 0x0097
offset 173
PolygonMode(face, mode)
return void
param face MaterialFace in value
param mode PolygonMode in value
category drawing-control
version 1.0
glxropcode 101
glsopcode 0x0098
offset 174
PolygonStipple(mask)
return void
param mask UInt8 in array [COMPSIZE()]
category drawing-control
dlflags handcode
glxflags client-handcode server-handcode
version 1.0
glxropcode 102
glsflags pixel-unpack
glsopcode 0x0099
wglflags client-handcode server-handcode
offset 175
Scissor(x, y, width, height)
return void
param x WinCoord in value
param y WinCoord in value
param width SizeI in value
param height SizeI in value
category drawing-control
version 1.0
glxropcode 103
glsopcode 0x009A
offset 176
ShadeModel(mode)
return void
param mode ShadingModel in value
category drawing-control
version 1.0
glxropcode 104
glsopcode 0x009B
offset 177
TexParameterf(target, pname, param)
return void
param target TextureTarget in value
param pname TextureParameterName in value
param param CheckedFloat32 in value
category drawing-control
version 1.0
glxropcode 105
glsflags gl-enum
glsopcode 0x009C
wglflags small-data
offset 178
TexParameterfv(target, pname, params)
return void
param target TextureTarget in value
param pname TextureParameterName in value
param params CheckedFloat32 in array [COMPSIZE(pname)]
category drawing-control
version 1.0
glxropcode 106
glsflags gl-enum
glsopcode 0x009D
wglflags small-data
offset 179
TexParameteri(target, pname, param)
return void
param target TextureTarget in value
param pname TextureParameterName in value
param param CheckedInt32 in value
category drawing-control
version 1.0
glxropcode 107
glsflags gl-enum
glsopcode 0x009E
wglflags small-data
offset 180
TexParameteriv(target, pname, params)
return void
param target TextureTarget in value
param pname TextureParameterName in value
param params CheckedInt32 in array [COMPSIZE(pname)]
category drawing-control
version 1.0
glxropcode 108
glsflags gl-enum
glsopcode 0x009F
wglflags small-data
offset 181
TexImage1D(target, level, internalformat, width, border, format, type, pixels)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param internalformat TextureComponentCount in value
param width SizeI in value
param border CheckedInt32 in value
param format PixelFormat in value
param type PixelType in value
param pixels Void in array [COMPSIZE(format/type/width)]
category drawing-control
dlflags handcode
glxflags client-handcode server-handcode
version 1.0
glxropcode 109
glsflags pixel-null pixel-unpack
glsopcode 0x00A0
wglflags client-handcode server-handcode
offset 182
TexImage2D(target, level, internalformat, width, height, border, format, type, pixels)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param internalformat TextureComponentCount in value
param width SizeI in value
param height SizeI in value
param border CheckedInt32 in value
param format PixelFormat in value
param type PixelType in value
param pixels Void in array [COMPSIZE(format/type/width/height)]
category drawing-control
dlflags handcode
glxflags client-handcode server-handcode
version 1.0
glxropcode 110
glsflags pixel-null pixel-unpack
glsopcode 0x00A1
wglflags client-handcode server-handcode
offset 183
TexEnvf(target, pname, param)
return void
param target TextureEnvTarget in value
param pname TextureEnvParameter in value
param param CheckedFloat32 in value
category drawing-control
version 1.0
glxropcode 111
glsflags gl-enum
glsopcode 0x00A2
wglflags small-data
offset 184
TexEnvfv(target, pname, params)
return void
param target TextureEnvTarget in value
param pname TextureEnvParameter in value
param params CheckedFloat32 in array [COMPSIZE(pname)]
category drawing-control
version 1.0
glxropcode 112
glsflags gl-enum
glsopcode 0x00A3
wglflags small-data
offset 185
TexEnvi(target, pname, param)
return void
param target TextureEnvTarget in value
param pname TextureEnvParameter in value
param param CheckedInt32 in value
category drawing-control
version 1.0
glxropcode 113
glsflags gl-enum
glsopcode 0x00A4
wglflags small-data
offset 186
TexEnviv(target, pname, params)
return void
param target TextureEnvTarget in value
param pname TextureEnvParameter in value
param params CheckedInt32 in array [COMPSIZE(pname)]
category drawing-control
version 1.0
glxropcode 114
glsflags gl-enum
glsopcode 0x00A5
wglflags small-data
offset 187
TexGend(coord, pname, param)
return void
param coord TextureCoordName in value
param pname TextureGenParameter in value
param param Float64 in value
category drawing-control
version 1.0
glxropcode 115
glsflags gl-enum
glsopcode 0x00A6
wglflags small-data
offset 188
TexGendv(coord, pname, params)
return void
param coord TextureCoordName in value
param pname TextureGenParameter in value
param params Float64 in array [COMPSIZE(pname)]
category drawing-control
version 1.0
glxropcode 116
glsflags gl-enum
glsopcode 0x00A7
wglflags small-data
offset 189
TexGenf(coord, pname, param)
return void
param coord TextureCoordName in value
param pname TextureGenParameter in value
param param CheckedFloat32 in value
category drawing-control
version 1.0
glxropcode 117
glsflags gl-enum
glsopcode 0x00A8
wglflags small-data
offset 190
TexGenfv(coord, pname, params)
return void
param coord TextureCoordName in value
param pname TextureGenParameter in value
param params CheckedFloat32 in array [COMPSIZE(pname)]
category drawing-control
version 1.0
glxropcode 118
glsflags gl-enum
glsopcode 0x00A9
wglflags small-data
offset 191
TexGeni(coord, pname, param)
return void
param coord TextureCoordName in value
param pname TextureGenParameter in value
param param CheckedInt32 in value
category drawing-control
version 1.0
glxropcode 119
glsflags gl-enum
glsopcode 0x00AA
wglflags small-data
offset 192
TexGeniv(coord, pname, params)
return void
param coord TextureCoordName in value
param pname TextureGenParameter in value
param params CheckedInt32 in array [COMPSIZE(pname)]
category drawing-control
version 1.0
glxropcode 120
glsflags gl-enum
glsopcode 0x00AB
wglflags small-data
offset 193
###############################################################################
#
# feedback commands
#
###############################################################################
FeedbackBuffer(size, type, buffer)
return void
param size SizeI in value
param type FeedbackType in value
param buffer FeedbackElement out array [size] retained
dlflags notlistable
glxflags client-handcode server-handcode
category feedback
version 1.0
glxsingle 105
glsflags client
glsopcode 0x00AC
wglflags client-handcode server-handcode batchable
offset 194
SelectBuffer(size, buffer)
return void
param size SizeI in value
param buffer SelectName out array [size] retained
dlflags notlistable
glxflags client-handcode server-handcode
category feedback
version 1.0
glxsingle 106
glsflags client
glsopcode 0x00AD
wglflags client-handcode server-handcode batchable
offset 195
RenderMode(mode)
return Int32
param mode RenderingMode in value
category feedback
dlflags notlistable
glxflags client-handcode server-handcode
version 1.0
glxsingle 107
glsopcode 0x00AE
wglflags client-handcode server-handcode
offset 196
InitNames()
return void
category feedback
version 1.0
glxropcode 121
glsopcode 0x00AF
offset 197
LoadName(name)
return void
param name SelectName in value
category feedback
version 1.0
glxropcode 122
glsopcode 0x00B0
offset 198
PassThrough(token)
return void
param token FeedbackElement in value
category feedback
version 1.0
glxropcode 123
glsopcode 0x00B1
offset 199
PopName()
return void
category feedback
version 1.0
glxropcode 124
glsopcode 0x00B2
offset 200
PushName(name)
return void
param name SelectName in value
category feedback
version 1.0
glxropcode 125
glsopcode 0x00B3
offset 201
###############################################################################
#
# framebuf commands
#
###############################################################################
DrawBuffer(mode)
return void
param mode DrawBufferMode in value
category framebuf
version 1.0
glxropcode 126
glsopcode 0x00B4
offset 202
Clear(mask)
return void
param mask ClearBufferMask in value
category framebuf
version 1.0
glxropcode 127
glsopcode 0x00B5
offset 203
ClearAccum(red, green, blue, alpha)
return void
param red Float32 in value
param green Float32 in value
param blue Float32 in value
param alpha Float32 in value
category framebuf
version 1.0
glxropcode 128
glsopcode 0x00B6
offset 204
ClearIndex(c)
return void
param c MaskedColorIndexValueF in value
category framebuf
version 1.0
glxropcode 129
glsopcode 0x00B7
offset 205
ClearColor(red, green, blue, alpha)
return void
param red ClampedColorF in value
param green ClampedColorF in value
param blue ClampedColorF in value
param alpha ClampedColorF in value
category framebuf
version 1.0
glxropcode 130
glsopcode 0x00B8
offset 206
ClearStencil(s)
return void
param s StencilValue in value
category framebuf
version 1.0
glxropcode 131
glsopcode 0x00B9
offset 207
ClearDepth(depth)
return void
param depth ClampedFloat64 in value
category framebuf
version 1.0
glxropcode 132
glsopcode 0x00BA
offset 208
StencilMask(mask)
return void
param mask MaskedStencilValue in value
category framebuf
version 1.0
glxropcode 133
glsopcode 0x00BB
offset 209
ColorMask(red, green, blue, alpha)
return void
param red Boolean in value
param green Boolean in value
param blue Boolean in value
param alpha Boolean in value
category framebuf
version 1.0
glxropcode 134
glsopcode 0x00BC
offset 210
DepthMask(flag)
return void
param flag Boolean in value
category framebuf
version 1.0
glxropcode 135
glsopcode 0x00BD
offset 211
IndexMask(mask)
return void
param mask MaskedColorIndexValueI in value
category framebuf
version 1.0
glxropcode 136
glsopcode 0x00BE
offset 212
###############################################################################
#
# misc commands
#
###############################################################################
Accum(op, value)
return void
param op AccumOp in value
param value CoordF in value
category misc
version 1.0
glxropcode 137
glsopcode 0x00BF
offset 213
Disable(cap)
return void
param cap EnableCap in value
category misc
version 1.0
dlflags handcode
glxflags client-handcode client-intercept
glxropcode 138
glsflags client
glsopcode 0x00C0
offset 214
Enable(cap)
return void
param cap EnableCap in value
category misc
version 1.0
dlflags handcode
glxflags client-handcode client-intercept
glxropcode 139
glsflags client
glsopcode 0x00C1
offset 215
Finish()
return void
dlflags notlistable
glxflags client-handcode server-handcode
category misc
version 1.0
glxsingle 108
glsopcode 0x00C2
offset 216
Flush()
return void
dlflags notlistable
glxflags client-handcode client-intercept server-handcode
category misc
version 1.0
glxsingle 142
glsopcode 0x00C3
offset 217
PopAttrib()
return void
category misc
version 1.0
glxropcode 141
glsopcode 0x00C4
offset 218
PushAttrib(mask)
return void
param mask AttribMask in value
category misc
version 1.0
glxropcode 142
glsopcode 0x00C5
offset 219
###############################################################################
#
# modeling commands
#
###############################################################################
Map1d(target, u1, u2, stride, order, points)
return void
param target MapTarget in value
param u1 CoordD in value
param u2 CoordD in value
param stride Int32 in value
param order CheckedInt32 in value
param points CoordD in array [COMPSIZE(target/stride/order)]
category modeling
dlflags handcode
glxflags client-handcode server-handcode
version 1.0
glxropcode 143
glsflags capture-handcode
glsopcode 0x00C6
wglflags client-handcode server-handcode
offset 220
Map1f(target, u1, u2, stride, order, points)
return void
param target MapTarget in value
param u1 CoordF in value
param u2 CoordF in value
param stride Int32 in value
param order CheckedInt32 in value
param points CoordF in array [COMPSIZE(target/stride/order)]
category modeling
dlflags handcode
glxflags client-handcode server-handcode
version 1.0
glxropcode 144
glsflags capture-handcode
glsopcode 0x00C7
wglflags client-handcode server-handcode
offset 221
Map2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points)
return void
param target MapTarget in value
param u1 CoordD in value
param u2 CoordD in value
param ustride Int32 in value
param uorder CheckedInt32 in value
param v1 CoordD in value
param v2 CoordD in value
param vstride Int32 in value
param vorder CheckedInt32 in value
param points CoordD in array [COMPSIZE(target/ustride/uorder/vstride/vorder)]
category modeling
dlflags handcode
glxflags client-handcode server-handcode
version 1.0
glxropcode 145
glsflags capture-handcode
glsopcode 0x00C8
wglflags client-handcode server-handcode
offset 222
Map2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points)
return void
param target MapTarget in value
param u1 CoordF in value
param u2 CoordF in value
param ustride Int32 in value
param uorder CheckedInt32 in value
param v1 CoordF in value
param v2 CoordF in value
param vstride Int32 in value
param vorder CheckedInt32 in value
param points CoordF in array [COMPSIZE(target/ustride/uorder/vstride/vorder)]
category modeling
dlflags handcode
glxflags client-handcode server-handcode
version 1.0
glxropcode 146
glsflags capture-handcode
glsopcode 0x00C9
wglflags client-handcode server-handcode
offset 223
MapGrid1d(un, u1, u2)
return void
param un Int32 in value
param u1 CoordD in value
param u2 CoordD in value
category modeling
version 1.0
glxropcode 147
glsopcode 0x00CA
offset 224
MapGrid1f(un, u1, u2)
return void
param un Int32 in value
param u1 CoordF in value
param u2 CoordF in value
category modeling
version 1.0
glxropcode 148
glsopcode 0x00CB
offset 225
MapGrid2d(un, u1, u2, vn, v1, v2)
return void
param un Int32 in value
param u1 CoordD in value
param u2 CoordD in value
param vn Int32 in value
param v1 CoordD in value
param v2 CoordD in value
category modeling
version 1.0
glxropcode 149
glsopcode 0x00CC
offset 226
MapGrid2f(un, u1, u2, vn, v1, v2)
return void
param un Int32 in value
param u1 CoordF in value
param u2 CoordF in value
param vn Int32 in value
param v1 CoordF in value
param v2 CoordF in value
category modeling
version 1.0
glxropcode 150
glsopcode 0x00CD
offset 227
EvalCoord1d(u)
return void
param u CoordD in value
category modeling
vectorequiv EvalCoord1dv
version 1.0
offset 228
EvalCoord1dv(u)
return void
param u CoordD in array [1]
category modeling
version 1.0
glxropcode 151
glsopcode 0x00CE
offset 229
EvalCoord1f(u)
return void
param u CoordF in value
category modeling
vectorequiv EvalCoord1fv
version 1.0
offset 230
EvalCoord1fv(u)
return void
param u CoordF in array [1]
category modeling
version 1.0
glxropcode 152
glsopcode 0x00CF
offset 231
EvalCoord2d(u, v)
return void
param u CoordD in value
param v CoordD in value
category modeling
vectorequiv EvalCoord2dv
version 1.0
offset 232
EvalCoord2dv(u)
return void
param u CoordD in array [2]
category modeling
version 1.0
glxropcode 153
glsopcode 0x00D0
offset 233
EvalCoord2f(u, v)
return void
param u CoordF in value
param v CoordF in value
category modeling
vectorequiv EvalCoord2fv
version 1.0
offset 234
EvalCoord2fv(u)
return void
param u CoordF in array [2]
category modeling
version 1.0
glxropcode 154
glsopcode 0x00D1
offset 235
EvalMesh1(mode, i1, i2)
return void
param mode MeshMode1 in value
param i1 CheckedInt32 in value
param i2 CheckedInt32 in value
category modeling
version 1.0
glxropcode 155
glsopcode 0x00D2
offset 236
EvalPoint1(i)
return void
param i Int32 in value
category modeling
version 1.0
glxropcode 156
glsopcode 0x00D3
offset 237
EvalMesh2(mode, i1, i2, j1, j2)
return void
param mode MeshMode2 in value
param i1 CheckedInt32 in value
param i2 CheckedInt32 in value
param j1 CheckedInt32 in value
param j2 CheckedInt32 in value
category modeling
version 1.0
glxropcode 157
glsopcode 0x00D4
offset 238
EvalPoint2(i, j)
return void
param i CheckedInt32 in value
param j CheckedInt32 in value
category modeling
version 1.0
glxropcode 158
glsopcode 0x00D5
offset 239
###############################################################################
#
# pixel-op commands
#
###############################################################################
AlphaFunc(func, ref)
return void
param func AlphaFunction in value
param ref ClampedFloat32 in value
category pixel-op
version 1.0
glxropcode 159
glsopcode 0x00D6
offset 240
BlendFunc(sfactor, dfactor)
return void
param sfactor BlendingFactorSrc in value
param dfactor BlendingFactorDest in value
category pixel-op
version 1.0
glxropcode 160
glsopcode 0x00D7
offset 241
LogicOp(opcode)
return void
param opcode LogicOp in value
category pixel-op
version 1.0
glxropcode 161
glsopcode 0x00D8
offset 242
StencilFunc(func, ref, mask)
return void
param func StencilFunction in value
param ref ClampedStencilValue in value
param mask MaskedStencilValue in value
category pixel-op
version 1.0
glxropcode 162
glsopcode 0x00D9
offset 243
StencilOp(fail, zfail, zpass)
return void
param fail StencilOp in value
param zfail StencilOp in value
param zpass StencilOp in value
category pixel-op
version 1.0
glxropcode 163
glsopcode 0x00DA
offset 244
DepthFunc(func)
return void
param func DepthFunction in value
category pixel-op
version 1.0
glxropcode 164
glsopcode 0x00DB
offset 245
###############################################################################
#
# pixel-rw commands
#
###############################################################################
PixelZoom(xfactor, yfactor)
return void
param xfactor Float32 in value
param yfactor Float32 in value
category pixel-rw
version 1.0
glxropcode 165
glsopcode 0x00DC
offset 246
PixelTransferf(pname, param)
return void
param pname PixelTransferParameter in value
param param CheckedFloat32 in value
category pixel-rw
version 1.0
glxropcode 166
glsflags gl-enum
glsopcode 0x00DD
offset 247
PixelTransferi(pname, param)
return void
param pname PixelTransferParameter in value
param param CheckedInt32 in value
category pixel-rw
version 1.0
glxropcode 167
glsflags gl-enum
glsopcode 0x00DE
offset 248
PixelStoref(pname, param)
return void
param pname PixelStoreParameter in value
param param CheckedFloat32 in value
dlflags notlistable
glxflags client-handcode
category pixel-rw
version 1.0
glxsingle 109
glsflags client gl-enum
glsopcode 0x00DF
wglflags batchable
offset 249
PixelStorei(pname, param)
return void
param pname PixelStoreParameter in value
param param CheckedInt32 in value
dlflags notlistable
glxflags client-handcode
category pixel-rw
version 1.0
glxsingle 110
glsflags client gl-enum
glsopcode 0x00E0
wglflags batchable
offset 250
PixelMapfv(map, mapsize, values)
return void
param map PixelMap in value
param mapsize CheckedInt32 in value
param values Float32 in array [mapsize]
category pixel-rw
glxflags client-handcode
version 1.0
glxropcode 168
glsopcode 0x00E1
offset 251
PixelMapuiv(map, mapsize, values)
return void
param map PixelMap in value
param mapsize CheckedInt32 in value
param values UInt32 in array [mapsize]
category pixel-rw
glxflags client-handcode
version 1.0
glxropcode 169
glsopcode 0x00E2
offset 252
PixelMapusv(map, mapsize, values)
return void
param map PixelMap in value
param mapsize CheckedInt32 in value
param values UInt16 in array [mapsize]
category pixel-rw
glxflags client-handcode
version 1.0
glxropcode 170
glsopcode 0x00E3
offset 253
ReadBuffer(mode)
return void
param mode ReadBufferMode in value
category pixel-rw
version 1.0
glxropcode 171
glsopcode 0x00E4
offset 254
CopyPixels(x, y, width, height, type)
return void
param x WinCoord in value
param y WinCoord in value
param width SizeI in value
param height SizeI in value
param type PixelCopyType in value
category pixel-rw
version 1.0
glxropcode 172
glsopcode 0x00E5
offset 255
ReadPixels(x, y, width, height, format, type, pixels)
return void
param x WinCoord in value
param y WinCoord in value
param width SizeI in value
param height SizeI in value
param format PixelFormat in value
param type PixelType in value
param pixels Void out array [COMPSIZE(format/type/width/height)]
category pixel-rw
dlflags notlistable
glxflags client-handcode server-handcode
version 1.0
glxsingle 111
glsflags get pixel-pack
glsopcode 0x00E6
wglflags client-handcode server-handcode
offset 256
DrawPixels(width, height, format, type, pixels)
return void
param width SizeI in value
param height SizeI in value
param format PixelFormat in value
param type PixelType in value
param pixels Void in array [COMPSIZE(format/type/width/height)]
category pixel-rw
dlflags handcode
glxflags client-handcode server-handcode
version 1.0
glxropcode 173
glsflags pixel-unpack
glsopcode 0x00E7
wglflags client-handcode server-handcode
offset 257
###############################################################################
#
# state-req commands
#
###############################################################################
GetBooleanv(pname, params)
return void
param pname GetPName in value
param params Boolean out array [COMPSIZE(pname)]
category state-req
dlflags notlistable
glxflags client-handcode
version 1.0
glxsingle 112
glsflags client get
glsopcode 0x00E8
wglflags small-data
offset 258
GetClipPlane(plane, equation)
return void
param plane ClipPlaneName in value
param equation Float64 out array [4]
category state-req
dlflags notlistable
version 1.0
glxsingle 113
glxflags client-handcode server-handcode
glsflags get
glsopcode 0x00E9
offset 259
GetDoublev(pname, params)
return void
param pname GetPName in value
param params Float64 out array [COMPSIZE(pname)]
category state-req
dlflags notlistable
glxflags client-handcode
version 1.0
glxsingle 114
glsflags client get
glsopcode 0x00EA
wglflags small-data
offset 260
GetError()
return ErrorCode
category state-req
dlflags notlistable
glxflags client-handcode
version 1.0
glxsingle 115
glsflags get
glsopcode 0x00EB
offset 261
GetFloatv(pname, params)
return void
param pname GetPName in value
param params Float32 out array [COMPSIZE(pname)]
category state-req
dlflags notlistable
glxflags client-handcode
version 1.0
glxsingle 116
glsflags client get
glsopcode 0x00EC
wglflags small-data
offset 262
GetIntegerv(pname, params)
return void
param pname GetPName in value
param params Int32 out array [COMPSIZE(pname)]
category state-req
dlflags notlistable
glxflags client-handcode
version 1.0
glxsingle 117
glsflags client get
glsopcode 0x00ED
wglflags small-data
offset 263
GetLightfv(light, pname, params)
return void
param light LightName in value
param pname LightParameter in value
param params Float32 out array [COMPSIZE(pname)]
category state-req
dlflags notlistable
version 1.0
glxsingle 118
glsflags get
glsopcode 0x00EE
wglflags small-data
offset 264
GetLightiv(light, pname, params)
return void
param light LightName in value
param pname LightParameter in value
param params Int32 out array [COMPSIZE(pname)]
category state-req
dlflags notlistable
version 1.0
glxsingle 119
glsflags get
glsopcode 0x00EF
wglflags small-data
offset 265
GetMapdv(target, query, v)
return void
param target MapTarget in value
param query GetMapQuery in value
param v Float64 out array [COMPSIZE(target/query)]
category state-req
dlflags notlistable
version 1.0
glxsingle 120
glsflags get
glsopcode 0x00F0
offset 266
GetMapfv(target, query, v)
return void
param target MapTarget in value
param query GetMapQuery in value
param v Float32 out array [COMPSIZE(target/query)]
category state-req
dlflags notlistable
version 1.0
glxsingle 121
glsflags get
glsopcode 0x00F1
offset 267
GetMapiv(target, query, v)
return void
param target MapTarget in value
param query GetMapQuery in value
param v Int32 out array [COMPSIZE(target/query)]
category state-req
dlflags notlistable
version 1.0
glxsingle 122
glsflags get
glsopcode 0x00F2
offset 268
GetMaterialfv(face, pname, params)
return void
param face MaterialFace in value
param pname MaterialParameter in value
param params Float32 out array [COMPSIZE(pname)]
category state-req
dlflags notlistable
version 1.0
glxsingle 123
glsflags get
glsopcode 0x00F3
wglflags small-data
offset 269
GetMaterialiv(face, pname, params)
return void
param face MaterialFace in value
param pname MaterialParameter in value
param params Int32 out array [COMPSIZE(pname)]
category state-req
dlflags notlistable
version 1.0
glxsingle 124
glsflags get
glsopcode 0x00F4
wglflags small-data
offset 270
GetPixelMapfv(map, values)
return void
param map PixelMap in value
param values Float32 out array [COMPSIZE(map)]
category state-req
dlflags notlistable
version 1.0
glxsingle 125
glsflags get
glsopcode 0x00F5
offset 271
GetPixelMapuiv(map, values)
return void
param map PixelMap in value
param values UInt32 out array [COMPSIZE(map)]
category state-req
dlflags notlistable
version 1.0
glxsingle 126
glsflags get
glsopcode 0x00F6
offset 272
GetPixelMapusv(map, values)
return void
param map PixelMap in value
param values UInt16 out array [COMPSIZE(map)]
category state-req
dlflags notlistable
version 1.0
glxsingle 127
glsflags get
glsopcode 0x00F7
offset 273
GetPolygonStipple(mask)
return void
param mask UInt8 out array [COMPSIZE()]
category state-req
dlflags notlistable
glxflags client-handcode server-handcode
version 1.0
glxsingle 128
glsflags get pixel-pack
glsopcode 0x00F8
wglflags client-handcode server-handcode
offset 274
GetString(name)
return String
param name StringName in value
category state-req
dlflags notlistable
glxflags client-handcode server-handcode
version 1.0
glxsingle 129
glsflags get
glsopcode 0x00F9
wglflags client-handcode server-handcode
offset 275
GetTexEnvfv(target, pname, params)
return void
param target TextureEnvTarget in value
param pname TextureEnvParameter in value
param params Float32 out array [COMPSIZE(pname)]
category state-req
dlflags notlistable
version 1.0
glxsingle 130
glsflags get
glsopcode 0x00FA
wglflags small-data
offset 276
GetTexEnviv(target, pname, params)
return void
param target TextureEnvTarget in value
param pname TextureEnvParameter in value
param params Int32 out array [COMPSIZE(pname)]
category state-req
dlflags notlistable
version 1.0
glxsingle 131
glsflags get
glsopcode 0x00FB
wglflags small-data
offset 277
GetTexGendv(coord, pname, params)
return void
param coord TextureCoordName in value
param pname TextureGenParameter in value
param params Float64 out array [COMPSIZE(pname)]
category state-req
dlflags notlistable
version 1.0
glxsingle 132
glsflags get
glsopcode 0x00FC
wglflags small-data
offset 278
GetTexGenfv(coord, pname, params)
return void
param coord TextureCoordName in value
param pname TextureGenParameter in value
param params Float32 out array [COMPSIZE(pname)]
category state-req
dlflags notlistable
version 1.0
glxsingle 133
glsflags get
glsopcode 0x00FD
wglflags small-data
offset 279
GetTexGeniv(coord, pname, params)
return void
param coord TextureCoordName in value
param pname TextureGenParameter in value
param params Int32 out array [COMPSIZE(pname)]
category state-req
dlflags notlistable
version 1.0
glxsingle 134
glsflags get
glsopcode 0x00FE
wglflags small-data
offset 280
GetTexImage(target, level, format, type, pixels)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param format PixelFormat in value
param type PixelType in value
param pixels Void out array [COMPSIZE(target/level/format/type)]
category state-req
dlflags notlistable
glxflags client-handcode server-handcode
version 1.0
glxsingle 135
glsflags get pixel-pack
glsopcode 0x00FF
wglflags client-handcode server-handcode
offset 281
GetTexParameterfv(target, pname, params)
return void
param target TextureTarget in value
param pname GetTextureParameter in value
param params Float32 out array [COMPSIZE(pname)]
category state-req
dlflags notlistable
version 1.0
glxsingle 136
glsflags get
glsopcode 0x0100
wglflags small-data
offset 282
GetTexParameteriv(target, pname, params)
return void
param target TextureTarget in value
param pname GetTextureParameter in value
param params Int32 out array [COMPSIZE(pname)]
category state-req
dlflags notlistable
version 1.0
glxsingle 137
glsflags get
glsopcode 0x0101
wglflags small-data
offset 283
GetTexLevelParameterfv(target, level, pname, params)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param pname GetTextureParameter in value
param params Float32 out array [COMPSIZE(pname)]
category state-req
dlflags notlistable
version 1.0
glxsingle 138
glsflags get
glsopcode 0x0102
wglflags small-data
offset 284
GetTexLevelParameteriv(target, level, pname, params)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param pname GetTextureParameter in value
param params Int32 out array [COMPSIZE(pname)]
category state-req
dlflags notlistable
version 1.0
glxsingle 139
glsflags get
glsopcode 0x0103
wglflags small-data
offset 285
IsEnabled(cap)
return Boolean
param cap EnableCap in value
category state-req
dlflags notlistable
version 1.0
glxflags client-handcode client-intercept
glxsingle 140
glsflags client get
glsopcode 0x0104
offset 286
IsList(list)
return Boolean
param list List in value
category state-req
dlflags notlistable
version 1.0
glxsingle 141
glsflags get
glsopcode 0x0105
offset 287
###############################################################################
#
# xform commands
#
###############################################################################
DepthRange(near, far)
return void
param near ClampedFloat64 in value
param far ClampedFloat64 in value
category xform
version 1.0
glxropcode 174
glsopcode 0x0106
offset 288
Frustum(left, right, bottom, top, zNear, zFar)
return void
param left Float64 in value
param right Float64 in value
param bottom Float64 in value
param top Float64 in value
param zNear Float64 in value
param zFar Float64 in value
category xform
version 1.0
glxropcode 175
glsopcode 0x0107
offset 289
LoadIdentity()
return void
category xform
version 1.0
glxropcode 176
glsopcode 0x0108
offset 290
LoadMatrixf(m)
return void
param m Float32 in array [16]
category xform
version 1.0
glxropcode 177
glsflags matrix
glsopcode 0x0109
offset 291
LoadMatrixd(m)
return void
param m Float64 in array [16]
category xform
version 1.0
glxropcode 178
glsflags matrix
glsopcode 0x010A
offset 292
MatrixMode(mode)
return void
param mode MatrixMode in value
category xform
version 1.0
glxropcode 179
glsopcode 0x010B
offset 293
MultMatrixf(m)
return void
param m Float32 in array [16]
category xform
version 1.0
glxropcode 180
glsflags matrix
glsopcode 0x010C
offset 294
MultMatrixd(m)
return void
param m Float64 in array [16]
category xform
version 1.0
glxropcode 181
glsflags matrix
glsopcode 0x010D
offset 295
Ortho(left, right, bottom, top, zNear, zFar)
return void
param left Float64 in value
param right Float64 in value
param bottom Float64 in value
param top Float64 in value
param zNear Float64 in value
param zFar Float64 in value
category xform
version 1.0
glxropcode 182
glsopcode 0x010E
offset 296
PopMatrix()
return void
category xform
version 1.0
glxropcode 183
glsopcode 0x010F
offset 297
PushMatrix()
return void
category xform
version 1.0
glxropcode 184
glsopcode 0x0110
offset 298
Rotated(angle, x, y, z)
return void
param angle Float64 in value
param x Float64 in value
param y Float64 in value
param z Float64 in value
category xform
version 1.0
glxropcode 185
glsopcode 0x0111
offset 299
Rotatef(angle, x, y, z)
return void
param angle Float32 in value
param x Float32 in value
param y Float32 in value
param z Float32 in value
category xform
version 1.0
glxropcode 186
glsopcode 0x0112
offset 300
Scaled(x, y, z)
return void
param x Float64 in value
param y Float64 in value
param z Float64 in value
category xform
version 1.0
glxropcode 187
glsopcode 0x0113
offset 301
Scalef(x, y, z)
return void
param x Float32 in value
param y Float32 in value
param z Float32 in value
category xform
version 1.0
glxropcode 188
glsopcode 0x0114
offset 302
Translated(x, y, z)
return void
param x Float64 in value
param y Float64 in value
param z Float64 in value
category xform
version 1.0
glxropcode 189
glsopcode 0x0115
offset 303
Translatef(x, y, z)
return void
param x Float32 in value
param y Float32 in value
param z Float32 in value
category xform
version 1.0
glxropcode 190
glsopcode 0x0116
offset 304
Viewport(x, y, width, height)
return void
param x WinCoord in value
param y WinCoord in value
param width SizeI in value
param height SizeI in value
category xform
version 1.0
glxropcode 191
glsopcode 0x0117
offset 305
###############################################################################
#
# OpenGL 1.1 commands
#
###############################################################################
ArrayElement(i)
return void
param i Int32 in value
category 1_1
dlflags handcode
glxflags client-handcode client-intercept server-handcode
version 1.1
glsopcode 0x013E
offset 306
ColorPointer(size, type, stride, pointer)
return void
param size Int32 in value
param type ColorPointerType in value
param stride SizeI in value
param pointer Void in array [COMPSIZE(size/type/stride)] retained
category 1_1
dlflags notlistable
glxflags client-handcode client-intercept server-handcode
version 1.1
glsflags client
glsopcode 0x0152
offset 308
DisableClientState(array)
return void
param array EnableCap in value
category 1_1
version 1.1
dlflags notlistable
glxflags client-handcode client-intercept server-handcode
glsflags client
glsopcode 0x0153
offset 309
DrawArrays(mode, first, count)
return void
param mode BeginMode in value
param first Int32 in value
param count SizeI in value
category 1_1
dlflags handcode
glxflags client-handcode client-intercept server-handcode
version 1.1
glxropcode 193
glsopcode 0x0258
offset 310
DrawElements(mode, count, type, indices)
return void
param mode BeginMode in value
param count SizeI in value
param type DrawElementsType in value
param indices Void in array [COMPSIZE(count/type)]
category 1_1
dlflags handcode
glxflags client-handcode client-intercept server-handcode
version 1.1
glsopcode 0x0154
offset 311
EdgeFlagPointer(stride, pointer)
return void
param stride SizeI in value
param pointer Void in array [COMPSIZE(stride)] retained
category 1_1
dlflags notlistable
glxflags client-handcode client-intercept server-handcode
version 1.1
glsflags client
glsopcode 0x0155
offset 312
EnableClientState(array)
return void
param array EnableCap in value
category 1_1
dlflags notlistable
glxflags client-handcode client-intercept server-handcode
version 1.1
glsflags client
glsopcode 0x0156
offset 313
GetPointerv(pname, params)
return void
param pname GetPointervPName in value
param params VoidPointer out array [1]
category 1_1
dlflags notlistable
glxflags client-handcode client-intercept server-handcode
version 1.1
glsflags client get
glsopcode 0x0142
offset 329
IndexPointer(type, stride, pointer)
return void
param type IndexPointerType in value
param stride SizeI in value
param pointer Void in array [COMPSIZE(type/stride)] retained
category 1_1
dlflags notlistable
glxflags client-handcode client-intercept server-handcode
version 1.1
glsflags client
glsopcode 0x0157
offset 314
InterleavedArrays(format, stride, pointer)
return void
param format InterleavedArrayFormat in value
param stride SizeI in value
param pointer Void in array [COMPSIZE(format/stride)] retained
category 1_1
dlflags notlistable
glxflags client-handcode client-intercept server-handcode
version 1.1
glsflags client
glsopcode 0x0158
offset 317
NormalPointer(type, stride, pointer)
return void
param type NormalPointerType in value
param stride SizeI in value
param pointer Void in array [COMPSIZE(type/stride)] retained
category 1_1
dlflags notlistable
glxflags client-handcode client-intercept server-handcode
version 1.1
glsflags client
glsopcode 0x0159
offset 318
TexCoordPointer(size, type, stride, pointer)
return void
param size Int32 in value
param type TexCoordPointerType in value
param stride SizeI in value
param pointer Void in array [COMPSIZE(size/type/stride)] retained
category 1_1
dlflags notlistable
glxflags client-handcode client-intercept server-handcode
version 1.1
glsflags client
glsopcode 0x015A
offset 320
VertexPointer(size, type, stride, pointer)
return void
param size Int32 in value
param type VertexPointerType in value
param stride SizeI in value
param pointer Void in array [COMPSIZE(size/type/stride)] retained
category 1_1
dlflags notlistable
glxflags client-handcode client-intercept server-handcode
version 1.1
glsflags client
glsopcode 0x015B
offset 321
PolygonOffset(factor, units)
return void
param factor Float32 in value
param units Float32 in value
category 1_1
version 1.1
glxropcode 192
glsopcode 0x015C
offset 319
# Arguably TexelInternalFormat, not PixelInternalFormat
CopyTexImage1D(target, level, internalformat, x, y, width, border)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param internalformat PixelInternalFormat in value
param x WinCoord in value
param y WinCoord in value
param width SizeI in value
param border CheckedInt32 in value
category 1_1
version 1.1
glxropcode 4119
glxflags EXT
glsopcode 0x014D
offset 323
# Arguably TexelInternalFormat, not PixelInternalFormat
CopyTexImage2D(target, level, internalformat, x, y, width, height, border)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param internalformat PixelInternalFormat in value
param x WinCoord in value
param y WinCoord in value
param width SizeI in value
param height SizeI in value
param border CheckedInt32 in value
category 1_1
version 1.1
glxropcode 4120
glxflags EXT
glsopcode 0x014E
offset 324
CopyTexSubImage1D(target, level, xoffset, x, y, width)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param xoffset CheckedInt32 in value
param x WinCoord in value
param y WinCoord in value
param width SizeI in value
category 1_1
version 1.1
glxropcode 4121
glxflags EXT
glsopcode 0x014F
offset 325
CopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param xoffset CheckedInt32 in value
param yoffset CheckedInt32 in value
param x WinCoord in value
param y WinCoord in value
param width SizeI in value
param height SizeI in value
category 1_1
version 1.1
glxropcode 4122
glxflags EXT
glsopcode 0x0150
offset 326
TexSubImage1D(target, level, xoffset, width, format, type, pixels)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param xoffset CheckedInt32 in value
param width SizeI in value
param format PixelFormat in value
param type PixelType in value
param pixels Void in array [COMPSIZE(format/type/width)]
category 1_1
dlflags handcode
glxflags EXT client-handcode server-handcode
version 1.1
glxropcode 4099
glsflags pixel-unpack
glsopcode 0x0123
offset 332
TexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param xoffset CheckedInt32 in value
param yoffset CheckedInt32 in value
param width SizeI in value
param height SizeI in value
param format PixelFormat in value
param type PixelType in value
param pixels Void in array [COMPSIZE(format/type/width/height)]
category 1_1
dlflags handcode
glxflags EXT client-handcode server-handcode
version 1.1
glxropcode 4100
glsflags pixel-unpack
glsopcode 0x0124
offset 333
AreTexturesResident(n, textures, residences)
return Boolean
param n SizeI in value
param textures Texture in array [n]
param residences Boolean out array [n]
category 1_1
glxsingle 143
dlflags notlistable
version 1.1
glsflags get
glsopcode 0x0259
offset 322
BindTexture(target, texture)
return void
param target TextureTarget in value
param texture Texture in value
category 1_1
version 1.1
glxropcode 4117
glxflags EXT
glsopcode 0x0148
offset 307
DeleteTextures(n, textures)
return void
param n SizeI in value
param textures Texture in array [n]
category 1_1
dlflags notlistable
version 1.1
glxsingle 144
glsopcode 0x025A
offset 327
GenTextures(n, textures)
return void
param n SizeI in value
param textures Texture out array [n]
category 1_1
dlflags notlistable
version 1.1
glxsingle 145
glsopcode 0x025B
offset 328
IsTexture(texture)
return Boolean
param texture Texture in value
category 1_1
dlflags notlistable
version 1.1
glxsingle 146
glsflags get
glsopcode 0x025C
offset 330
PrioritizeTextures(n, textures, priorities)
return void
param n SizeI in value
param textures Texture in array [n]
param priorities ClampedFloat32 in array [n]
category 1_1
version 1.1
glxropcode 4118
glxflags EXT
glsopcode 0x014C
offset 331
Indexub(c)
return void
param c ColorIndexValueUB in value
category 1_1
vectorequiv Indexubv
version 1.1
offset 315
Indexubv(c)
return void
param c ColorIndexValueUB in array [1]
category 1_1
version 1.1
glxropcode 194
glsopcode 0x015D
offset 316
PopClientAttrib()
return void
category 1_1
version 1.1
dlflags notlistable
glxflags client-handcode client-intercept server-handcode
glsflags client
glsopcode 0x015E
offset 334
PushClientAttrib(mask)
return void
param mask ClientAttribMask in value
category 1_1
version 1.1
dlflags notlistable
glxflags client-handcode client-intercept server-handcode
glsflags client
glsopcode 0x015F
offset 335
###############################################################################
###############################################################################
#
# OpenGL 1.2 commands
#
###############################################################################
###############################################################################
BlendColor(red, green, blue, alpha)
return void
param red ClampedColorF in value
param green ClampedColorF in value
param blue ClampedColorF in value
param alpha ClampedColorF in value
category VERSION_1_2
glxflags EXT
version 1.2
glxropcode 4096
glsopcode 0x0120
offset 336
BlendEquation(mode)
return void
param mode BlendEquationMode in value
category VERSION_1_2
glxflags EXT
version 1.2
glxropcode 4097
glsopcode 0x0121
offset 337
DrawRangeElements(mode, start, end, count, type, indices)
return void
param mode BeginMode in value
param start UInt32 in value
param end UInt32 in value
param count SizeI in value
param type DrawElementsType in value
param indices Void in array [COMPSIZE(count/type)]
category VERSION_1_2
dlflags handcode
glxflags client-handcode client-intercept server-handcode
version 1.2
glsopcode 0x0190
offset 338
# OpenGL 1.2 (SGI_color_table) commands
ColorTable(target, internalformat, width, format, type, table)
return void
param target ColorTableTarget in value
param internalformat PixelInternalFormat in value
param width SizeI in value
param format PixelFormat in value
param type PixelType in value
param table Void in array [COMPSIZE(format/type/width)]
category VERSION_1_2
dlflags handcode
glxflags client-handcode server-handcode EXT
version 1.2
glxropcode 2053
glsflags pixel-unpack
glsopcode 0x0167
offset 339
ColorTableParameterfv(target, pname, params)
return void
param target ColorTableTarget in value
param pname ColorTableParameterPName in value
param params CheckedFloat32 in array [COMPSIZE(pname)]
category VERSION_1_2
glxflags EXT
version 1.2
glxropcode 2054
glsopcode 0x0168
offset 340
ColorTableParameteriv(target, pname, params)
return void
param target ColorTableTarget in value
param pname ColorTableParameterPName in value
param params CheckedInt32 in array [COMPSIZE(pname)]
category VERSION_1_2
glxflags EXT
version 1.2
glxropcode 2055
glsopcode 0x0169
offset 341
CopyColorTable(target, internalformat, x, y, width)
return void
param target ColorTableTarget in value
param internalformat PixelInternalFormat in value
param x WinCoord in value
param y WinCoord in value
param width SizeI in value
category VERSION_1_2
glxflags EXT
version 1.2
glxropcode 2056
glsopcode 0x016A
offset 342
GetColorTable(target, format, type, table)
return void
param target ColorTableTarget in value
param format PixelFormat in value
param type PixelType in value
param table Void out array [COMPSIZE(target/format/type)]
category VERSION_1_2
dlflags notlistable
glxflags client-handcode server-handcode
version 1.2
glxsingle 147
glsflags get pixel-pack
glsopcode 0x025D
offset 343
GetColorTableParameterfv(target, pname, params)
return void
param target ColorTableTarget in value
param pname GetColorTableParameterPName in value
param params Float32 out array [COMPSIZE(pname)]
category VERSION_1_2
dlflags notlistable
version 1.2
glxsingle 148
glsflags get
glsopcode 0x025E
offset 344
GetColorTableParameteriv(target, pname, params)
return void
param target ColorTableTarget in value
param pname GetColorTableParameterPName in value
param params Int32 out array [COMPSIZE(pname)]
category VERSION_1_2
dlflags notlistable
version 1.2
glxsingle 149
glsflags get
glsopcode 0x025F
offset 345
# OpenGL 1.2 (EXT_color_subtable) commands
ColorSubTable(target, start, count, format, type, data)
return void
param target ColorTableTarget in value
param start SizeI in value
param count SizeI in value
param format PixelFormat in value
param type PixelType in value
param data Void in array [COMPSIZE(format/type/count)]
category VERSION_1_2
dlflags handcode
glxflags client-handcode server-handcode
version 1.2
glxropcode 195
glsflags pixel-unpack
glsopcode 0x018E
offset 346
CopyColorSubTable(target, start, x, y, width)
return void
param target ColorTableTarget in value
param start SizeI in value
param x WinCoord in value
param y WinCoord in value
param width SizeI in value
category VERSION_1_2
version 1.2
glxropcode 196
glsopcode 0x018F
offset 347
# OpenGL 1.2 (EXT_convolution) commands
ConvolutionFilter1D(target, internalformat, width, format, type, image)
return void
param target ConvolutionTarget in value
param internalformat PixelInternalFormat in value
param width SizeI in value
param format PixelFormat in value
param type PixelType in value
param image Void in array [COMPSIZE(format/type/width)]
category VERSION_1_2
dlflags handcode
glxflags client-handcode server-handcode EXT
version 1.2
glxropcode 4101
glsflags pixel-unpack
glsopcode 0x0125
offset 348
ConvolutionFilter2D(target, internalformat, width, height, format, type, image)
return void
param target ConvolutionTarget in value
param internalformat PixelInternalFormat in value
param width SizeI in value
param height SizeI in value
param format PixelFormat in value
param type PixelType in value
param image Void in array [COMPSIZE(format/type/width/height)]
category VERSION_1_2
dlflags handcode
glxflags client-handcode server-handcode EXT
version 1.2
glxropcode 4102
glsflags pixel-unpack
glsopcode 0x0126
offset 349
ConvolutionParameterf(target, pname, params)
return void
param target ConvolutionTarget in value
param pname ConvolutionParameter in value
param params CheckedFloat32 in value
category VERSION_1_2
glxflags EXT
version 1.2
glxropcode 4103
glsflags gl-enum
glsopcode 0x0127
offset 350
ConvolutionParameterfv(target, pname, params)
return void
param target ConvolutionTarget in value
param pname ConvolutionParameter in value
param params CheckedFloat32 in array [COMPSIZE(pname)]
category VERSION_1_2
glxflags EXT
version 1.2
glxropcode 4104
glsflags gl-enum
glsopcode 0x0128
offset 351
ConvolutionParameteri(target, pname, params)
return void
param target ConvolutionTarget in value
param pname ConvolutionParameter in value
param params CheckedInt32 in value
category VERSION_1_2
glxflags EXT
version 1.2
glxropcode 4105
glsflags gl-enum
glsopcode 0x0129
offset 352
ConvolutionParameteriv(target, pname, params)
return void
param target ConvolutionTarget in value
param pname ConvolutionParameter in value
param params CheckedInt32 in array [COMPSIZE(pname)]
category VERSION_1_2
glxflags EXT
version 1.2
glxropcode 4106
glsflags gl-enum
glsopcode 0x012A
offset 353
CopyConvolutionFilter1D(target, internalformat, x, y, width)
return void
param target ConvolutionTarget in value
param internalformat PixelInternalFormat in value
param x WinCoord in value
param y WinCoord in value
param width SizeI in value
category VERSION_1_2
glxflags EXT
version 1.2
glxropcode 4107
glsopcode 0x012B
offset 354
CopyConvolutionFilter2D(target, internalformat, x, y, width, height)
return void
param target ConvolutionTarget in value
param internalformat PixelInternalFormat in value
param x WinCoord in value
param y WinCoord in value
param width SizeI in value
param height SizeI in value
category VERSION_1_2
glxflags EXT
version 1.2
glxropcode 4108
glsopcode 0x012C
offset 355
GetConvolutionFilter(target, format, type, image)
return void
param target ConvolutionTarget in value
param format PixelFormat in value
param type PixelType in value
param image Void out array [COMPSIZE(target/format/type)]
category VERSION_1_2
dlflags notlistable
glxflags client-handcode server-handcode
version 1.2
glxsingle 150
glsflags get pixel-pack
glsopcode 0x0260
offset 356
GetConvolutionParameterfv(target, pname, params)
return void
param target ConvolutionTarget in value
param pname GetConvolutionParameterPName in value
param params Float32 out array [COMPSIZE(pname)]
category VERSION_1_2
dlflags notlistable
version 1.2
glxsingle 151
glsflags get
glsopcode 0x0261
offset 357
GetConvolutionParameteriv(target, pname, params)
return void
param target ConvolutionTarget in value
param pname GetConvolutionParameterPName in value
param params Int32 out array [COMPSIZE(pname)]
category VERSION_1_2
dlflags notlistable
version 1.2
glxsingle 152
glsflags get
glsopcode 0x0262
offset 358
GetSeparableFilter(target, format, type, row, column, span)
return void
param target SeparableTarget in value
param format PixelFormat in value
param type PixelType in value
param row Void out array [COMPSIZE(target/format/type)]
param column Void out array [COMPSIZE(target/format/type)]
param span Void out array [COMPSIZE(target/format/type)]
category VERSION_1_2
dlflags notlistable
glxflags client-handcode server-handcode
version 1.2
glxsingle 153
glsflags get pixel-pack
glsopcode 0x0263
offset 359
SeparableFilter2D(target, internalformat, width, height, format, type, row, column)
return void
param target SeparableTarget in value
param internalformat PixelInternalFormat in value
param width SizeI in value
param height SizeI in value
param format PixelFormat in value
param type PixelType in value
param row Void in array [COMPSIZE(target/format/type/width)]
param column Void in array [COMPSIZE(target/format/type/height)]
category VERSION_1_2
dlflags handcode
glxflags client-handcode server-handcode EXT
version 1.2
glxropcode 4109
glsflags pixel-unpack
glsopcode 0x0131
offset 360
# OpenGL 1.2 (EXT_histogram) commands
GetHistogram(target, reset, format, type, values)
return void
param target HistogramTarget in value
param reset Boolean in value
param format PixelFormat in value
param type PixelType in value
param values Void out array [COMPSIZE(target/format/type)]
category VERSION_1_2
dlflags notlistable
glxflags client-handcode server-handcode
version 1.2
glxsingle 154
glsflags get pixel-pack
glsopcode 0x0264
offset 361
GetHistogramParameterfv(target, pname, params)
return void
param target HistogramTarget in value
param pname GetHistogramParameterPName in value
param params Float32 out array [COMPSIZE(pname)]
category VERSION_1_2
dlflags notlistable
version 1.2
glxsingle 155
glsflags get
glsopcode 0x0265
offset 362
GetHistogramParameteriv(target, pname, params)
return void
param target HistogramTarget in value
param pname GetHistogramParameterPName in value
param params Int32 out array [COMPSIZE(pname)]
category VERSION_1_2
dlflags notlistable
version 1.2
glxsingle 156
glsflags get
glsopcode 0x0266
offset 363
GetMinmax(target, reset, format, type, values)
return void
param target MinmaxTarget in value
param reset Boolean in value
param format PixelFormat in value
param type PixelType in value
param values Void out array [COMPSIZE(target/format/type)]
category VERSION_1_2
dlflags notlistable
glxflags client-handcode server-handcode
version 1.2
glxsingle 157
glsflags get pixel-pack
glsopcode 0x0267
offset 364
GetMinmaxParameterfv(target, pname, params)
return void
param target MinmaxTarget in value
param pname GetMinmaxParameterPName in value
param params Float32 out array [COMPSIZE(pname)]
category VERSION_1_2
dlflags notlistable
version 1.2
glxsingle 158
glsflags get
glsopcode 0x0268
offset 365
GetMinmaxParameteriv(target, pname, params)
return void
param target MinmaxTarget in value
param pname GetMinmaxParameterPName in value
param params Int32 out array [COMPSIZE(pname)]
category VERSION_1_2
dlflags notlistable
version 1.2
glxsingle 159
glsflags get
glsopcode 0x0269
offset 366
Histogram(target, width, internalformat, sink)
return void
param target HistogramTarget in value
param width SizeI in value
param internalformat PixelInternalFormat in value
param sink Boolean in value
category VERSION_1_2
dlflags handcode
glxflags EXT
version 1.2
glxropcode 4110
glsopcode 0x0138
offset 367
Minmax(target, internalformat, sink)
return void
param target MinmaxTarget in value
param internalformat PixelInternalFormat in value
param sink Boolean in value
category VERSION_1_2
glxflags EXT
version 1.2
glxropcode 4111
glsopcode 0x0139
offset 368
ResetHistogram(target)
return void
param target HistogramTarget in value
category VERSION_1_2
glxflags EXT
version 1.2
glxropcode 4112
glsopcode 0x013A
offset 369
ResetMinmax(target)
return void
param target MinmaxTarget in value
category VERSION_1_2
glxflags EXT
version 1.2
glxropcode 4113
glsopcode 0x013B
offset 370
# OpenGL 1.2 (EXT_texture3D) commands
# Arguably TexelInternalFormat, not PixelInternalFormat
TexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param internalformat TextureComponentCount in value
param width SizeI in value
param height SizeI in value
param depth SizeI in value
param border CheckedInt32 in value
param format PixelFormat in value
param type PixelType in value
param pixels Void in array [COMPSIZE(format/type/width/height/depth)]
category VERSION_1_2
dlflags handcode
glxflags client-handcode server-handcode EXT
version 1.2
glxropcode 4114
glsflags pixel-null pixel-unpack
glsopcode 0x013C
offset 371
TexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param xoffset CheckedInt32 in value
param yoffset CheckedInt32 in value
param zoffset CheckedInt32 in value
param width SizeI in value
param height SizeI in value
param depth SizeI in value
param format PixelFormat in value
param type PixelType in value
param pixels Void in array [COMPSIZE(format/type/width/height/depth)]
category VERSION_1_2
dlflags handcode
glxflags client-handcode server-handcode EXT
version 1.2
glxropcode 4115
glsflags pixel-unpack
glsopcode 0x013D
offset 372
# OpenGL 1.2 (EXT_copy_texture) commands (specific to texture3D)
CopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param xoffset CheckedInt32 in value
param yoffset CheckedInt32 in value
param zoffset CheckedInt32 in value
param x WinCoord in value
param y WinCoord in value
param width SizeI in value
param height SizeI in value
category VERSION_1_2
glxflags EXT
version 1.2
glxropcode 4123
glsopcode 0x0151
offset 373
###############################################################################
###############################################################################
#
# OpenGL 1.3 commands
#
###############################################################################
###############################################################################
# OpenGL 1.3 (ARB_multitexture) commands
ActiveTexture(texture)
return void
param texture TextureUnit in value
category VERSION_1_3
glxflags ARB
version 1.3
glxropcode 197
glsopcode 0x01B1
offset 374
ClientActiveTexture(texture)
return void
param texture TextureUnit in value
category VERSION_1_3
dlflags notlistable
glxflags ARB client-handcode client-intercept server-handcode
version 1.3
glsflags client
glsopcode 0x01B2
offset 375
MultiTexCoord1d(target, s)
return void
param target TextureUnit in value
param s CoordD in value
category VERSION_1_3
glxflags ARB
version 1.3
vectorequiv MultiTexCoord1dv
offset 376
MultiTexCoord1dv(target, v)
return void
param target TextureUnit in value
param v CoordD in array [1]
category VERSION_1_3
glxflags ARB
version 1.3
glxropcode 198
glsopcode 0x01B3
offset 377
MultiTexCoord1f(target, s)
return void
param target TextureUnit in value
param s CoordF in value
category VERSION_1_3
glxflags ARB
version 1.3
vectorequiv MultiTexCoord1fv
offset 378
MultiTexCoord1fv(target, v)
return void
param target TextureUnit in value
param v CoordF in array [1]
category VERSION_1_3
glxflags ARB
version 1.3
glxropcode 199
glsopcode 0x01B4
offset 379
MultiTexCoord1i(target, s)
return void
param target TextureUnit in value
param s CoordI in value
category VERSION_1_3
glxflags ARB
version 1.3
vectorequiv MultiTexCoord1iv
offset 380
MultiTexCoord1iv(target, v)
return void
param target TextureUnit in value
param v CoordI in array [1]
category VERSION_1_3
glxflags ARB
version 1.3
glxropcode 200
glsopcode 0x01B5
offset 381
MultiTexCoord1s(target, s)
return void
param target TextureUnit in value
param s CoordS in value
category VERSION_1_3
glxflags ARB
version 1.3
vectorequiv MultiTexCoord1sv
offset 382
MultiTexCoord1sv(target, v)
return void
param target TextureUnit in value
param v CoordS in array [1]
category VERSION_1_3
glxflags ARB
version 1.3
glxropcode 201
glsopcode 0x01B6
offset 383
MultiTexCoord2d(target, s, t)
return void
param target TextureUnit in value
param s CoordD in value
param t CoordD in value
category VERSION_1_3
glxflags ARB
version 1.3
vectorequiv MultiTexCoord2dv
offset 384
MultiTexCoord2dv(target, v)
return void
param target TextureUnit in value
param v CoordD in array [2]
category VERSION_1_3
glxflags ARB
version 1.3
glxropcode 202
glsopcode 0x01B7
offset 385
MultiTexCoord2f(target, s, t)
return void
param target TextureUnit in value
param s CoordF in value
param t CoordF in value
category VERSION_1_3
glxflags ARB
version 1.3
vectorequiv MultiTexCoord2fv
offset 386
MultiTexCoord2fv(target, v)
return void
param target TextureUnit in value
param v CoordF in array [2]
category VERSION_1_3
glxflags ARB
version 1.3
glxropcode 203
glsopcode 0x01B8
offset 387
MultiTexCoord2i(target, s, t)
return void
param target TextureUnit in value
param s CoordI in value
param t CoordI in value
category VERSION_1_3
glxflags ARB
version 1.3
vectorequiv MultiTexCoord2iv
offset 388
MultiTexCoord2iv(target, v)
return void
param target TextureUnit in value
param v CoordI in array [2]
category VERSION_1_3
glxflags ARB
version 1.3
glxropcode 204
glsopcode 0x01B9
offset 389
MultiTexCoord2s(target, s, t)
return void
param target TextureUnit in value
param s CoordS in value
param t CoordS in value
category VERSION_1_3
glxflags ARB
version 1.3
vectorequiv MultiTexCoord2sv
offset 390
MultiTexCoord2sv(target, v)
return void
param target TextureUnit in value
param v CoordS in array [2]
category VERSION_1_3
glxflags ARB
version 1.3
glxropcode 205
glsopcode 0x01BA
offset 391
MultiTexCoord3d(target, s, t, r)
return void
param target TextureUnit in value
param s CoordD in value
param t CoordD in value
param r CoordD in value
category VERSION_1_3
glxflags ARB
version 1.3
vectorequiv MultiTexCoord3dv
offset 392
MultiTexCoord3dv(target, v)
return void
param target TextureUnit in value
param v CoordD in array [3]
category VERSION_1_3
glxflags ARB
version 1.3
glxropcode 206
glsopcode 0x01BB
offset 393
MultiTexCoord3f(target, s, t, r)
return void
param target TextureUnit in value
param s CoordF in value
param t CoordF in value
param r CoordF in value
category VERSION_1_3
glxflags ARB
version 1.3
vectorequiv MultiTexCoord3fv
offset 394
MultiTexCoord3fv(target, v)
return void
param target TextureUnit in value
param v CoordF in array [3]
category VERSION_1_3
glxflags ARB
version 1.3
glxropcode 207
glsopcode 0x01BC
offset 395
MultiTexCoord3i(target, s, t, r)
return void
param target TextureUnit in value
param s CoordI in value
param t CoordI in value
param r CoordI in value
category VERSION_1_3
glxflags ARB
version 1.3
vectorequiv MultiTexCoord3iv
offset 396
MultiTexCoord3iv(target, v)
return void
param target TextureUnit in value
param v CoordI in array [3]
category VERSION_1_3
glxflags ARB
version 1.3
glxropcode 208
glsopcode 0x01BD
offset 397
MultiTexCoord3s(target, s, t, r)
return void
param target TextureUnit in value
param s CoordS in value
param t CoordS in value
param r CoordS in value
category VERSION_1_3
glxflags ARB
version 1.3
vectorequiv MultiTexCoord3sv
offset 398
MultiTexCoord3sv(target, v)
return void
param target TextureUnit in value
param v CoordS in array [3]
category VERSION_1_3
version 1.3
glxflags ARB
glxropcode 209
glsopcode 0x01BE
offset 399
MultiTexCoord4d(target, s, t, r, q)
return void
param target TextureUnit in value
param s CoordD in value
param t CoordD in value
param r CoordD in value
param q CoordD in value
category VERSION_1_3
glxflags ARB
version 1.3
vectorequiv MultiTexCoord4dv
offset 400
MultiTexCoord4dv(target, v)
return void
param target TextureUnit in value
param v CoordD in array [4]
category VERSION_1_3
glxflags ARB
version 1.3
glxropcode 210
glsopcode 0x01BF
offset 401
MultiTexCoord4f(target, s, t, r, q)
return void
param target TextureUnit in value
param s CoordF in value
param t CoordF in value
param r CoordF in value
param q CoordF in value
category VERSION_1_3
glxflags ARB
version 1.3
vectorequiv MultiTexCoord4fv
offset 402
MultiTexCoord4fv(target, v)
return void
param target TextureUnit in value
param v CoordF in array [4]
category VERSION_1_3
glxflags ARB
version 1.3
glxropcode 211
glsopcode 0x01C0
offset 403
MultiTexCoord4i(target, s, t, r, q)
return void
param target TextureUnit in value
param s CoordI in value
param t CoordI in value
param r CoordI in value
param q CoordI in value
category VERSION_1_3
glxflags ARB
version 1.3
vectorequiv MultiTexCoord4iv
offset 404
MultiTexCoord4iv(target, v)
return void
param target TextureUnit in value
param v CoordI in array [4]
category VERSION_1_3
glxflags ARB
version 1.3
glxropcode 212
glsopcode 0x01C1
offset 405
MultiTexCoord4s(target, s, t, r, q)
return void
param target TextureUnit in value
param s CoordS in value
param t CoordS in value
param r CoordS in value
param q CoordS in value
category VERSION_1_3
glxflags ARB
version 1.3
vectorequiv MultiTexCoord4sv
offset 406
MultiTexCoord4sv(target, v)
return void
param target TextureUnit in value
param v CoordS in array [4]
category VERSION_1_3
glxflags ARB
version 1.3
glxropcode 213
glsopcode 0x01C2
offset 407
# OpenGL 1.3 (ARB_transpose_matrix) commands
LoadTransposeMatrixf(m)
return void
param m Float32 in array [16]
category VERSION_1_3
glxflags ARB client-handcode client-intercept server-handcode
version 1.3
glsflags matrix
glsopcode 0x01C3
offset 408
LoadTransposeMatrixd(m)
return void
param m Float64 in array [16]
category VERSION_1_3
glxflags ARB client-handcode client-intercept server-handcode
version 1.3
glsflags matrix
glsopcode 0x01C4
offset 409
MultTransposeMatrixf(m)
return void
param m Float32 in array [16]
category VERSION_1_3
glxflags ARB client-handcode client-intercept server-handcode
version 1.3
glsflags matrix
glsopcode 0x01C5
offset 410
MultTransposeMatrixd(m)
return void
param m Float64 in array [16]
category VERSION_1_3
glxflags ARB client-handcode client-intercept server-handcode
version 1.3
glsflags matrix
glsopcode 0x01C6
offset 411
# OpenGL 1.3 (ARB_multisample) commands
SampleCoverage(value, invert)
return void
param value ClampedFloat32 in value
param invert Boolean in value
category VERSION_1_3
glxflags ARB
version 1.3
glxropcode 229
glsopcode 0x01C7
offset 412
# OpenGL 1.3 (ARB_texture_compression) commands
# Arguably TexelInternalFormat, not PixelInternalFormat
CompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param internalformat PixelInternalFormat in value
param width SizeI in value
param height SizeI in value
param depth SizeI in value
param border CheckedInt32 in value
param imageSize SizeI in value
param data CompressedTextureARB in array [imageSize]
category VERSION_1_3
dlflags handcode
glxflags ARB client-handcode server-handcode
version 1.3
glxropcode 216
glsopcode 0x01C9
wglflags client-handcode server-handcode
offset 554
# Arguably TexelInternalFormat, not PixelInternalFormat
CompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param internalformat PixelInternalFormat in value
param width SizeI in value
param height SizeI in value
param border CheckedInt32 in value
param imageSize SizeI in value
param data CompressedTextureARB in array [imageSize]
category VERSION_1_3
dlflags handcode
glxflags ARB client-handcode server-handcode
version 1.3
glxropcode 215
glsopcode 0x01CA
wglflags client-handcode server-handcode
offset 555
# Arguably TexelInternalFormat, not PixelInternalFormat
CompressedTexImage1D(target, level, internalformat, width, border, imageSize, data)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param internalformat PixelInternalFormat in value
param width SizeI in value
param border CheckedInt32 in value
param imageSize SizeI in value
param data CompressedTextureARB in array [imageSize]
category VERSION_1_3
dlflags handcode
glxflags ARB client-handcode server-handcode
version 1.3
glxropcode 214
glsopcode 0x01CB
wglflags client-handcode server-handcode
offset 556
CompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param xoffset CheckedInt32 in value
param yoffset CheckedInt32 in value
param zoffset CheckedInt32 in value
param width SizeI in value
param height SizeI in value
param depth SizeI in value
param format PixelFormat in value
param imageSize SizeI in value
param data CompressedTextureARB in array [imageSize]
category VERSION_1_3
dlflags handcode
glxflags ARB client-handcode server-handcode
version 1.3
glxropcode 219
glsopcode 0x01CC
wglflags client-handcode server-handcode
offset 557
CompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param xoffset CheckedInt32 in value
param yoffset CheckedInt32 in value
param width SizeI in value
param height SizeI in value
param format PixelFormat in value
param imageSize SizeI in value
param data CompressedTextureARB in array [imageSize]
category VERSION_1_3
dlflags handcode
glxflags ARB client-handcode server-handcode
version 1.3
glxropcode 218
glsopcode 0x01CD
wglflags client-handcode server-handcode
offset 558
CompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param xoffset CheckedInt32 in value
param width SizeI in value
param format PixelFormat in value
param imageSize SizeI in value
param data CompressedTextureARB in array [imageSize]
category VERSION_1_3
dlflags handcode
glxflags ARB client-handcode server-handcode
version 1.3
glxropcode 217
glsopcode 0x01CE
wglflags client-handcode server-handcode
offset 559
GetCompressedTexImage(target, level, img)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param img CompressedTextureARB out array [COMPSIZE(target/level)]
category VERSION_1_3
dlflags notlistable
glxflags ARB client-handcode server-handcode
version 1.3
glxsingle 160
glsflags get
glsopcode 0x01CF
wglflags client-handcode server-handcode
offset 560
###############################################################################
###############################################################################
#
# OpenGL 1.4 commands
#
###############################################################################
###############################################################################
# OpenGL 1.4 (EXT_blend_func_separate) commands
BlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha)
return void
param sfactorRGB BlendFuncSeparateParameterEXT in value
param dfactorRGB BlendFuncSeparateParameterEXT in value
param sfactorAlpha BlendFuncSeparateParameterEXT in value
param dfactorAlpha BlendFuncSeparateParameterEXT in value
category VERSION_1_4
glxropcode 4134
version 1.4
extension
glsopcode 0x01DC
offset 537
# OpenGL 1.4 (EXT_fog_coord) commands
FogCoordf(coord)
return void
param coord CoordF in value
category VERSION_1_4
vectorequiv FogCoordfv
version 1.4
offset 545
FogCoordfv(coord)
return void
param coord CoordF in array [1]
category VERSION_1_4
version 1.4
glxropcode 4124
glsopcode 0x01D8
offset 546
FogCoordd(coord)
return void
param coord CoordD in value
category VERSION_1_4
vectorequiv FogCoorddv
version 1.4
offset 547
FogCoorddv(coord)
return void
param coord CoordD in array [1]
category VERSION_1_4
version 1.4
glxropcode 4125
glsopcode 0x01DA
offset 548
FogCoordPointer(type, stride, pointer)
return void
param type FogPointerTypeEXT in value
param stride SizeI in value
param pointer Void in array [COMPSIZE(type/stride)] retained
category VERSION_1_4
dlflags notlistable
version 1.4
glxflags client-handcode server-handcode
glsflags client
glsopcode 0x01DB
offset 549
# OpenGL 1.4 (EXT_multi_draw_arrays) commands
# first and count are really 'in'
MultiDrawArrays(mode, first, count, primcount)
return void
param mode BeginMode in value
param first Int32 out array [COMPSIZE(count)]
param count SizeI out array [COMPSIZE(primcount)]
param primcount SizeI in value
category VERSION_1_4
version 1.4
glxropcode ?
glsflags ignore
offset 644
MultiDrawElements(mode, count, type, indices, primcount)
return void
param mode BeginMode in value
param count SizeI in array [COMPSIZE(primcount)]
param type DrawElementsType in value
param indices VoidPointer in array [COMPSIZE(primcount)]
param primcount SizeI in value
category VERSION_1_4
version 1.4
glxropcode ?
glsflags ignore
offset 645
# OpenGL 1.4 (ARB_point_parameters, NV_point_sprite) commands
PointParameterf(pname, param)
return void
param pname PointParameterNameARB in value
param param CheckedFloat32 in value
category VERSION_1_4
version 1.4
glxropcode 2065
extension
glsopcode 0x0177
offset 458
PointParameterfv(pname, params)
return void
param pname PointParameterNameARB in value
param params CheckedFloat32 in array [COMPSIZE(pname)]
category VERSION_1_4
version 1.4
glxropcode 2066
extension
glsopcode 0x0178
offset 459
PointParameteri(pname, param)
return void
param pname PointParameterNameARB in value
param param Int32 in value
category VERSION_1_4
version 1.4
extension soft WINSOFT NV20
glxropcode 4221
glsflags ignore
offset 642
PointParameteriv(pname, params)
return void
param pname PointParameterNameARB in value
param params Int32 in array [COMPSIZE(pname)]
category VERSION_1_4
version 1.4
extension soft WINSOFT NV20
glxropcode 4222re
glsflags ignore
offset 643
# OpenGL 1.4 (EXT_secondary_color) commands
SecondaryColor3b(red, green, blue)
return void
param red ColorB in value
param green ColorB in value
param blue ColorB in value
category VERSION_1_4
vectorequiv SecondaryColor3bv
version 1.4
offset 561
SecondaryColor3bv(v)
return void
param v ColorB in array [3]
category VERSION_1_4
version 1.4
glxropcode 4126
glsopcode 0x01FD
offset 562
SecondaryColor3d(red, green, blue)
return void
param red ColorD in value
param green ColorD in value
param blue ColorD in value
category VERSION_1_4
vectorequiv SecondaryColor3dv
version 1.4
offset 563
SecondaryColor3dv(v)
return void
param v ColorD in array [3]
category VERSION_1_4
version 1.4
glxropcode 4130
glsopcode 0x01FE
offset 564
SecondaryColor3f(red, green, blue)
return void
param red ColorF in value
param green ColorF in value
param blue ColorF in value
category VERSION_1_4
vectorequiv SecondaryColor3fv
version 1.4
offset 565
SecondaryColor3fv(v)
return void
param v ColorF in array [3]
category VERSION_1_4
version 1.4
glxropcode 4129
glsopcode 0x01FF
offset 566
SecondaryColor3i(red, green, blue)
return void
param red ColorI in value
param green ColorI in value
param blue ColorI in value
category VERSION_1_4
vectorequiv SecondaryColor3iv
version 1.4
offset 567
SecondaryColor3iv(v)
return void
param v ColorI in array [3]
category VERSION_1_4
version 1.4
glxropcode 4128
glsopcode 0x0200
offset 568
SecondaryColor3s(red, green, blue)
return void
param red ColorS in value
param green ColorS in value
param blue ColorS in value
category VERSION_1_4
vectorequiv SecondaryColor3sv
version 1.4
offset 569
SecondaryColor3sv(v)
return void
param v ColorS in array [3]
category VERSION_1_4
version 1.4
glxropcode 4127
glsopcode 0x0201
offset 570
SecondaryColor3ub(red, green, blue)
return void
param red ColorUB in value
param green ColorUB in value
param blue ColorUB in value
category VERSION_1_4
vectorequiv SecondaryColor3ubv
version 1.4
offset 571
SecondaryColor3ubv(v)
return void
param v ColorUB in array [3]
category VERSION_1_4
version 1.4
glxropcode 4131
glsopcode 0x0202
offset 572
SecondaryColor3ui(red, green, blue)
return void
param red ColorUI in value
param green ColorUI in value
param blue ColorUI in value
category VERSION_1_4
vectorequiv SecondaryColor3uiv
version 1.4
offset 573
SecondaryColor3uiv(v)
return void
param v ColorUI in array [3]
category VERSION_1_4
version 1.4
glxropcode 4133
glsopcode 0x0203
offset 574
SecondaryColor3us(red, green, blue)
return void
param red ColorUS in value
param green ColorUS in value
param blue ColorUS in value
category VERSION_1_4
vectorequiv SecondaryColor3usv
version 1.4
offset 575
SecondaryColor3usv(v)
return void
param v ColorUS in array [3]
category VERSION_1_4
version 1.4
glxropcode 4132
glsopcode 0x0204
offset 576
SecondaryColorPointer(size, type, stride, pointer)
return void
param size Int32 in value
param type ColorPointerType in value
param stride SizeI in value
param pointer Void in array [COMPSIZE(size/type/stride)] retained
category VERSION_1_4
dlflags notlistable
glxflags client-handcode server-handcode
version 1.4
extension
glsflags client
glsopcode 0x0205
offset 577
# OpenGL 1.4 (ARB_window_pos) commands
# Note: all WindowPos* entry points use glxropcode ropcode 230, with 3 float parameters
WindowPos2d(x, y)
return void
param x CoordD in value
param y CoordD in value
category VERSION_1_4
vectorequiv WindowPos2dv
version 1.4
offset 513
WindowPos2dv(v)
return void
param v CoordD in array [2]
category VERSION_1_4
version 1.4
glxropcode 230
glxflags client-handcode server-handcode
glsopcode 0x01F0
offset 514
WindowPos2f(x, y)
return void
param x CoordF in value
param y CoordF in value
category VERSION_1_4
vectorequiv WindowPos2fv
version 1.4
offset 515
WindowPos2fv(v)
return void
param v CoordF in array [2]
category VERSION_1_4
version 1.4
glxropcode 230
glxflags client-handcode server-handcode
glsopcode 0x01F1
offset 516
WindowPos2i(x, y)
return void
param x CoordI in value
param y CoordI in value
category VERSION_1_4
vectorequiv WindowPos2iv
version 1.4
offset 517
WindowPos2iv(v)
return void
param v CoordI in array [2]
category VERSION_1_4
version 1.4
glxropcode 230
glxflags client-handcode server-handcode
glsopcode 0x01F2
offset 518
WindowPos2s(x, y)
return void
param x CoordS in value
param y CoordS in value
category VERSION_1_4
vectorequiv WindowPos2sv
version 1.4
offset 519
WindowPos2sv(v)
return void
param v CoordS in array [2]
category VERSION_1_4
version 1.4
glxropcode 230
glxflags client-handcode server-handcode
glsopcode 0x01F3
offset 520
WindowPos3d(x, y, z)
return void
param x CoordD in value
param y CoordD in value
param z CoordD in value
vectorequiv WindowPos3dv
category VERSION_1_4
version 1.4
offset 521
WindowPos3dv(v)
return void
param v CoordD in array [3]
category VERSION_1_4
version 1.4
glxropcode 230
glxflags client-handcode server-handcode
glsopcode 0x01F4
offset 522
WindowPos3f(x, y, z)
return void
param x CoordF in value
param y CoordF in value
param z CoordF in value
category VERSION_1_4
vectorequiv WindowPos3fv
version 1.4
offset 523
WindowPos3fv(v)
return void
param v CoordF in array [3]
category VERSION_1_4
version 1.4
glxropcode 230
glxflags client-handcode server-handcode
glsopcode 0x01F5
offset 524
WindowPos3i(x, y, z)
return void
param x CoordI in value
param y CoordI in value
param z CoordI in value
category VERSION_1_4
vectorequiv WindowPos3iv
version 1.4
offset 525
WindowPos3iv(v)
return void
param v CoordI in array [3]
category VERSION_1_4
version 1.4
glxropcode 230
glxflags client-handcode server-handcode
glsopcode 0x01F6
offset 526
WindowPos3s(x, y, z)
return void
param x CoordS in value
param y CoordS in value
param z CoordS in value
category VERSION_1_4
vectorequiv WindowPos3sv
version 1.4
offset 527
WindowPos3sv(v)
return void
param v CoordS in array [3]
category VERSION_1_4
version 1.4
glxropcode 230
glxflags client-handcode server-handcode
glsopcode 0x01F7
offset 528
###############################################################################
###############################################################################
#
# OpenGL 1.5 commands
#
###############################################################################
###############################################################################
# OpenGL 1.5 (ARB_occlusion_query) commands
GenQueries(n, ids)
return void
param n SizeI in value
param ids UInt32 out array [n]
category VERSION_1_5
version 1.5
extension
glxsingle 162
glxflags ignore
glsopcode ?
offset 700
DeleteQueries(n, ids)
return void
param n SizeI in value
param ids UInt32 in array [n]
category VERSION_1_5
version 1.5
extension
glxsingle 161
glxflags ignore
glsopcode ?
offset 701
IsQuery(id)
return Boolean
param id UInt32 in value
category VERSION_1_5
version 1.5
extension
glxsingle 163
glxflags ignore
glsopcode ?
offset 702
BeginQuery(target, id)
return void
param target GLenum in value
param id UInt32 in value
category VERSION_1_5
version 1.5
extension
glxropcode 231
glxflags ignore
glsopcode ?
offset 703
EndQuery(target)
return void
param target GLenum in value
category VERSION_1_5
version 1.5
extension
glxropcode 232
glxflags ignore
glsopcode ?
offset 704
GetQueryiv(target, pname, params)
return void
param target GLenum in value
param pname GLenum in value
param params Int32 out array [pname]
category VERSION_1_5
dlflags notlistable
version 1.5
extension
glxsingle 164
glxflags ignore
glsflags get
glsopcode ?
offset 705
GetQueryObjectiv(id, pname, params)
return void
param id UInt32 in value
param pname GLenum in value
param params Int32 out array [pname]
category VERSION_1_5
dlflags notlistable
version 1.5
extension
glxsingle 165
glxflags ignore
glsflags get
glsopcode ?
offset 706
GetQueryObjectuiv(id, pname, params)
return void
param id UInt32 in value
param pname GLenum in value
param params UInt32 out array [pname]
category VERSION_1_5
dlflags notlistable
version 1.5
extension
glxsingle 166
glxflags ignore
glsflags get
glsopcode ?
offset 707
# OpenGL 1.5 (ARB_vertex_buffer_object) commands
BindBuffer(target, buffer)
return void
param target BufferTargetARB in value
param buffer UInt32 in value
category VERSION_1_5
version 1.5
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset 688
DeleteBuffers(n, buffers)
return void
param n SizeI in value
param buffers ConstUInt32 in array [n]
category VERSION_1_5
version 1.5
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset 691
GenBuffers(n, buffers)
return void
param n SizeI in value
param buffers UInt32 out array [n]
category VERSION_1_5
version 1.5
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset 692
IsBuffer(buffer)
return Boolean
param buffer UInt32 in value
category VERSION_1_5
version 1.5
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset 696
BufferData(target, size, data, usage)
return void
param target BufferTargetARB in value
param size BufferSize in value
param data ConstVoid in array [size]
param usage BufferUsageARB in value
category VERSION_1_5
version 1.5
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset 689
BufferSubData(target, offset, size, data)
return void
param target BufferTargetARB in value
param offset BufferOffset in value
param size BufferSize in value
param data ConstVoid in array [size]
category VERSION_1_5
version 1.5
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset 690
GetBufferSubData(target, offset, size, data)
return void
param target BufferTargetARB in value
param offset BufferOffset in value
param size BufferSize in value
param data Void out array [size]
category VERSION_1_5
dlflags notlistable
version 1.5
extension
glxsingle ?
glxflags ignore
glsflags get
glsopcode ?
offset 695
MapBuffer(target, access)
return VoidPointer
param target BufferTargetARB in value
param access BufferAccessARB in value
category VERSION_1_5
version 1.5
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset 697
UnmapBuffer(target)
return Boolean
param target BufferTargetARB in value
category VERSION_1_5
version 1.5
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset 698
GetBufferParameteriv(target, pname, params)
return void
param target BufferTargetARB in value
param pname BufferPNameARB in value
param params Int32 out array [COMPSIZE(pname)]
category VERSION_1_5
dlflags notlistable
version 1.5
extension
glxsingle ?
glxflags ignore
glsflags get
glsopcode ?
offset 693
GetBufferPointerv(target, pname, params)
return void
param target BufferTargetARB in value
param pname BufferPointerNameARB in value
param params VoidPointer out array [1]
category VERSION_1_5
dlflags notlistable
version 1.5
extension
glxsingle ?
glxflags ignore
glsflags get
glsopcode ?
offset 694
# OpenGL 1.5 (EXT_shadow_funcs) commands - none
###############################################################################
###############################################################################
#
# OpenGL 2.0 commands
#
###############################################################################
###############################################################################
# OpenGL 2.0 (EXT_blend_equation_separate) commands
BlendEquationSeparate(modeRGB, modeAlpha)
return void
param modeRGB BlendEquationModeEXT in value
param modeAlpha BlendEquationModeEXT in value
category VERSION_2_0
version 2.0
extension
glxropcode 4228
glsopcode ?
# OpenGL 2.0 (ARB_draw_buffers) commands
DrawBuffers(n, bufs)
return void
param n SizeI in value
param bufs DrawBufferModeATI in array [n]
category VERSION_2_0
version 2.0
extension
glxropcode 233
glxflags ignore
glsopcode ?
offset ?
# OpenGL 2.0 (ARB_stencil_two_side) commands
StencilOpSeparate(face, sfail, dpfail, dppass)
return void
param face StencilFaceDirection in value
param sfail StencilOp in value
param dpfail StencilOp in value
param dppass StencilOp in value
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
StencilFuncSeparate(frontfunc, backfunc, ref, mask)
return void
param frontfunc StencilFunction in value
param backfunc StencilFunction in value
param ref ClampedStencilValue in value
param mask MaskedStencilValue in value
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
StencilMaskSeparate(face, mask)
return void
param face StencilFaceDirection in value
param mask MaskedStencilValue in value
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
# OpenGL 2.0 (ARB_shader_objects / ARB_vertex_shader / ARB_fragment_shader) commands
AttachShader(program, shader)
return void
param program UInt32 in value
param shader UInt32 in value
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
BindAttribLocation(program, index, name)
return void
param program UInt32 in value
param index UInt32 in value
param name Char in array []
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
CompileShader(shader)
return void
param shader UInt32 in value
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
CreateProgram()
return UInt32
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
CreateShader(type)
return UInt32
param type GLenum in value
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
DeleteProgram(program)
return void
param program UInt32 in value
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
DeleteShader(shader)
return void
param shader UInt32 in value
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
DetachShader(program, shader)
return void
param program UInt32 in value
param shader UInt32 in value
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
DisableVertexAttribArray(index)
return void
param index UInt32 in value
dlflags notlistable
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 666
EnableVertexAttribArray(index)
return void
param index UInt32 in value
dlflags notlistable
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 665
GetActiveAttrib(program, index, bufSize, length, size, type, name)
return void
param program UInt32 in value
param index UInt32 in value
param bufSize SizeI in value
param length SizeI out array [1]
param size Int32 out array [1]
param type GLenum out array [1]
param name Char out array []
category VERSION_2_0
dlflags notlistable
version 2.0
extension
glxsingle ?
glxflags ignore
glsflags get
glsopcode ?
offset ?
GetActiveUniform(program, index, bufSize, length, size, type, name)
return void
param program UInt32 in value
param index UInt32 in value
param bufSize SizeI in value
param length SizeI out array [1]
param size Int32 out array [1]
param type GLenum out array [1]
param name Char out array []
category VERSION_2_0
dlflags notlistable
version 2.0
extension
glxsingle ?
glxflags ignore
glsflags get
glsopcode ?
offset ?
GetAttachedShaders(program, maxCount, count, obj)
return void
param program UInt32 in value
param maxCount SizeI in value
param count SizeI out array [1]
param obj UInt32 out array [count]
category VERSION_2_0
dlflags notlistable
version 2.0
extension
glxsingle ?
glxflags ignore
glsflags get
glsopcode ?
offset ?
GetAttribLocation(program, name)
return Int32
param program UInt32 in value
param name Char in array []
category VERSION_2_0
dlflags notlistable
version 2.0
extension
glxsingle ?
glxflags ignore
glsflags get
glsopcode ?
offset ?
GetProgramiv(program, pname, params)
return void
param program UInt32 in value
param pname GLenum in value
param params Int32 out array [pname]
category VERSION_2_0
dlflags notlistable
version 2.0
extension
glxsingle ?
glxflags ignore
glsflags get
glsopcode ?
offset ?
GetProgramInfoLog(program, bufSize, length, infoLog)
return void
param program UInt32 in value
param bufSize SizeI in value
param length SizeI out array [1]
param infoLog Char out array [length]
category VERSION_2_0
dlflags notlistable
version 2.0
extension
glxsingle ?
glxflags ignore
glsflags get
glsopcode ?
offset ?
GetShaderiv(shader, pname, params)
return void
param shader UInt32 in value
param pname GLenum in value
param params Int32 out array [pname]
category VERSION_2_0
dlflags notlistable
version 2.0
extension
glxsingle ?
glxflags ignore
glsflags get
glsopcode ?
offset ?
GetShaderInfoLog(shader, bufSize, length, infoLog)
return void
param shader UInt32 in value
param bufSize SizeI in value
param length SizeI out array [1]
param infoLog Char out array [length]
category VERSION_2_0
dlflags notlistable
version 2.0
extension
glxsingle ?
glxflags ignore
glsflags get
glsopcode ?
offset ?
GetShaderSource(shader, bufSize, length, source)
return void
param shader UInt32 in value
param bufSize SizeI in value
param length SizeI out array [1]
param source Char out array [length]
category VERSION_2_0
dlflags notlistable
version 2.0
extension
glxsingle ?
glxflags ignore
glsflags get
glsopcode ?
offset ?
GetUniformLocation(program, name)
return Int32
param program UInt32 in value
param name Char in array []
category VERSION_2_0
dlflags notlistable
version 2.0
extension
glxsingle ?
glxflags ignore
glsflags get
glsopcode ?
offset ?
GetUniformfv(program, location, params)
return void
param program UInt32 in value
param location Int32 in value
param params Float32 out array [location]
category VERSION_2_0
dlflags notlistable
version 2.0
extension
glxsingle ?
glxflags ignore
glsflags get
glsopcode ?
offset ?
GetUniformiv(program, location, params)
return void
param program UInt32 in value
param location Int32 in value
param params Int32 out array [location]
category VERSION_2_0
dlflags notlistable
version 2.0
extension
glxsingle ?
glxflags ignore
glsflags get
glsopcode ?
offset ?
GetVertexAttribdv(index, pname, params)
return void
param index UInt32 in value
param pname VertexAttribPropertyARB in value
param params Float64 out array [4]
dlflags notlistable
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glxvendorpriv 1301
glsflags client get
glsopcode 0x0232
offset 588
GetVertexAttribfv(index, pname, params)
return void
param index UInt32 in value
param pname VertexAttribPropertyARB in value
param params Float32 out array [4]
dlflags notlistable
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glxvendorpriv 1302
glsflags client get
glsopcode 0x0233
offset 589
GetVertexAttribiv(index, pname, params)
return void
param index UInt32 in value
param pname VertexAttribPropertyARB in value
param params Int32 out array [4]
dlflags notlistable
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glxvendorpriv 1303
glsflags client get
glsopcode 0x0234
offset 590
GetVertexAttribPointerv(index, pname, pointer)
return void
param index UInt32 in value
param pname VertexAttribPointerPropertyARB in value
param pointer VoidPointer out array [1]
dlflags notlistable
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glxflags ignore
glsflags client get
glsopcode 0x0235
offset 591
IsProgram(program)
return Boolean
param program UInt32 in value
dlflags notlistable
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glxvendorpriv 1304
glsflags get
glsopcode 0x0236
offset 592
IsShader(shader)
return Boolean
param shader UInt32 in value
dlflags notlistable
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glxvendorpriv ?
glsflags get
glsopcode ?
offset ?
LinkProgram(program)
return void
param program UInt32 in value
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
ShaderSource(shader, count, string, length)
return void
param shader UInt32 in value
param count SizeI in value
param string CharPointer in array [count]
param length Int32 in array [1]
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
UseProgram(program)
return void
param program UInt32 in value
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
Uniform1f(location, v0)
return void
param location Int32 in value
param v0 Float32 in value
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
Uniform2f(location, v0, v1)
return void
param location Int32 in value
param v0 Float32 in value
param v1 Float32 in value
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
Uniform3f(location, v0, v1, v2)
return void
param location Int32 in value
param v0 Float32 in value
param v1 Float32 in value
param v2 Float32 in value
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
Uniform4f(location, v0, v1, v2, v3)
return void
param location Int32 in value
param v0 Float32 in value
param v1 Float32 in value
param v2 Float32 in value
param v3 Float32 in value
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
Uniform1i(location, v0)
return void
param location Int32 in value
param v0 Int32 in value
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
Uniform2i(location, v0, v1)
return void
param location Int32 in value
param v0 Int32 in value
param v1 Int32 in value
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
Uniform3i(location, v0, v1, v2)
return void
param location Int32 in value
param v0 Int32 in value
param v1 Int32 in value
param v2 Int32 in value
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
Uniform4i(location, v0, v1, v2, v3)
return void
param location Int32 in value
param v0 Int32 in value
param v1 Int32 in value
param v2 Int32 in value
param v3 Int32 in value
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
Uniform1fv(location, count, value)
return void
param location Int32 in value
param count SizeI in value
param value Float32 in array [count]
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
Uniform2fv(location, count, value)
return void
param location Int32 in value
param count SizeI in value
param value Float32 in array [count]
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
Uniform3fv(location, count, value)
return void
param location Int32 in value
param count SizeI in value
param value Float32 in array [count]
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
Uniform4fv(location, count, value)
return void
param location Int32 in value
param count SizeI in value
param value Float32 in array [count]
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
Uniform1iv(location, count, value)
return void
param location Int32 in value
param count SizeI in value
param value Int32 in array [count]
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
Uniform2iv(location, count, value)
return void
param location Int32 in value
param count SizeI in value
param value Int32 in array [count]
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
Uniform3iv(location, count, value)
return void
param location Int32 in value
param count SizeI in value
param value Int32 in array [count]
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
Uniform4iv(location, count, value)
return void
param location Int32 in value
param count SizeI in value
param value Int32 in array [count]
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
UniformMatrix2fv(location, count, transpose, value)
return void
param location Int32 in value
param count SizeI in value
param transpose Boolean in value
param value Float32 in array [count]
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
UniformMatrix3fv(location, count, transpose, value)
return void
param location Int32 in value
param count SizeI in value
param transpose Boolean in value
param value Float32 in array [count]
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
UniformMatrix4fv(location, count, transpose, value)
return void
param location Int32 in value
param count SizeI in value
param transpose Boolean in value
param value Float32 in array [count]
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
ValidateProgram(program)
return void
param program UInt32 in value
category VERSION_2_0
version 2.0
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
VertexAttrib1d(index, x)
return void
param index UInt32 in value
param x Float64 in value
category VERSION_2_0
version 2.0
vectorequiv VertexAttrib1dv
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 603
VertexAttrib1dv(index, v)
return void
param index UInt32 in value
param v Float64 in array [1]
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glxropcode 4197
glsopcode 0x0240
offset 604
VertexAttrib1f(index, x)
return void
param index UInt32 in value
param x Float32 in value
category VERSION_2_0
version 2.0
vectorequiv VertexAttrib1fv
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 605
VertexAttrib1fv(index, v)
return void
param index UInt32 in value
param v Float32 in array [1]
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glxropcode 4193
glsopcode 0x023F
offset 606
VertexAttrib1s(index, x)
return void
param index UInt32 in value
param x Int16 in value
category VERSION_2_0
version 2.0
vectorequiv VertexAttrib1sv
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 607
VertexAttrib1sv(index, v)
return void
param index UInt32 in value
param v Int16 in array [1]
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glxropcode 4189
glsopcode 0x023E
offset 608
VertexAttrib2d(index, x, y)
return void
param index UInt32 in value
param x Float64 in value
param y Float64 in value
category VERSION_2_0
version 2.0
vectorequiv VertexAttrib2dv
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 609
VertexAttrib2dv(index, v)
return void
param index UInt32 in value
param v Float64 in array [2]
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glxropcode 4198
glsopcode 0x0243
offset 610
VertexAttrib2f(index, x, y)
return void
param index UInt32 in value
param x Float32 in value
param y Float32 in value
category VERSION_2_0
version 2.0
vectorequiv VertexAttrib2fv
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 611
VertexAttrib2fv(index, v)
return void
param index UInt32 in value
param v Float32 in array [2]
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glxropcode 4194
glsopcode 0x0242
offset 612
VertexAttrib2s(index, x, y)
return void
param index UInt32 in value
param x Int16 in value
param y Int16 in value
category VERSION_2_0
version 2.0
vectorequiv VertexAttrib2sv
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 613
VertexAttrib2sv(index, v)
return void
param index UInt32 in value
param v Int16 in array [2]
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glxropcode 4190
glsopcode 0x0241
offset 614
VertexAttrib3d(index, x, y, z)
return void
param index UInt32 in value
param x Float64 in value
param y Float64 in value
param z Float64 in value
category VERSION_2_0
version 2.0
vectorequiv VertexAttrib3dv
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 615
VertexAttrib3dv(index, v)
return void
param index UInt32 in value
param v Float64 in array [3]
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glxropcode 4199
glsopcode 0x0246
offset 616
VertexAttrib3f(index, x, y, z)
return void
param index UInt32 in value
param x Float32 in value
param y Float32 in value
param z Float32 in value
category VERSION_2_0
version 2.0
vectorequiv VertexAttrib3fv
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 617
VertexAttrib3fv(index, v)
return void
param index UInt32 in value
param v Float32 in array [3]
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glxropcode 4195
glsopcode 0x0245
offset 618
VertexAttrib3s(index, x, y, z)
return void
param index UInt32 in value
param x Int16 in value
param y Int16 in value
param z Int16 in value
category VERSION_2_0
version 2.0
vectorequiv VertexAttrib3sv
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 619
VertexAttrib3sv(index, v)
return void
param index UInt32 in value
param v Int16 in array [3]
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glxropcode 4191
glsopcode 0x0244
offset 620
VertexAttrib4Nbv(index, v)
return void
param index UInt32 in value
param v Int8 in array [4]
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 659
VertexAttrib4Niv(index, v)
return void
param index UInt32 in value
param v Int32 in array [4]
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 661
VertexAttrib4Nsv(index, v)
return void
param index UInt32 in value
param v Int16 in array [4]
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 660
VertexAttrib4Nub(index, x, y, z, w)
return void
param index UInt32 in value
param x UInt8 in value
param y UInt8 in value
param z UInt8 in value
param w UInt8 in value
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 627
VertexAttrib4Nubv(index, v)
return void
param index UInt32 in value
param v UInt8 in array [4]
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
glxropcode 4201
glsopcode 0x024A
offset 628
VertexAttrib4Nuiv(index, v)
return void
param index UInt32 in value
param v UInt32 in array [4]
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 663
VertexAttrib4Nusv(index, v)
return void
param index UInt32 in value
param v UInt16 in array [4]
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 662
VertexAttrib4bv(index, v)
return void
param index UInt32 in value
param v Int8 in array [4]
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 654
VertexAttrib4d(index, x, y, z, w)
return void
param index UInt32 in value
param x Float64 in value
param y Float64 in value
param z Float64 in value
param w Float64 in value
category VERSION_2_0
version 2.0
vectorequiv VertexAttrib4dv
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 621
VertexAttrib4dv(index, v)
return void
param index UInt32 in value
param v Float64 in array [4]
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glxropcode 4200
glsopcode 0x0249
offset 622
VertexAttrib4f(index, x, y, z, w)
return void
param index UInt32 in value
param x Float32 in value
param y Float32 in value
param z Float32 in value
param w Float32 in value
category VERSION_2_0
version 2.0
vectorequiv VertexAttrib4fv
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 623
VertexAttrib4fv(index, v)
return void
param index UInt32 in value
param v Float32 in array [4]
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glxropcode 4196
glsopcode 0x0248
offset 624
VertexAttrib4iv(index, v)
return void
param index UInt32 in value
param v Int32 in array [4]
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 655
VertexAttrib4s(index, x, y, z, w)
return void
param index UInt32 in value
param x Int16 in value
param y Int16 in value
param z Int16 in value
param w Int16 in value
category VERSION_2_0
version 2.0
vectorequiv VertexAttrib4sv
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 625
VertexAttrib4sv(index, v)
return void
param index UInt32 in value
param v Int16 in array [4]
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
glxropcode 4192
glsopcode 0x0247
offset 626
VertexAttrib4ubv(index, v)
return void
param index UInt32 in value
param v UInt8 in array [4]
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 656
VertexAttrib4uiv(index, v)
return void
param index UInt32 in value
param v UInt32 in array [4]
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 658
VertexAttrib4usv(index, v)
return void
param index UInt32 in value
param v UInt16 in array [4]
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 657
VertexAttribPointer(index, size, type, normalized, stride, pointer)
return void
param index UInt32 in value
param size Int32 in value
param type VertexAttribPointerTypeARB in value
param normalized Boolean in value
param stride SizeI in value
param pointer Void in array [COMPSIZE(size/type/stride)] retained
dlflags notlistable
category VERSION_2_0
version 2.0
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 664
###############################################################################
###############################################################################
#
# OpenGL 2.1 commands
#
###############################################################################
###############################################################################
# OpenGL 2.1 (ARB_pixel_buffer_object) commands - none
# OpenGL 2.1 (EXT_texture_sRGB) commands - none
# New commands in OpenGL 2.1
UniformMatrix2x3fv(location, count, transpose, value)
return void
param location Int32 in value
param count SizeI in value
param transpose Boolean in value
param value Float32 in array [6]
category VERSION_2_1
version 2.1
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
UniformMatrix3x2fv(location, count, transpose, value)
return void
param location Int32 in value
param count SizeI in value
param transpose Boolean in value
param value Float32 in array [6]
category VERSION_2_1
version 2.1
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
UniformMatrix2x4fv(location, count, transpose, value)
return void
param location Int32 in value
param count SizeI in value
param transpose Boolean in value
param value Float32 in array [8]
category VERSION_2_1
version 2.1
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
UniformMatrix4x2fv(location, count, transpose, value)
return void
param location Int32 in value
param count SizeI in value
param transpose Boolean in value
param value Float32 in array [8]
category VERSION_2_1
version 2.1
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
UniformMatrix3x4fv(location, count, transpose, value)
return void
param location Int32 in value
param count SizeI in value
param transpose Boolean in value
param value Float32 in array [12]
category VERSION_2_1
version 2.1
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
UniformMatrix4x3fv(location, count, transpose, value)
return void
param location Int32 in value
param count SizeI in value
param transpose Boolean in value
param value Float32 in array [12]
category VERSION_2_1
version 2.1
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
###############################################################################
###############################################################################
#
# ARB extensions, in order by ARB extension number
#
###############################################################################
###############################################################################
###############################################################################
#
# ARB Extension #1
# ARB_multitexture commands
#
###############################################################################
ActiveTextureARB(texture)
return void
param texture TextureUnit in value
category ARB_multitexture
glxflags ARB
version 1.2
glxropcode 197
alias ActiveTexture
glsalias ActiveTexture
ClientActiveTextureARB(texture)
return void
param texture TextureUnit in value
category ARB_multitexture
dlflags notlistable
glxflags ARB client-handcode client-intercept server-handcode
version 1.2
alias ClientActiveTexture
glsalias ClientActiveTexture
MultiTexCoord1dARB(target, s)
return void
param target TextureUnit in value
param s CoordD in value
category ARB_multitexture
glxflags ARB
version 1.2
vectorequiv MultiTexCoord1dv
MultiTexCoord1dvARB(target, v)
return void
param target TextureUnit in value
param v CoordD in array [1]
category ARB_multitexture
glxflags ARB
version 1.2
glxropcode 198
alias MultiTexCoord1dv
glsalias MultiTexCoord1dv
MultiTexCoord1fARB(target, s)
return void
param target TextureUnit in value
param s CoordF in value
category ARB_multitexture
glxflags ARB
version 1.2
vectorequiv MultiTexCoord1fv
MultiTexCoord1fvARB(target, v)
return void
param target TextureUnit in value
param v CoordF in array [1]
category ARB_multitexture
glxflags ARB
version 1.2
glxropcode 199
alias MultiTexCoord1fv
glsalias MultiTexCoord1fv
MultiTexCoord1iARB(target, s)
return void
param target TextureUnit in value
param s CoordI in value
category ARB_multitexture
glxflags ARB
version 1.2
vectorequiv MultiTexCoord1iv
MultiTexCoord1ivARB(target, v)
return void
param target TextureUnit in value
param v CoordI in array [1]
category ARB_multitexture
glxflags ARB
version 1.2
glxropcode 200
alias MultiTexCoord1iv
glsalias MultiTexCoord1iv
MultiTexCoord1sARB(target, s)
return void
param target TextureUnit in value
param s CoordS in value
category ARB_multitexture
glxflags ARB
version 1.2
vectorequiv MultiTexCoord1sv
MultiTexCoord1svARB(target, v)
return void
param target TextureUnit in value
param v CoordS in array [1]
category ARB_multitexture
glxflags ARB
version 1.2
glxropcode 201
alias MultiTexCoord1sv
glsalias MultiTexCoord1sv
MultiTexCoord2dARB(target, s, t)
return void
param target TextureUnit in value
param s CoordD in value
param t CoordD in value
category ARB_multitexture
glxflags ARB
version 1.2
vectorequiv MultiTexCoord2dv
MultiTexCoord2dvARB(target, v)
return void
param target TextureUnit in value
param v CoordD in array [2]
category ARB_multitexture
glxflags ARB
version 1.2
glxropcode 202
alias MultiTexCoord2dv
glsalias MultiTexCoord2dv
MultiTexCoord2fARB(target, s, t)
return void
param target TextureUnit in value
param s CoordF in value
param t CoordF in value
category ARB_multitexture
glxflags ARB
version 1.2
vectorequiv MultiTexCoord2fv
MultiTexCoord2fvARB(target, v)
return void
param target TextureUnit in value
param v CoordF in array [2]
category ARB_multitexture
glxflags ARB
version 1.2
glxropcode 203
alias MultiTexCoord2fv
glsalias MultiTexCoord2fv
MultiTexCoord2iARB(target, s, t)
return void
param target TextureUnit in value
param s CoordI in value
param t CoordI in value
category ARB_multitexture
glxflags ARB
version 1.2
vectorequiv MultiTexCoord2iv
MultiTexCoord2ivARB(target, v)
return void
param target TextureUnit in value
param v CoordI in array [2]
category ARB_multitexture
glxflags ARB
version 1.2
glxropcode 204
alias MultiTexCoord2iv
glsalias MultiTexCoord2iv
MultiTexCoord2sARB(target, s, t)
return void
param target TextureUnit in value
param s CoordS in value
param t CoordS in value
category ARB_multitexture
glxflags ARB
version 1.2
vectorequiv MultiTexCoord2sv
MultiTexCoord2svARB(target, v)
return void
param target TextureUnit in value
param v CoordS in array [2]
category ARB_multitexture
glxflags ARB
version 1.2
glxropcode 205
alias MultiTexCoord2sv
glsalias MultiTexCoord2sv
MultiTexCoord3dARB(target, s, t, r)
return void
param target TextureUnit in value
param s CoordD in value
param t CoordD in value
param r CoordD in value
category ARB_multitexture
glxflags ARB
version 1.2
vectorequiv MultiTexCoord3dv
MultiTexCoord3dvARB(target, v)
return void
param target TextureUnit in value
param v CoordD in array [3]
category ARB_multitexture
glxflags ARB
version 1.2
glxropcode 206
alias MultiTexCoord3dv
glsalias MultiTexCoord3dv
MultiTexCoord3fARB(target, s, t, r)
return void
param target TextureUnit in value
param s CoordF in value
param t CoordF in value
param r CoordF in value
category ARB_multitexture
glxflags ARB
version 1.2
vectorequiv MultiTexCoord3fv
MultiTexCoord3fvARB(target, v)
return void
param target TextureUnit in value
param v CoordF in array [3]
category ARB_multitexture
glxflags ARB
version 1.2
glxropcode 207
alias MultiTexCoord3fv
glsalias MultiTexCoord3fv
MultiTexCoord3iARB(target, s, t, r)
return void
param target TextureUnit in value
param s CoordI in value
param t CoordI in value
param r CoordI in value
category ARB_multitexture
glxflags ARB
version 1.2
vectorequiv MultiTexCoord3iv
MultiTexCoord3ivARB(target, v)
return void
param target TextureUnit in value
param v CoordI in array [3]
category ARB_multitexture
glxflags ARB
version 1.2
glxropcode 208
alias MultiTexCoord3iv
glsalias MultiTexCoord3iv
MultiTexCoord3sARB(target, s, t, r)
return void
param target TextureUnit in value
param s CoordS in value
param t CoordS in value
param r CoordS in value
category ARB_multitexture
glxflags ARB
version 1.2
vectorequiv MultiTexCoord3sv
MultiTexCoord3svARB(target, v)
return void
param target TextureUnit in value
param v CoordS in array [3]
category ARB_multitexture
version 1.2
glxflags ARB
glxropcode 209
alias MultiTexCoord3sv
glsalias MultiTexCoord3sv
MultiTexCoord4dARB(target, s, t, r, q)
return void
param target TextureUnit in value
param s CoordD in value
param t CoordD in value
param r CoordD in value
param q CoordD in value
category ARB_multitexture
glxflags ARB
version 1.2
vectorequiv MultiTexCoord4dv
MultiTexCoord4dvARB(target, v)
return void
param target TextureUnit in value
param v CoordD in array [4]
category ARB_multitexture
glxflags ARB
version 1.2
glxropcode 210
alias MultiTexCoord4dv
glsalias MultiTexCoord4dv
MultiTexCoord4fARB(target, s, t, r, q)
return void
param target TextureUnit in value
param s CoordF in value
param t CoordF in value
param r CoordF in value
param q CoordF in value
category ARB_multitexture
glxflags ARB
version 1.2
vectorequiv MultiTexCoord4fv
MultiTexCoord4fvARB(target, v)
return void
param target TextureUnit in value
param v CoordF in array [4]
category ARB_multitexture
glxflags ARB
version 1.2
glxropcode 211
alias MultiTexCoord4fv
glsalias MultiTexCoord4fv
MultiTexCoord4iARB(target, s, t, r, q)
return void
param target TextureUnit in value
param s CoordI in value
param t CoordI in value
param r CoordI in value
param q CoordI in value
category ARB_multitexture
glxflags ARB
version 1.2
vectorequiv MultiTexCoord4iv
MultiTexCoord4ivARB(target, v)
return void
param target TextureUnit in value
param v CoordI in array [4]
category ARB_multitexture
glxflags ARB
version 1.2
glxropcode 212
alias MultiTexCoord4iv
glsalias MultiTexCoord4iv
MultiTexCoord4sARB(target, s, t, r, q)
return void
param target TextureUnit in value
param s CoordS in value
param t CoordS in value
param r CoordS in value
param q CoordS in value
category ARB_multitexture
glxflags ARB
version 1.2
vectorequiv MultiTexCoord4sv
MultiTexCoord4svARB(target, v)
return void
param target TextureUnit in value
param v CoordS in array [4]
category ARB_multitexture
glxflags ARB
version 1.2
glxropcode 213
alias MultiTexCoord4sv
glsalias MultiTexCoord4sv
################################################################################
#
# ARB Extension #2 - GLX_ARB_get_proc_address
#
###############################################################################
################################################################################
#
# ARB Extension #3
# ARB_transpose_matrix commands
#
###############################################################################
LoadTransposeMatrixfARB(m)
return void
param m Float32 in array [16]
category ARB_transpose_matrix
glxflags ARB client-handcode client-intercept server-handcode
version 1.2
alias LoadTransposeMatrixf
glsalias LoadTransposeMatrixf
LoadTransposeMatrixdARB(m)
return void
param m Float64 in array [16]
category ARB_transpose_matrix
glxflags ARB client-handcode client-intercept server-handcode
version 1.2
alias LoadTransposeMatrixd
glsalias LoadTransposeMatrixd
MultTransposeMatrixfARB(m)
return void
param m Float32 in array [16]
category ARB_transpose_matrix
glxflags ARB client-handcode client-intercept server-handcode
version 1.2
alias MultTransposeMatrixf
glsalias MultTransposeMatrixf
MultTransposeMatrixdARB(m)
return void
param m Float64 in array [16]
category ARB_transpose_matrix
glxflags ARB client-handcode client-intercept server-handcode
version 1.2
alias MultTransposeMatrixd
glsalias MultTransposeMatrixd
################################################################################
#
# ARB Extension #4 - WGL_ARB_buffer_region
#
###############################################################################
################################################################################
#
# ARB Extension #5
# ARB_multisample commands
#
###############################################################################
SampleCoverageARB(value, invert)
return void
param value ClampedFloat32 in value
param invert Boolean in value
category ARB_multisample
glxflags ARB
version 1.2
alias SampleCoverage
glsalias SampleCoverage
################################################################################
#
# ARB Extension #6
# ARB_texture_env_add commands
#
###############################################################################
# (none)
newcategory: ARB_texture_env_add
################################################################################
#
# ARB Extension #7
# ARB_texture_cube_map commands
#
###############################################################################
# (none)
newcategory: ARB_texture_cube_map
################################################################################
#
# ARB Extension #8 - WGL_ARB_extensions_string
# ARB Extension #9 - WGL_ARB_pixel_format commands
# ARB Extension #10 - WGL_ARB_make_current_read commands
# ARB Extension #11 - WGL_ARB_pbuffer
#
###############################################################################
################################################################################
#
# ARB Extension #12
# ARB_texture_compression commands
#
###############################################################################
# Arguably TexelInternalFormat, not PixelInternalFormat
CompressedTexImage3DARB(target, level, internalformat, width, height, depth, border, imageSize, data)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param internalformat PixelInternalFormat in value
param width SizeI in value
param height SizeI in value
param depth SizeI in value
param border CheckedInt32 in value
param imageSize SizeI in value
param data CompressedTextureARB in array [imageSize]
category ARB_texture_compression
dlflags handcode
glxflags ARB client-handcode server-handcode
version 1.2
glxropcode 216
alias CompressedTexImage3D
glsalias CompressedTexImage3D
wglflags client-handcode server-handcode
# Arguably TexelInternalFormat, not PixelInternalFormat
CompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, data)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param internalformat PixelInternalFormat in value
param width SizeI in value
param height SizeI in value
param border CheckedInt32 in value
param imageSize SizeI in value
param data CompressedTextureARB in array [imageSize]
category ARB_texture_compression
dlflags handcode
glxflags ARB client-handcode server-handcode
version 1.2
glxropcode 215
alias CompressedTexImage2D
glsalias CompressedTexImage2D
wglflags client-handcode server-handcode
# Arguably TexelInternalFormat, not PixelInternalFormat
CompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, data)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param internalformat PixelInternalFormat in value
param width SizeI in value
param border CheckedInt32 in value
param imageSize SizeI in value
param data CompressedTextureARB in array [imageSize]
category ARB_texture_compression
dlflags handcode
glxflags ARB client-handcode server-handcode
version 1.2
glxropcode 214
alias CompressedTexImage1D
glsalias CompressedTexImage1D
wglflags client-handcode server-handcode
CompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param xoffset CheckedInt32 in value
param yoffset CheckedInt32 in value
param zoffset CheckedInt32 in value
param width SizeI in value
param height SizeI in value
param depth SizeI in value
param format PixelFormat in value
param imageSize SizeI in value
param data CompressedTextureARB in array [imageSize]
category ARB_texture_compression
dlflags handcode
glxflags ARB client-handcode server-handcode
version 1.2
glxropcode 219
alias CompressedTexSubImage3D
glsalias CompressedTexSubImage3D
wglflags client-handcode server-handcode
CompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, format, imageSize, data)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param xoffset CheckedInt32 in value
param yoffset CheckedInt32 in value
param width SizeI in value
param height SizeI in value
param format PixelFormat in value
param imageSize SizeI in value
param data CompressedTextureARB in array [imageSize]
category ARB_texture_compression
dlflags handcode
glxflags ARB client-handcode server-handcode
version 1.2
glxropcode 218
alias CompressedTexSubImage2D
glsalias CompressedTexSubImage2D
wglflags client-handcode server-handcode
CompressedTexSubImage1DARB(target, level, xoffset, width, format, imageSize, data)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param xoffset CheckedInt32 in value
param width SizeI in value
param format PixelFormat in value
param imageSize SizeI in value
param data CompressedTextureARB in array [imageSize]
category ARB_texture_compression
dlflags handcode
glxflags ARB client-handcode server-handcode
version 1.2
glxropcode 217
alias CompressedTexSubImage1D
glsalias CompressedTexSubImage1D
wglflags client-handcode server-handcode
GetCompressedTexImageARB(target, level, img)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param img CompressedTextureARB out array [COMPSIZE(target/level)]
category ARB_texture_compression
dlflags notlistable
glxflags ARB client-handcode server-handcode
version 1.2
glxsingle 160
alias GetCompressedTexImage
glsalias GetCompressedTexImage
wglflags client-handcode server-handcode
################################################################################
#
# ARB Extension #13
# ARB_texture_border_clamp commands
#
###############################################################################
# (none)
newcategory: ARB_texture_border_clamp
###############################################################################
#
# ARB Extension #14
# ARB_point_parameters commands
#
###############################################################################
PointParameterfARB(pname, param)
return void
param pname PointParameterNameARB in value
param param CheckedFloat32 in value
category ARB_point_parameters
version 1.0
glxflags ARB
glxropcode 2065
extension
alias PointParameterf
glsalias PointParameterf
PointParameterfvARB(pname, params)
return void
param pname PointParameterNameARB in value
param params CheckedFloat32 in array [COMPSIZE(pname)]
category ARB_point_parameters
version 1.0
glxflags ARB
glxropcode 2066
extension
alias PointParameterfv
glsalias PointParameterfv
################################################################################
#
# ARB Extension #15
# ARB_vertex_blend commands
#
###############################################################################
WeightbvARB(size, weights)
return void
param size Int32 in value
param weights Int8 in array [size]
category ARB_vertex_blend
version 1.1
extension
glxropcode 220
glxflags ignore
glsopcode 0x0206
offset ?
WeightsvARB(size, weights)
return void
param size Int32 in value
param weights Int16 in array [size]
category ARB_vertex_blend
version 1.1
extension
glxropcode 222
glxflags ignore
glsopcode 0x0207
offset ?
WeightivARB(size, weights)
return void
param size Int32 in value
param weights Int32 in array [size]
category ARB_vertex_blend
version 1.1
extension
glxropcode 224
glxflags ignore
glsopcode 0x0208
offset ?
WeightfvARB(size, weights)
return void
param size Int32 in value
param weights Float32 in array [size]
category ARB_vertex_blend
version 1.1
extension
glxropcode 227
glxflags ignore
glsopcode 0x0209
offset ?
WeightdvARB(size, weights)
return void
param size Int32 in value
param weights Float64 in array [size]
category ARB_vertex_blend
version 1.1
extension
glxropcode 228
glxflags ignore
glsopcode 0x020A
offset ?
WeightubvARB(size, weights)
return void
param size Int32 in value
param weights UInt8 in array [size]
category ARB_vertex_blend
version 1.1
extension
glxropcode 221
glxflags ignore
glsopcode 0x020B
offset ?
WeightusvARB(size, weights)
return void
param size Int32 in value
param weights UInt16 in array [size]
category ARB_vertex_blend
version 1.1
extension
glxropcode 223
glxflags ignore
glsopcode 0x020C
offset ?
WeightuivARB(size, weights)
return void
param size Int32 in value
param weights UInt32 in array [size]
category ARB_vertex_blend
version 1.1
extension
glxropcode 225
glxflags ignore
glsopcode 0x020D
offset ?
WeightPointerARB(size, type, stride, pointer)
return void
param size Int32 in value
param type WeightPointerTypeARB in value
param stride SizeI in value
param pointer Void in array [COMPSIZE(type/stride)] retained
category ARB_vertex_blend
version 1.1
extension
dlflags notlistable
glxflags ignore
glsflags client
glsopcode 0x020E
offset ?
VertexBlendARB(count)
return void
param count Int32 in value
category ARB_vertex_blend
version 1.1
extension
glxropcode 226
glxflags ignore
glsopcode 0x020F
offset ?
################################################################################
#
# ARB Extension #16
# ARB_matrix_palette commands
#
###############################################################################
CurrentPaletteMatrixARB(index)
return void
param index Int32 in value
category ARB_matrix_palette
version 1.1
extension
glxropcode 4329
glxflags ignore
glsopcode 0x0210
offset ?
MatrixIndexubvARB(size, indices)
return void
param size Int32 in value
param indices UInt8 in array [size]
category ARB_matrix_palette
version 1.1
extension
glxropcode 4326
glxflags ignore
glsopcode 0x0211
offset ?
MatrixIndexusvARB(size, indices)
return void
param size Int32 in value
param indices UInt16 in array [size]
category ARB_matrix_palette
version 1.1
extension
glxropcode 4327
glxflags ignore
glsopcode 0x0212
offset ?
MatrixIndexuivARB(size, indices)
return void
param size Int32 in value
param indices UInt32 in array [size]
category ARB_matrix_palette
version 1.1
extension
glxropcode 4328
glxflags ignore
glsopcode 0x0213
offset ?
MatrixIndexPointerARB(size, type, stride, pointer)
return void
param size Int32 in value
param type MatrixIndexPointerTypeARB in value
param stride SizeI in value
param pointer Void in array [COMPSIZE(type/stride)] retained
category ARB_matrix_palette
version 1.1
extension
dlflags notlistable
glxflags ignore
glsflags client
glsopcode 0x0214
offset ?
################################################################################
#
# ARB Extension #17
# ARB_texture_env_combine commands
#
###############################################################################
# (none)
newcategory: ARB_texture_env_combine
################################################################################
#
# ARB Extension #18
# ARB_texture_env_crossbar commands
#
###############################################################################
# (none)
newcategory: ARB_texture_env_crossbar
################################################################################
#
# ARB Extension #19
# ARB_texture_env_dot3 commands
#
###############################################################################
# (none)
newcategory: ARB_texture_env_dot3
###############################################################################
#
# ARB Extension #20 - WGL_ARB_render_texture
#
###############################################################################
###############################################################################
#
# ARB Extension #21
# ARB_texture_mirrored_repeat commands
#
###############################################################################
# (none)
newcategory: ARB_texture_mirrored_repeat
###############################################################################
#
# ARB Extension #22
# ARB_depth_texture commands
#
###############################################################################
# (none)
newcategory: ARB_depth_texture
###############################################################################
#
# ARB Extension #23
# ARB_shadow commands
#
###############################################################################
# (none)
newcategory: ARB_shadow
###############################################################################
#
# ARB Extension #24
# ARB_shadow_ambient commands
#
###############################################################################
# (none)
newcategory: ARB_shadow_ambient
###############################################################################
#
# ARB Extension #25
# ARB_window_pos commands
# Note: all entry points use glxropcode ropcode 230, with 3 float parameters
#
###############################################################################
WindowPos2dARB(x, y)
return void
param x CoordD in value
param y CoordD in value
category ARB_window_pos
vectorequiv WindowPos2dvARB
version 1.0
alias WindowPos2d
glsalias WindowPos2d
WindowPos2dvARB(v)
return void
param v CoordD in array [2]
category ARB_window_pos
version 1.0
glxropcode 230
glxflags client-handcode server-handcode
alias WindowPos2dv
glsalias WindowPos2dv
WindowPos2fARB(x, y)
return void
param x CoordF in value
param y CoordF in value
category ARB_window_pos
vectorequiv WindowPos2fvARB
version 1.0
alias WindowPos2f
glsalias WindowPos2f
WindowPos2fvARB(v)
return void
param v CoordF in array [2]
category ARB_window_pos
version 1.0
glxropcode 230
glxflags client-handcode server-handcode
alias WindowPos2fv
glsalias WindowPos2fv
WindowPos2iARB(x, y)
return void
param x CoordI in value
param y CoordI in value
category ARB_window_pos
vectorequiv WindowPos2ivARB
version 1.0
alias WindowPos2i
glsalias WindowPos2i
WindowPos2ivARB(v)
return void
param v CoordI in array [2]
category ARB_window_pos
version 1.0
glxropcode 230
glxflags client-handcode server-handcode
alias WindowPos2iv
glsalias WindowPos2iv
WindowPos2sARB(x, y)
return void
param x CoordS in value
param y CoordS in value
category ARB_window_pos
vectorequiv WindowPos2svARB
version 1.0
alias WindowPos2s
glsalias WindowPos2s
WindowPos2svARB(v)
return void
param v CoordS in array [2]
category ARB_window_pos
version 1.0
glxropcode 230
glxflags client-handcode server-handcode
alias WindowPos2sv
glsalias WindowPos2sv
WindowPos3dARB(x, y, z)
return void
param x CoordD in value
param y CoordD in value
param z CoordD in value
vectorequiv WindowPos3dvARB
category ARB_window_pos
version 1.0
alias WindowPos3d
glsalias WindowPos3d
WindowPos3dvARB(v)
return void
param v CoordD in array [3]
category ARB_window_pos
version 1.0
glxropcode 230
glxflags client-handcode server-handcode
alias WindowPos3dv
glsalias WindowPos3dv
WindowPos3fARB(x, y, z)
return void
param x CoordF in value
param y CoordF in value
param z CoordF in value
category ARB_window_pos
vectorequiv WindowPos3fvARB
version 1.0
alias WindowPos3f
glsalias WindowPos3f
WindowPos3fvARB(v)
return void
param v CoordF in array [3]
category ARB_window_pos
version 1.0
glxropcode 230
glxflags client-handcode server-handcode
alias WindowPos3fv
glsalias WindowPos3fv
WindowPos3iARB(x, y, z)
return void
param x CoordI in value
param y CoordI in value
param z CoordI in value
category ARB_window_pos
vectorequiv WindowPos3ivARB
version 1.0
alias WindowPos3i
glsalias WindowPos3i
WindowPos3ivARB(v)
return void
param v CoordI in array [3]
category ARB_window_pos
version 1.0
glxropcode 230
glxflags client-handcode server-handcode
alias WindowPos3iv
glsalias WindowPos3iv
WindowPos3sARB(x, y, z)
return void
param x CoordS in value
param y CoordS in value
param z CoordS in value
category ARB_window_pos
vectorequiv WindowPos3svARB
version 1.0
alias WindowPos3s
glsalias WindowPos3s
WindowPos3svARB(v)
return void
param v CoordS in array [3]
category ARB_window_pos
version 1.0
glxropcode 230
glxflags client-handcode server-handcode
alias WindowPos3sv
glsalias WindowPos3sv
###############################################################################
#
# ARB Extension #26
# ARB_vertex_program commands
#
###############################################################################
VertexAttrib1dARB(index, x)
return void
param index UInt32 in value
param x Float64 in value
category ARB_vertex_program
version 1.3
vectorequiv VertexAttrib1dvARB
extension soft WINSOFT NV10
alias VertexAttrib1d
glsalias VertexAttrib1d
VertexAttrib1dvARB(index, v)
return void
param index UInt32 in value
param v Float64 in array [1]
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glxropcode 4197
glsopcode 0x0240
alias VertexAttrib1dv
glsalias VertexAttrib1dv
VertexAttrib1fARB(index, x)
return void
param index UInt32 in value
param x Float32 in value
category ARB_vertex_program
version 1.3
vectorequiv VertexAttrib1fvARB
extension soft WINSOFT NV10
alias VertexAttrib1f
glsalias VertexAttrib1f
VertexAttrib1fvARB(index, v)
return void
param index UInt32 in value
param v Float32 in array [1]
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glxropcode 4193
glsopcode 0x023F
alias VertexAttrib1fv
glsalias VertexAttrib1fv
VertexAttrib1sARB(index, x)
return void
param index UInt32 in value
param x Int16 in value
category ARB_vertex_program
version 1.3
vectorequiv VertexAttrib1svARB
extension soft WINSOFT NV10
alias VertexAttrib1s
glsalias VertexAttrib1s
VertexAttrib1svARB(index, v)
return void
param index UInt32 in value
param v Int16 in array [1]
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glxropcode 4189
glsopcode 0x023E
alias VertexAttrib1sv
glsalias VertexAttrib1sv
VertexAttrib2dARB(index, x, y)
return void
param index UInt32 in value
param x Float64 in value
param y Float64 in value
category ARB_vertex_program
version 1.3
vectorequiv VertexAttrib2dvARB
extension soft WINSOFT NV10
alias VertexAttrib2d
glsalias VertexAttrib2d
VertexAttrib2dvARB(index, v)
return void
param index UInt32 in value
param v Float64 in array [2]
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glxropcode 4198
glsopcode 0x0243
alias VertexAttrib2dv
glsalias VertexAttrib2dv
VertexAttrib2fARB(index, x, y)
return void
param index UInt32 in value
param x Float32 in value
param y Float32 in value
category ARB_vertex_program
version 1.3
vectorequiv VertexAttrib2fvARB
extension soft WINSOFT NV10
alias VertexAttrib2f
glsalias VertexAttrib2f
VertexAttrib2fvARB(index, v)
return void
param index UInt32 in value
param v Float32 in array [2]
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glxropcode 4194
glsopcode 0x0242
alias VertexAttrib2fv
glsalias VertexAttrib2fv
VertexAttrib2sARB(index, x, y)
return void
param index UInt32 in value
param x Int16 in value
param y Int16 in value
category ARB_vertex_program
version 1.3
vectorequiv VertexAttrib2svARB
extension soft WINSOFT NV10
alias VertexAttrib2s
glsalias VertexAttrib2s
VertexAttrib2svARB(index, v)
return void
param index UInt32 in value
param v Int16 in array [2]
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glxropcode 4190
glsopcode 0x0241
alias VertexAttrib2sv
glsalias VertexAttrib2sv
VertexAttrib3dARB(index, x, y, z)
return void
param index UInt32 in value
param x Float64 in value
param y Float64 in value
param z Float64 in value
category ARB_vertex_program
version 1.3
vectorequiv VertexAttrib3dvARB
extension soft WINSOFT NV10
alias VertexAttrib3d
glsalias VertexAttrib3d
VertexAttrib3dvARB(index, v)
return void
param index UInt32 in value
param v Float64 in array [3]
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glxropcode 4199
glsopcode 0x0246
alias VertexAttrib3dv
glsalias VertexAttrib3dv
VertexAttrib3fARB(index, x, y, z)
return void
param index UInt32 in value
param x Float32 in value
param y Float32 in value
param z Float32 in value
category ARB_vertex_program
version 1.3
vectorequiv VertexAttrib3fvARB
extension soft WINSOFT NV10
alias VertexAttrib3f
glsalias VertexAttrib3f
VertexAttrib3fvARB(index, v)
return void
param index UInt32 in value
param v Float32 in array [3]
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glxropcode 4195
glsopcode 0x0245
alias VertexAttrib3fv
glsalias VertexAttrib3fv
VertexAttrib3sARB(index, x, y, z)
return void
param index UInt32 in value
param x Int16 in value
param y Int16 in value
param z Int16 in value
category ARB_vertex_program
version 1.3
vectorequiv VertexAttrib3svARB
extension soft WINSOFT NV10
alias VertexAttrib3s
glsalias VertexAttrib3s
VertexAttrib3svARB(index, v)
return void
param index UInt32 in value
param v Int16 in array [3]
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glxropcode 4191
glsopcode 0x0244
alias VertexAttrib3sv
glsalias VertexAttrib3sv
VertexAttrib4NbvARB(index, v)
return void
param index UInt32 in value
param v Int8 in array [4]
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
alias VertexAttrib4Nbv
glsalias VertexAttrib4Nbv
VertexAttrib4NivARB(index, v)
return void
param index UInt32 in value
param v Int32 in array [4]
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
alias VertexAttrib4Niv
glsalias VertexAttrib4Niv
VertexAttrib4NsvARB(index, v)
return void
param index UInt32 in value
param v Int16 in array [4]
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
alias VertexAttrib4Nsv
glsalias VertexAttrib4Nsv
VertexAttrib4NubARB(index, x, y, z, w)
return void
param index UInt32 in value
param x UInt8 in value
param y UInt8 in value
param z UInt8 in value
param w UInt8 in value
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
alias VertexAttrib4Nub
glsalias VertexAttrib4Nub
VertexAttrib4NubvARB(index, v)
return void
param index UInt32 in value
param v UInt8 in array [4]
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glxropcode 4201
glsopcode 0x024A
alias VertexAttrib4Nubv
glsalias VertexAttrib4Nubv
VertexAttrib4NuivARB(index, v)
return void
param index UInt32 in value
param v UInt32 in array [4]
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
alias VertexAttrib4Nuiv
glsalias VertexAttrib4Nuiv
VertexAttrib4NusvARB(index, v)
return void
param index UInt32 in value
param v UInt16 in array [4]
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
alias VertexAttrib4Nusv
glsalias VertexAttrib4Nusv
VertexAttrib4bvARB(index, v)
return void
param index UInt32 in value
param v Int8 in array [4]
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
alias VertexAttrib4bv
glsalias VertexAttrib4bv
VertexAttrib4dARB(index, x, y, z, w)
return void
param index UInt32 in value
param x Float64 in value
param y Float64 in value
param z Float64 in value
param w Float64 in value
category ARB_vertex_program
version 1.3
vectorequiv VertexAttrib4dvARB
extension soft WINSOFT NV10
alias VertexAttrib4d
glsalias VertexAttrib4d
VertexAttrib4dvARB(index, v)
return void
param index UInt32 in value
param v Float64 in array [4]
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glxropcode 4200
glsopcode 0x0249
alias VertexAttrib4dv
glsalias VertexAttrib4dv
VertexAttrib4fARB(index, x, y, z, w)
return void
param index UInt32 in value
param x Float32 in value
param y Float32 in value
param z Float32 in value
param w Float32 in value
category ARB_vertex_program
version 1.3
vectorequiv VertexAttrib4fvARB
extension soft WINSOFT NV10
alias VertexAttrib4f
glsalias VertexAttrib4f
VertexAttrib4fvARB(index, v)
return void
param index UInt32 in value
param v Float32 in array [4]
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glxropcode 4196
glsopcode 0x0248
alias VertexAttrib4fv
glsalias VertexAttrib4fv
VertexAttrib4ivARB(index, v)
return void
param index UInt32 in value
param v Int32 in array [4]
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
alias VertexAttrib4iv
glsalias VertexAttrib4iv
VertexAttrib4sARB(index, x, y, z, w)
return void
param index UInt32 in value
param x Int16 in value
param y Int16 in value
param z Int16 in value
param w Int16 in value
category ARB_vertex_program
version 1.3
vectorequiv VertexAttrib4svARB
extension soft WINSOFT NV10
alias VertexAttrib4s
glsalias VertexAttrib4s
VertexAttrib4svARB(index, v)
return void
param index UInt32 in value
param v Int16 in array [4]
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glxropcode 4192
glsopcode 0x0247
alias VertexAttrib4sv
glsalias VertexAttrib4sv
VertexAttrib4ubvARB(index, v)
return void
param index UInt32 in value
param v UInt8 in array [4]
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
alias VertexAttrib4ubv
glsalias VertexAttrib4ubv
VertexAttrib4uivARB(index, v)
return void
param index UInt32 in value
param v UInt32 in array [4]
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
alias VertexAttrib4uiv
glsalias VertexAttrib4uiv
VertexAttrib4usvARB(index, v)
return void
param index UInt32 in value
param v UInt16 in array [4]
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
alias VertexAttrib4usv
glsalias VertexAttrib4usv
VertexAttribPointerARB(index, size, type, normalized, stride, pointer)
return void
param index UInt32 in value
param size Int32 in value
param type VertexAttribPointerTypeARB in value
param normalized Boolean in value
param stride SizeI in value
param pointer Void in array [COMPSIZE(size/type/stride)] retained
dlflags notlistable
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
alias VertexAttribPointer
glsalias VertexAttribPointer
EnableVertexAttribArrayARB(index)
return void
param index UInt32 in value
dlflags notlistable
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
alias EnableVertexAttribArray
glsalias EnableVertexAttribArray
DisableVertexAttribArrayARB(index)
return void
param index UInt32 in value
dlflags notlistable
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
alias DisableVertexAttribArray
glsalias DisableVertexAttribArray
ProgramStringARB(target, format, len, string)
return void
param target ProgramTargetARB in value
param format ProgramFormatARB in value
param len SizeI in value
param string Void in array [len]
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 667
BindProgramARB(target, program)
return void
param target ProgramTargetARB in value
param program UInt32 in value
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glxropcode 4180
glsopcode 0x0227
offset 579
DeleteProgramsARB(n, programs)
return void
param n SizeI in value
param programs UInt32 in array [n]
dlflags notlistable
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glxvendorpriv 1294
glsopcode 0x0228
offset 580
GenProgramsARB(n, programs)
return void
param n SizeI in value
param programs UInt32 out array [n]
dlflags notlistable
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glxvendorpriv 1295
glsopcode 0x022A
offset 582
ProgramEnvParameter4dARB(target, index, x, y, z, w)
return void
param target ProgramTargetARB in value
param index UInt32 in value
param x Float64 in value
param y Float64 in value
param z Float64 in value
param w Float64 in value
category ARB_vertex_program
version 1.3
vectorequiv ProgramEnvParameter4dvARB
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 668
ProgramEnvParameter4dvARB(target, index, params)
return void
param target ProgramTargetARB in value
param index UInt32 in value
param params Float64 in array [4]
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 669
ProgramEnvParameter4fARB(target, index, x, y, z, w)
return void
param target ProgramTargetARB in value
param index UInt32 in value
param x Float32 in value
param y Float32 in value
param z Float32 in value
param w Float32 in value
category ARB_vertex_program
version 1.3
vectorequiv ProgramEnvParameter4fvARB
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 670
ProgramEnvParameter4fvARB(target, index, params)
return void
param target ProgramTargetARB in value
param index UInt32 in value
param params Float32 in array [4]
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 671
ProgramLocalParameter4dARB(target, index, x, y, z, w)
return void
param target ProgramTargetARB in value
param index UInt32 in value
param x Float64 in value
param y Float64 in value
param z Float64 in value
param w Float64 in value
category ARB_vertex_program
version 1.3
vectorequiv ProgramLocalParameter4dvARB
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 672
ProgramLocalParameter4dvARB(target, index, params)
return void
param target ProgramTargetARB in value
param index UInt32 in value
param params Float64 in array [4]
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 673
ProgramLocalParameter4fARB(target, index, x, y, z, w)
return void
param target ProgramTargetARB in value
param index UInt32 in value
param x Float32 in value
param y Float32 in value
param z Float32 in value
param w Float32 in value
category ARB_vertex_program
version 1.3
vectorequiv ProgramLocalParameter4fvARB
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 674
ProgramLocalParameter4fvARB(target, index, params)
return void
param target ProgramTargetARB in value
param index UInt32 in value
param params Float32 in array [4]
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 675
GetProgramEnvParameterdvARB(target, index, params)
return void
param target ProgramTargetARB in value
param index UInt32 in value
param params Float64 out array [4]
dlflags notlistable
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 676
GetProgramEnvParameterfvARB(target, index, params)
return void
param target ProgramTargetARB in value
param index UInt32 in value
param params Float32 out array [4]
dlflags notlistable
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 677
GetProgramLocalParameterdvARB(target, index, params)
return void
param target ProgramTargetARB in value
param index UInt32 in value
param params Float64 out array [4]
dlflags notlistable
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 678
GetProgramLocalParameterfvARB(target, index, params)
return void
param target ProgramTargetARB in value
param index UInt32 in value
param params Float32 out array [4]
dlflags notlistable
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 679
GetProgramivARB(target, pname, params)
return void
param target ProgramTargetARB in value
param pname ProgramPropertyARB in value
param params Int32 out array [1]
dlflags notlistable
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 680
GetProgramStringARB(target, pname, string)
return void
param target ProgramTargetARB in value
param pname ProgramStringPropertyARB in value
param string Void out array [COMPSIZE(target,pname)]
dlflags notlistable
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glsflags ignore
glxflags ignore
offset 681
GetVertexAttribdvARB(index, pname, params)
return void
param index UInt32 in value
param pname VertexAttribPropertyARB in value
param params Float64 out array [4]
dlflags notlistable
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glxvendorpriv 1301
glsflags client get
glsopcode 0x0232
alias GetVertexAttribdv
glsalias GetVertexAttribdv
GetVertexAttribfvARB(index, pname, params)
return void
param index UInt32 in value
param pname VertexAttribPropertyARB in value
param params Float32 out array [4]
dlflags notlistable
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glxvendorpriv 1302
glsflags client get
glsopcode 0x0233
alias GetVertexAttribfv
glsalias GetVertexAttribfv
GetVertexAttribivARB(index, pname, params)
return void
param index UInt32 in value
param pname VertexAttribPropertyARB in value
param params Int32 out array [4]
dlflags notlistable
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glxvendorpriv 1303
glsflags client get
glsopcode 0x0234
alias GetVertexAttribiv
glsalias GetVertexAttribiv
GetVertexAttribPointervARB(index, pname, pointer)
return void
param index UInt32 in value
param pname VertexAttribPointerPropertyARB in value
param pointer VoidPointer out array [1]
dlflags notlistable
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glxflags ignore
glsflags client get
glsopcode 0x0235
alias GetVertexAttribPointerv
glsalias GetVertexAttribPointerv
IsProgramARB(program)
return Boolean
param program UInt32 in value
dlflags notlistable
category ARB_vertex_program
version 1.3
extension soft WINSOFT NV10
glxvendorpriv 1304
glsflags get
alias IsProgram
glsalias IsProgram
###############################################################################
#
# ARB Extension #27
# ARB_fragment_program commands
#
###############################################################################
# All ARB_fragment_program entry points are shared with ARB_vertex_program,
# and are only included in that #define block, for now.
newcategory: ARB_fragment_program
passthru: /* All ARB_fragment_program entry points are shared with ARB_vertex_program. */
###############################################################################
#
# ARB Extension #28
# ARB_vertex_buffer_object commands
#
###############################################################################
BindBufferARB(target, buffer)
return void
param target BufferTargetARB in value
param buffer UInt32 in value
category ARB_vertex_buffer_object
version 1.2
extension
alias BindBuffer
glsalias BindBuffer
DeleteBuffersARB(n, buffers)
return void
param n SizeI in value
param buffers ConstUInt32 in array [n]
category ARB_vertex_buffer_object
version 1.2
extension
alias DeleteBuffers
glsalias DeleteBuffers
GenBuffersARB(n, buffers)
return void
param n SizeI in value
param buffers UInt32 out array [n]
category ARB_vertex_buffer_object
version 1.2
extension
alias GenBuffers
glsalias GenBuffers
IsBufferARB(buffer)
return Boolean
param buffer UInt32 in value
category ARB_vertex_buffer_object
version 1.2
extension
alias IsBuffer
glsalias IsBuffer
BufferDataARB(target, size, data, usage)
return void
param target BufferTargetARB in value
param size BufferSizeARB in value
param data ConstVoid in array [size]
param usage BufferUsageARB in value
category ARB_vertex_buffer_object
version 1.2
extension
alias BufferData
glsalias BufferData
BufferSubDataARB(target, offset, size, data)
return void
param target BufferTargetARB in value
param offset BufferOffsetARB in value
param size BufferSizeARB in value
param data ConstVoid in array [size]
category ARB_vertex_buffer_object
version 1.2
extension
alias BufferSubData
glsalias BufferSubData
GetBufferSubDataARB(target, offset, size, data)
return void
param target BufferTargetARB in value
param offset BufferOffsetARB in value
param size BufferSizeARB in value
param data Void out array [size]
category ARB_vertex_buffer_object
dlflags notlistable
version 1.2
extension
alias GetBufferSubData
glsalias GetBufferSubData
MapBufferARB(target, access)
return VoidPointer
param target BufferTargetARB in value
param access BufferAccessARB in value
category ARB_vertex_buffer_object
version 1.2
extension
alias MapBuffer
glsalias MapBuffer
UnmapBufferARB(target)
return Boolean
param target BufferTargetARB in value
category ARB_vertex_buffer_object
version 1.2
extension
alias UnmapBuffer
glsalias UnmapBuffer
GetBufferParameterivARB(target, pname, params)
return void
param target BufferTargetARB in value
param pname BufferPNameARB in value
param params Int32 out array [COMPSIZE(pname)]
category ARB_vertex_buffer_object
dlflags notlistable
version 1.2
extension
alias GetBufferParameteriv
glsalias GetBufferParameteriv
GetBufferPointervARB(target, pname, params)
return void
param target BufferTargetARB in value
param pname BufferPointerNameARB in value
param params VoidPointer out array [1]
category ARB_vertex_buffer_object
dlflags notlistable
version 1.2
extension
alias GetBufferPointerv
glsalias GetBufferPointerv
###############################################################################
#
# ARB Extension #29
# ARB_occlusion_query commands
#
###############################################################################
GenQueriesARB(n, ids)
return void
param n SizeI in value
param ids UInt32 out array [n]
category ARB_occlusion_query
version 1.5
extension
alias GenQueries
glsalias GenQueries
DeleteQueriesARB(n, ids)
return void
param n SizeI in value
param ids UInt32 in array [n]
category ARB_occlusion_query
version 1.5
extension
alias DeleteQueries
glsalias DeleteQueries
IsQueryARB(id)
return Boolean
param id UInt32 in value
category ARB_occlusion_query
version 1.5
extension
alias IsQuery
glsalias IsQuery
BeginQueryARB(target, id)
return void
param target GLenum in value
param id UInt32 in value
category ARB_occlusion_query
version 1.5
extension
alias BeginQuery
glsalias BeginQuery
EndQueryARB(target)
return void
param target GLenum in value
category ARB_occlusion_query
version 1.5
extension
alias EndQuery
glsalias EndQuery
GetQueryivARB(target, pname, params)
return void
param target GLenum in value
param pname GLenum in value
param params Int32 out array [pname]
category ARB_occlusion_query
dlflags notlistable
version 1.5
extension
alias GetQueryiv
glsalias GetQueryiv
GetQueryObjectivARB(id, pname, params)
return void
param id UInt32 in value
param pname GLenum in value
param params Int32 out array [pname]
category ARB_occlusion_query
dlflags notlistable
version 1.5
extension
alias GetQueryObjectiv
glsalias GetQueryObjectiv
GetQueryObjectuivARB(id, pname, params)
return void
param id UInt32 in value
param pname GLenum in value
param params UInt32 out array [pname]
category ARB_occlusion_query
dlflags notlistable
version 1.5
extension
alias GetQueryObjectuiv
glsalias GetQueryObjectuiv
###############################################################################
#
# ARB Extension #30
# ARB_shader_objects commands
#
###############################################################################
DeleteObjectARB(obj)
return void
param obj handleARB in value
category ARB_shader_objects
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
GetHandleARB(pname)
return handleARB
param pname GLenum in value
category ARB_shader_objects
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
glsflags get
glsopcode ?
offset ?
DetachObjectARB(containerObj, attachedObj)
return void
param containerObj handleARB in value
param attachedObj handleARB in value
category ARB_shader_objects
version 1.2
extension
glxropcode ?
glxflags ignore
alias DetachShader
glsalias DetachShader
CreateShaderObjectARB(shaderType)
return handleARB
param shaderType GLenum in value
category ARB_shader_objects
version 1.2
extension
glxropcode ?
glxflags ignore
alias CreateShader
glsalias CreateShader
ShaderSourceARB(shaderObj, count, string, length)
return void
param shaderObj handleARB in value
param count SizeI in value
param string charPointerARB in array [count]
param length Int32 in array [1]
category ARB_shader_objects
version 1.2
extension
glxropcode ?
glxflags ignore
alias ShaderSource
glsalias ShaderSource
CompileShaderARB(shaderObj)
return void
param shaderObj handleARB in value
category ARB_shader_objects
version 1.2
extension
glxropcode ?
glxflags ignore
alias CompileShader
glsalias CompileShader
CreateProgramObjectARB()
return handleARB
category ARB_shader_objects
version 1.2
extension
glxropcode ?
glxflags ignore
alias CreateProgram
glsalias CreateProgram
AttachObjectARB(containerObj, obj)
return void
param containerObj handleARB in value
param obj handleARB in value
category ARB_shader_objects
version 1.2
extension
glxropcode ?
glxflags ignore
alias AttachShader
glsalias AttachShader
LinkProgramARB(programObj)
return void
param programObj handleARB in value
category ARB_shader_objects
version 1.2
extension
glxropcode ?
glxflags ignore
alias LinkProgram
glsalias LinkProgram
UseProgramObjectARB(programObj)
return void
param programObj handleARB in value
category ARB_shader_objects
version 1.2
extension
glxropcode ?
glxflags ignore
alias UseProgram
glsalias UseProgram
ValidateProgramARB(programObj)
return void
param programObj handleARB in value
category ARB_shader_objects
version 1.2
extension
glxropcode ?
glxflags ignore
alias ValidateProgram
glsalias ValidateProgram
Uniform1fARB(location, v0)
return void
param location Int32 in value
param v0 Float32 in value
category ARB_shader_objects
version 1.2
extension
glxropcode ?
glxflags ignore
alias Uniform1f
glsalias Uniform1f
Uniform2fARB(location, v0, v1)
return void
param location Int32 in value
param v0 Float32 in value
param v1 Float32 in value
category ARB_shader_objects
version 1.2
extension
glxropcode ?
glxflags ignore
alias Uniform2f
glsalias Uniform2f
Uniform3fARB(location, v0, v1, v2)
return void
param location Int32 in value
param v0 Float32 in value
param v1 Float32 in value
param v2 Float32 in value
category ARB_shader_objects
version 1.2
extension
glxropcode ?
glxflags ignore
alias Uniform3f
glsalias Uniform3f
Uniform4fARB(location, v0, v1, v2, v3)
return void
param location Int32 in value
param v0 Float32 in value
param v1 Float32 in value
param v2 Float32 in value
param v3 Float32 in value
category ARB_shader_objects
version 1.2
extension
glxropcode ?
glxflags ignore
alias Uniform4f
glsalias Uniform4f
Uniform1iARB(location, v0)
return void
param location Int32 in value
param v0 Int32 in value
category ARB_shader_objects
version 1.2
extension
glxropcode ?
glxflags ignore
alias Uniform1i
glsalias Uniform1i
Uniform2iARB(location, v0, v1)
return void
param location Int32 in value
param v0 Int32 in value
param v1 Int32 in value
category ARB_shader_objects
version 1.2
extension
glxropcode ?
glxflags ignore
alias Uniform2i
glsalias Uniform2i
Uniform3iARB(location, v0, v1, v2)
return void
param location Int32 in value
param v0 Int32 in value
param v1 Int32 in value
param v2 Int32 in value
category ARB_shader_objects
version 1.2
extension
glxropcode ?
glxflags ignore
alias Uniform3i
glsalias Uniform3i
Uniform4iARB(location, v0, v1, v2, v3)
return void
param location Int32 in value
param v0 Int32 in value
param v1 Int32 in value
param v2 Int32 in value
param v3 Int32 in value
category ARB_shader_objects
version 1.2
extension
glxropcode ?
glxflags ignore
alias Uniform4i
glsalias Uniform4i
Uniform1fvARB(location, count, value)
return void
param location Int32 in value
param count SizeI in value
param value Float32 in array [count]
category ARB_shader_objects
version 1.2
extension
glxropcode ?
glxflags ignore
alias Uniform1fv
glsalias Uniform1fv
Uniform2fvARB(location, count, value)
return void
param location Int32 in value
param count SizeI in value
param value Float32 in array [count]
category ARB_shader_objects
version 1.2
extension
glxropcode ?
glxflags ignore
alias Uniform2fv
glsalias Uniform2fv
Uniform3fvARB(location, count, value)
return void
param location Int32 in value
param count SizeI in value
param value Float32 in array [count]
category ARB_shader_objects
version 1.2
extension
glxropcode ?
glxflags ignore
alias Uniform3fv
glsalias Uniform3fv
Uniform4fvARB(location, count, value)
return void
param location Int32 in value
param count SizeI in value
param value Float32 in array [count]
category ARB_shader_objects
version 1.2
extension
glxropcode ?
glxflags ignore
alias Uniform4fv
glsalias Uniform4fv
Uniform1ivARB(location, count, value)
return void
param location Int32 in value
param count SizeI in value
param value Int32 in array [count]
category ARB_shader_objects
version 1.2
extension
glxropcode ?
glxflags ignore
alias Uniform1iv
glsalias Uniform1iv
Uniform2ivARB(location, count, value)
return void
param location Int32 in value
param count SizeI in value
param value Int32 in array [count]
category ARB_shader_objects
version 1.2
extension
glxropcode ?
glxflags ignore
alias Uniform2iv
glsalias Uniform2iv
Uniform3ivARB(location, count, value)
return void
param location Int32 in value
param count SizeI in value
param value Int32 in array [count]
category ARB_shader_objects
version 1.2
extension
glxropcode ?
glxflags ignore
alias Uniform3iv
glsalias Uniform3iv
Uniform4ivARB(location, count, value)
return void
param location Int32 in value
param count SizeI in value
param value Int32 in array [count]
category ARB_shader_objects
version 1.2
extension
glxropcode ?
glxflags ignore
alias Uniform4iv
glsalias Uniform4iv
UniformMatrix2fvARB(location, count, transpose, value)
return void
param location Int32 in value
param count SizeI in value
param transpose Boolean in value
param value Float32 in array [count]
category ARB_shader_objects
version 1.2
extension
glxropcode ?
glxflags ignore
alias UniformMatrix2fv
glsalias UniformMatrix2fv
UniformMatrix3fvARB(location, count, transpose, value)
return void
param location Int32 in value
param count SizeI in value
param transpose Boolean in value
param value Float32 in array [count]
category ARB_shader_objects
version 1.2
extension
glxropcode ?
glxflags ignore
alias UniformMatrix3fv
glsalias UniformMatrix3fv
UniformMatrix4fvARB(location, count, transpose, value)
return void
param location Int32 in value
param count SizeI in value
param transpose Boolean in value
param value Float32 in array [count]
category ARB_shader_objects
version 1.2
extension
glxropcode ?
glxflags ignore
alias UniformMatrix4fv
glsalias UniformMatrix4fv
GetObjectParameterfvARB(obj, pname, params)
return void
param obj handleARB in value
param pname GLenum in value
param params Float32 out array [pname]
category ARB_shader_objects
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
glsflags get
glsopcode ?
offset ?
GetObjectParameterivARB(obj, pname, params)
return void
param obj handleARB in value
param pname GLenum in value
param params Int32 out array [pname]
category ARB_shader_objects
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
glsflags get
glsopcode ?
offset ?
GetInfoLogARB(obj, maxLength, length, infoLog)
return void
param obj handleARB in value
param maxLength SizeI in value
param length SizeI out array [1]
param infoLog charARB out array [length]
category ARB_shader_objects
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
glsflags get
glsopcode ?
offset ?
GetAttachedObjectsARB(containerObj, maxCount, count, obj)
return void
param containerObj handleARB in value
param maxCount SizeI in value
param count SizeI out array [1]
param obj handleARB out array [count]
category ARB_shader_objects
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
alias GetAttachedShaders
glsalias GetAttachedShaders
GetUniformLocationARB(programObj, name)
return Int32
param programObj handleARB in value
param name charARB in array []
category ARB_shader_objects
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
alias GetUniformLocation
glsalias GetUniformLocation
GetActiveUniformARB(programObj, index, maxLength, length, size, type, name)
return void
param programObj handleARB in value
param index UInt32 in value
param maxLength SizeI in value
param length SizeI out array [1]
param size Int32 out array [1]
param type GLenum out array [1]
param name charARB out array []
category ARB_shader_objects
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
alias GetActiveUniform
glsalias GetActiveUniform
GetUniformfvARB(programObj, location, params)
return void
param programObj handleARB in value
param location Int32 in value
param params Float32 out array [location]
category ARB_shader_objects
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
alias GetUniformfv
glsalias GetUniformfv
GetUniformivARB(programObj, location, params)
return void
param programObj handleARB in value
param location Int32 in value
param params Int32 out array [location]
category ARB_shader_objects
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
alias GetUniformiv
glsalias GetUniformiv
GetShaderSourceARB(obj, maxLength, length, source)
return void
param obj handleARB in value
param maxLength SizeI in value
param length SizeI out array [1]
param source charARB out array [length]
category ARB_shader_objects
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
alias GetShaderSource
glsalias GetShaderSource
###############################################################################
#
# ARB Extension #31
# ARB_vertex_shader commands
#
###############################################################################
BindAttribLocationARB(programObj, index, name)
return void
param programObj handleARB in value
param index UInt32 in value
param name charARB in array []
category ARB_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
alias BindAttribLocation
glsalias BindAttribLocation
GetActiveAttribARB(programObj, index, maxLength, length, size, type, name)
return void
param programObj handleARB in value
param index UInt32 in value
param maxLength SizeI in value
param length SizeI out array [1]
param size Int32 out array [1]
param type GLenum out array [1]
param name charARB out array []
category ARB_vertex_shader
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
alias GetActiveAttrib
glsalias GetActiveAttrib
GetAttribLocationARB(programObj, name)
return Int32
param programObj handleARB in value
param name charARB in array []
category ARB_vertex_shader
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
alias GetAttribLocation
glsalias GetAttribLocation
###############################################################################
#
# ARB Extension #32
# ARB_fragment_shader commands
#
###############################################################################
# (none)
newcategory: ARB_fragment_shader
###############################################################################
#
# ARB Extension #33
# ARB_shading_language_100 commands
#
###############################################################################
# (none)
newcategory: ARB_shading_language_100
###############################################################################
#
# ARB Extension #34
# ARB_texture_non_power_of_two commands
#
###############################################################################
# (none)
newcategory: ARB_texture_non_power_of_two
###############################################################################
#
# ARB Extension #35
# ARB_point_sprite commands
#
###############################################################################
# (none)
newcategory: ARB_point_sprite
###############################################################################
#
# ARB Extension #36
# ARB_fragment_program_shadow commands
#
###############################################################################
# (none)
newcategory: ARB_fragment_program_shadow
###############################################################################
#
# ARB Extension #37
# ARB_draw_buffers commands
#
###############################################################################
DrawBuffersARB(n, bufs)
return void
param n SizeI in value
param bufs DrawBufferModeATI in array [n]
category ARB_draw_buffers
version 1.5
extension
alias DrawBuffers
glsalias DrawBuffers
###############################################################################
#
# ARB Extension #38
# ARB_texture_rectangle commands
#
###############################################################################
# (none)
newcategory: ARB_texture_rectangle
###############################################################################
#
# ARB Extension #39
# ARB_color_buffer_float commands
#
###############################################################################
ClampColorARB(target, clamp)
return void
param target ClampColorTargetARB in value
param clamp ClampColorModeARB in value
category ARB_color_buffer_float
version 1.5
extension
glxropcode 234
glxflags ignore
glsopcode ?
offset ?
###############################################################################
#
# ARB Extension #40
# ARB_half_float_pixel commands
#
###############################################################################
# (none)
newcategory: ARB_half_float_pixel
###############################################################################
#
# ARB Extension #41
# ARB_texture_float commands
#
###############################################################################
# (none)
newcategory: ARB_texture_float
###############################################################################
#
# ARB Extension #42
# ARB_pixel_buffer_object commands
#
###############################################################################
# (none)
newcategory: ARB_pixel_buffer_object
###############################################################################
###############################################################################
#
# Non-ARB extensions, in order by registry extension number
#
###############################################################################
###############################################################################
###############################################################################
#
# Extension #1
# EXT_abgr commands
#
###############################################################################
# (none)
newcategory: EXT_abgr
###############################################################################
#
# Extension #2
# EXT_blend_color commands
#
###############################################################################
BlendColorEXT(red, green, blue, alpha)
return void
param red ClampedColorF in value
param green ClampedColorF in value
param blue ClampedColorF in value
param alpha ClampedColorF in value
category EXT_blend_color
version 1.0
glxropcode 4096
glxflags EXT
extension soft
alias BlendColor
glsalias BlendColor
###############################################################################
#
# Extension #3
# EXT_polygon_offset commands
#
###############################################################################
PolygonOffsetEXT(factor, bias)
return void
param factor Float32 in value
param bias Float32 in value
category EXT_polygon_offset
version 1.0
glxropcode 4098
glxflags EXT
extension soft
glsopcode 0x0122
offset 414
###############################################################################
#
# Extension #4
# EXT_texture commands
#
###############################################################################
# (none)
newcategory: EXT_texture
###############################################################################
#
# Extension #5 - skipped
#
###############################################################################
###############################################################################
#
# Extension #6
# EXT_texture3D commands
#
###############################################################################
# Arguably TexelInternalFormat, not PixelInternalFormat
TexImage3DEXT(target, level, internalformat, width, height, depth, border, format, type, pixels)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param internalformat PixelInternalFormat in value
param width SizeI in value
param height SizeI in value
param depth SizeI in value
param border CheckedInt32 in value
param format PixelFormat in value
param type PixelType in value
param pixels Void in array [COMPSIZE(format/type/width/height/depth)]
category EXT_texture3D
dlflags handcode
glxflags client-handcode server-handcode EXT
version 1.0
glxropcode 4114
extension
alias TexImage3D
glsalias TexImage3D
TexSubImage3DEXT(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param xoffset CheckedInt32 in value
param yoffset CheckedInt32 in value
param zoffset CheckedInt32 in value
param width SizeI in value
param height SizeI in value
param depth SizeI in value
param format PixelFormat in value
param type PixelType in value
param pixels Void in array [COMPSIZE(format/type/width/height/depth)]
category EXT_texture3D
dlflags handcode
glxflags client-handcode server-handcode EXT
version 1.0
glxropcode 4115
extension
alias TexSubImage3D
glsalias TexSubImage3D
###############################################################################
#
# Extension #7
# SGIS_texture_filter4 commands
#
###############################################################################
GetTexFilterFuncSGIS(target, filter, weights)
return void
param target TextureTarget in value
param filter TextureFilterSGIS in value
param weights Float32 out array [COMPSIZE(target/filter)]
category SGIS_texture_filter4
dlflags notlistable
version 1.0
glxflags SGI
glxvendorpriv 4101
extension
glsflags get
glsopcode 0x0175
offset 415
TexFilterFuncSGIS(target, filter, n, weights)
return void
param target TextureTarget in value
param filter TextureFilterSGIS in value
param n SizeI in value
param weights Float32 in array [n]
category SGIS_texture_filter4
glxflags SGI
version 1.0
glxropcode 2064
extension
glsopcode 0x0176
offset 416
###############################################################################
#
# Extension #8 - skipped
#
###############################################################################
###############################################################################
#
# Extension #9
# EXT_subtexture commands
#
###############################################################################
TexSubImage1DEXT(target, level, xoffset, width, format, type, pixels)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param xoffset CheckedInt32 in value
param width SizeI in value
param format PixelFormat in value
param type PixelType in value
param pixels Void in array [COMPSIZE(format/type/width)]
category EXT_subtexture
dlflags handcode
glxflags client-handcode server-handcode EXT
version 1.0
glxropcode 4099
extension
alias TexSubImage1D
glsalias TexSubImage1D
TexSubImage2DEXT(target, level, xoffset, yoffset, width, height, format, type, pixels)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param xoffset CheckedInt32 in value
param yoffset CheckedInt32 in value
param width SizeI in value
param height SizeI in value
param format PixelFormat in value
param type PixelType in value
param pixels Void in array [COMPSIZE(format/type/width/height)]
category EXT_subtexture
dlflags handcode
glxflags client-handcode server-handcode EXT
version 1.0
glxropcode 4100
extension
alias TexSubImage2D
glsalias TexSubImage2D
###############################################################################
#
# Extension #10
# EXT_copy_texture commands
#
###############################################################################
# Arguably TexelInternalFormat, not PixelInternalFormat
CopyTexImage1DEXT(target, level, internalformat, x, y, width, border)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param internalformat PixelInternalFormat in value
param x WinCoord in value
param y WinCoord in value
param width SizeI in value
param border CheckedInt32 in value
category EXT_copy_texture
version 1.0
glxflags EXT
glxropcode 4119
extension
alias CopyTexImage1D
glsalias CopyTexImage1D
# Arguably TexelInternalFormat, not PixelInternalFormat
CopyTexImage2DEXT(target, level, internalformat, x, y, width, height, border)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param internalformat PixelInternalFormat in value
param x WinCoord in value
param y WinCoord in value
param width SizeI in value
param height SizeI in value
param border CheckedInt32 in value
category EXT_copy_texture
version 1.0
glxflags EXT
glxropcode 4120
extension
alias CopyTexImage2D
glsalias CopyTexImage2D
CopyTexSubImage1DEXT(target, level, xoffset, x, y, width)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param xoffset CheckedInt32 in value
param x WinCoord in value
param y WinCoord in value
param width SizeI in value
category EXT_copy_texture
version 1.0
glxflags EXT
glxropcode 4121
extension
alias CopyTexSubImage1D
glsalias CopyTexSubImage1D
CopyTexSubImage2DEXT(target, level, xoffset, yoffset, x, y, width, height)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param xoffset CheckedInt32 in value
param yoffset CheckedInt32 in value
param x WinCoord in value
param y WinCoord in value
param width SizeI in value
param height SizeI in value
category EXT_copy_texture
version 1.0
glxflags EXT
glxropcode 4122
extension
alias CopyTexSubImage2D
glsalias CopyTexSubImage2D
CopyTexSubImage3DEXT(target, level, xoffset, yoffset, zoffset, x, y, width, height)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param xoffset CheckedInt32 in value
param yoffset CheckedInt32 in value
param zoffset CheckedInt32 in value
param x WinCoord in value
param y WinCoord in value
param width SizeI in value
param height SizeI in value
category EXT_copy_texture
version 1.0
glxflags EXT
glxropcode 4123
extension
alias CopyTexSubImage3D
glsalias CopyTexSubImage3D
###############################################################################
#
# Extension #11
# EXT_histogram commands
#
###############################################################################
GetHistogramEXT(target, reset, format, type, values)
return void
param target HistogramTargetEXT in value
param reset Boolean in value
param format PixelFormat in value
param type PixelType in value
param values Void out array [COMPSIZE(target/format/type)]
category EXT_histogram
dlflags notlistable
glxflags client-handcode server-handcode EXT
version 1.0
glxvendorpriv 5
extension
glsflags get pixel-pack
glsopcode 0x0132
offset 417
GetHistogramParameterfvEXT(target, pname, params)
return void
param target HistogramTargetEXT in value
param pname GetHistogramParameterPNameEXT in value
param params Float32 out array [COMPSIZE(pname)]
category EXT_histogram
dlflags notlistable
version 1.0
glxvendorpriv 6
glxflags EXT
extension
glsflags get
glsopcode 0x0133
offset 418
GetHistogramParameterivEXT(target, pname, params)
return void
param target HistogramTargetEXT in value
param pname GetHistogramParameterPNameEXT in value
param params Int32 out array [COMPSIZE(pname)]
category EXT_histogram
dlflags notlistable
version 1.0
glxvendorpriv 7
glxflags EXT
extension
glsflags get
glsopcode 0x0134
offset 419
GetMinmaxEXT(target, reset, format, type, values)
return void
param target MinmaxTargetEXT in value
param reset Boolean in value
param format PixelFormat in value
param type PixelType in value
param values Void out array [COMPSIZE(target/format/type)]
category EXT_histogram
dlflags notlistable
glxflags client-handcode server-handcode EXT
version 1.0
glxvendorpriv 8
extension
glsflags get pixel-pack
glsopcode 0x0135
offset 420
GetMinmaxParameterfvEXT(target, pname, params)
return void
param target MinmaxTargetEXT in value
param pname GetMinmaxParameterPNameEXT in value
param params Float32 out array [COMPSIZE(pname)]
category EXT_histogram
dlflags notlistable
version 1.0
glxvendorpriv 9
glxflags EXT
extension
glsflags get
glsopcode 0x0136
offset 421
GetMinmaxParameterivEXT(target, pname, params)
return void
param target MinmaxTargetEXT in value
param pname GetMinmaxParameterPNameEXT in value
param params Int32 out array [COMPSIZE(pname)]
category EXT_histogram
dlflags notlistable
version 1.0
glxvendorpriv 10
glxflags EXT
extension
glsflags get
glsopcode 0x0137
offset 422
HistogramEXT(target, width, internalformat, sink)
return void
param target HistogramTargetEXT in value
param width SizeI in value
param internalformat PixelInternalFormat in value
param sink Boolean in value
category EXT_histogram
version 1.0
glxropcode 4110
glxflags EXT
extension
alias Histogram
glsalias Histogram
MinmaxEXT(target, internalformat, sink)
return void
param target MinmaxTargetEXT in value
param internalformat PixelInternalFormat in value
param sink Boolean in value
category EXT_histogram
version 1.0
glxropcode 4111
glxflags EXT
extension
alias Minmax
glsalias Minmax
ResetHistogramEXT(target)
return void
param target HistogramTargetEXT in value
category EXT_histogram
version 1.0
glxropcode 4112
glxflags EXT
extension
alias ResetHistogram
glsalias ResetHistogram
ResetMinmaxEXT(target)
return void
param target MinmaxTargetEXT in value
category EXT_histogram
version 1.0
glxropcode 4113
glxflags EXT
extension
alias ResetMinmax
glsalias ResetMinmax
###############################################################################
#
# Extension #12
# EXT_convolution commands
#
###############################################################################
ConvolutionFilter1DEXT(target, internalformat, width, format, type, image)
return void
param target ConvolutionTargetEXT in value
param internalformat PixelInternalFormat in value
param width SizeI in value
param format PixelFormat in value
param type PixelType in value
param image Void in array [COMPSIZE(format/type/width)]
category EXT_convolution
dlflags handcode
glxflags client-handcode server-handcode EXT
version 1.0
glxropcode 4101
extension
alias ConvolutionFilter1D
glsalias ConvolutionFilter1D
ConvolutionFilter2DEXT(target, internalformat, width, height, format, type, image)
return void
param target ConvolutionTargetEXT in value
param internalformat PixelInternalFormat in value
param width SizeI in value
param height SizeI in value
param format PixelFormat in value
param type PixelType in value
param image Void in array [COMPSIZE(format/type/width/height)]
category EXT_convolution
dlflags handcode
glxflags client-handcode server-handcode EXT
version 1.0
glxropcode 4102
extension
alias ConvolutionFilter2D
glsalias ConvolutionFilter2D
ConvolutionParameterfEXT(target, pname, params)
return void
param target ConvolutionTargetEXT in value
param pname ConvolutionParameterEXT in value
param params CheckedFloat32 in value
category EXT_convolution
version 1.0
glxropcode 4103
glxflags EXT
extension
alias ConvolutionParameterf
glsalias ConvolutionParameterf
ConvolutionParameterfvEXT(target, pname, params)
return void
param target ConvolutionTargetEXT in value
param pname ConvolutionParameterEXT in value
param params CheckedFloat32 in array [COMPSIZE(pname)]
category EXT_convolution
version 1.0
glxropcode 4104
glxflags EXT
extension
alias ConvolutionParameterfv
glsalias ConvolutionParameterfv
ConvolutionParameteriEXT(target, pname, params)
return void
param target ConvolutionTargetEXT in value
param pname ConvolutionParameterEXT in value
param params CheckedInt32 in value
category EXT_convolution
version 1.0
glxropcode 4105
glxflags EXT
extension
alias ConvolutionParameteri
glsalias ConvolutionParameteri
ConvolutionParameterivEXT(target, pname, params)
return void
param target ConvolutionTargetEXT in value
param pname ConvolutionParameterEXT in value
param params CheckedInt32 in array [COMPSIZE(pname)]
category EXT_convolution
version 1.0
glxropcode 4106
glxflags EXT
extension
alias ConvolutionParameteriv
glsalias ConvolutionParameteriv
CopyConvolutionFilter1DEXT(target, internalformat, x, y, width)
return void
param target ConvolutionTargetEXT in value
param internalformat PixelInternalFormat in value
param x WinCoord in value
param y WinCoord in value
param width SizeI in value
category EXT_convolution
version 1.0
glxropcode 4107
glxflags EXT
extension
alias CopyConvolutionFilter1D
glsalias CopyConvolutionFilter1D
CopyConvolutionFilter2DEXT(target, internalformat, x, y, width, height)
return void
param target ConvolutionTargetEXT in value
param internalformat PixelInternalFormat in value
param x WinCoord in value
param y WinCoord in value
param width SizeI in value
param height SizeI in value
category EXT_convolution
version 1.0
glxropcode 4108
glxflags EXT
extension
alias CopyConvolutionFilter2D
glsalias CopyConvolutionFilter2D
GetConvolutionFilterEXT(target, format, type, image)
return void
param target ConvolutionTargetEXT in value
param format PixelFormat in value
param type PixelType in value
param image Void out array [COMPSIZE(target/format/type)]
category EXT_convolution
dlflags notlistable
glxflags client-handcode server-handcode EXT
version 1.0
glxvendorpriv 1
extension
glsflags get pixel-pack
glsopcode 0x012D
offset 423
GetConvolutionParameterfvEXT(target, pname, params)
return void
param target ConvolutionTargetEXT in value
param pname ConvolutionParameterEXT in value
param params Float32 out array [COMPSIZE(pname)]
category EXT_convolution
dlflags notlistable
version 1.0
glxvendorpriv 2
glxflags EXT
extension
glsflags get
glsopcode 0x012E
offset 424
GetConvolutionParameterivEXT(target, pname, params)
return void
param target ConvolutionTargetEXT in value
param pname ConvolutionParameterEXT in value
param params Int32 out array [COMPSIZE(pname)]
category EXT_convolution
dlflags notlistable
version 1.0
glxvendorpriv 3
glxflags EXT
extension
glsflags get
glsopcode 0x012F
offset 425
GetSeparableFilterEXT(target, format, type, row, column, span)
return void
param target SeparableTargetEXT in value
param format PixelFormat in value
param type PixelType in value
param row Void out array [COMPSIZE(target/format/type)]
param column Void out array [COMPSIZE(target/format/type)]
param span Void out array [COMPSIZE(target/format/type)]
category EXT_convolution
dlflags notlistable
glxflags client-handcode server-handcode EXT
version 1.0
glxvendorpriv 4
extension
glsflags get pixel-pack
glsopcode 0x0130
offset 426
SeparableFilter2DEXT(target, internalformat, width, height, format, type, row, column)
return void
param target SeparableTargetEXT in value
param internalformat PixelInternalFormat in value
param width SizeI in value
param height SizeI in value
param format PixelFormat in value
param type PixelType in value
param row Void in array [COMPSIZE(target/format/type/width)]
param column Void in array [COMPSIZE(target/format/type/height)]
category EXT_convolution
dlflags handcode
glxflags client-handcode server-handcode EXT
version 1.0
glxropcode 4109
extension
alias SeparableFilter2D
glsalias SeparableFilter2D
###############################################################################
#
# Extension #13
# SGI_color_matrix commands
#
###############################################################################
# (none)
newcategory: SGI_color_matrix
###############################################################################
#
# Extension #14
# SGI_color_table commands
#
###############################################################################
ColorTableSGI(target, internalformat, width, format, type, table)
return void
param target ColorTableTargetSGI in value
param internalformat PixelInternalFormat in value
param width SizeI in value
param format PixelFormat in value
param type PixelType in value
param table Void in array [COMPSIZE(format/type/width)]
category SGI_color_table
dlflags handcode
glxflags client-handcode server-handcode SGI
version 1.0
glxropcode 2053
extension
alias ColorTable
glsalias ColorTable
ColorTableParameterfvSGI(target, pname, params)
return void
param target ColorTableTargetSGI in value
param pname ColorTableParameterPNameSGI in value
param params CheckedFloat32 in array [COMPSIZE(pname)]
category SGI_color_table
version 1.0
glxropcode 2054
glxflags SGI
extension
alias ColorTableParameterfv
glsalias ColorTableParameterfv
ColorTableParameterivSGI(target, pname, params)
return void
param target ColorTableTargetSGI in value
param pname ColorTableParameterPNameSGI in value
param params CheckedInt32 in array [COMPSIZE(pname)]
category SGI_color_table
version 1.0
glxropcode 2055
glxflags SGI
extension
alias ColorTableParameteriv
glsalias ColorTableParameteriv
CopyColorTableSGI(target, internalformat, x, y, width)
return void
param target ColorTableTargetSGI in value
param internalformat PixelInternalFormat in value
param x WinCoord in value
param y WinCoord in value
param width SizeI in value
category SGI_color_table
version 1.0
glxropcode 2056
glxflags SGI
extension
alias CopyColorTable
glsalias CopyColorTable
GetColorTableSGI(target, format, type, table)
return void
param target ColorTableTargetSGI in value
param format PixelFormat in value
param type PixelType in value
param table Void out array [COMPSIZE(target/format/type)]
category SGI_color_table
dlflags notlistable
glxflags client-handcode server-handcode SGI
version 1.0
glxvendorpriv 4098
extension
glsflags get pixel-pack
glsopcode 0x016B
offset 427
GetColorTableParameterfvSGI(target, pname, params)
return void
param target ColorTableTargetSGI in value
param pname GetColorTableParameterPNameSGI in value
param params Float32 out array [COMPSIZE(pname)]
category SGI_color_table
dlflags notlistable
version 1.0
glxflags SGI
glxvendorpriv 4099
extension
glsflags get
glsopcode 0x016C
offset 428
GetColorTableParameterivSGI(target, pname, params)
return void
param target ColorTableTargetSGI in value
param pname GetColorTableParameterPNameSGI in value
param params Int32 out array [COMPSIZE(pname)]
category SGI_color_table
dlflags notlistable
version 1.0
glxflags SGI
glxvendorpriv 4100
extension
glsflags get
glsopcode 0x016D
offset 429
###############################################################################
#
# Extension #15
# SGIX_pixel_texture commands
#
###############################################################################
PixelTexGenSGIX(mode)
return void
param mode PixelTexGenModeSGIX in value
category SGIX_pixel_texture
version 1.0
glxflags SGI
glxropcode 2059
extension
glsopcode 0x0170
offset 430
###############################################################################
#
# Extension #15 (variant)
# SGIS_pixel_texture commands
# Both SGIS and SGIX forms have extension #15!
#
###############################################################################
PixelTexGenParameteriSGIS(pname, param)
return void
param pname PixelTexGenParameterNameSGIS in value
param param CheckedInt32 in value
category SGIS_pixel_texture
version 1.0
extension
glxropcode ?
glxflags ignore
glsflags gl-enum
glsopcode 0x0192
offset 431
PixelTexGenParameterivSGIS(pname, params)
return void
param pname PixelTexGenParameterNameSGIS in value
param params CheckedInt32 in array [COMPSIZE(pname)]
category SGIS_pixel_texture
version 1.0
extension
glxropcode ?
glxflags ignore
glsflags gl-enum
glsopcode 0x0193
offset 432
PixelTexGenParameterfSGIS(pname, param)
return void
param pname PixelTexGenParameterNameSGIS in value
param param CheckedFloat32 in value
category SGIS_pixel_texture
version 1.0
extension
glxropcode ?
glxflags ignore
glsflags gl-enum
glsopcode 0x0194
offset 433
PixelTexGenParameterfvSGIS(pname, params)
return void
param pname PixelTexGenParameterNameSGIS in value
param params CheckedFloat32 in array [COMPSIZE(pname)]
category SGIS_pixel_texture
version 1.0
extension
glxropcode ?
glxflags ignore
glsflags gl-enum
glsopcode 0x0195
offset 434
GetPixelTexGenParameterivSGIS(pname, params)
return void
param pname PixelTexGenParameterNameSGIS in value
param params CheckedInt32 out array [COMPSIZE(pname)]
dlflags notlistable
category SGIS_pixel_texture
version 1.0
extension
glxvendorpriv ?
glxflags ignore
glsflags get
glsopcode 0x0196
offset 435
GetPixelTexGenParameterfvSGIS(pname, params)
return void
param pname PixelTexGenParameterNameSGIS in value
param params CheckedFloat32 out array [COMPSIZE(pname)]
dlflags notlistable
category SGIS_pixel_texture
version 1.0
extension
glxvendorpriv ?
glxflags ignore
glsflags get
glsopcode 0x0197
offset 436
###############################################################################
#
# Extension #16
# SGIS_texture4D commands
#
###############################################################################
TexImage4DSGIS(target, level, internalformat, width, height, depth, size4d, border, format, type, pixels)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param internalformat PixelInternalFormat in value
param width SizeI in value
param height SizeI in value
param depth SizeI in value
param size4d SizeI in value
param border CheckedInt32 in value
param format PixelFormat in value
param type PixelType in value
param pixels Void in array [COMPSIZE(format/type/width/height/depth/size4d)]
category SGIS_texture4D
dlflags handcode
glxflags client-handcode server-handcode SGI
version 1.0
glxropcode 2057
extension
glsflags pixel-null pixel-unpack
glsopcode 0x016E
offset 437
TexSubImage4DSGIS(target, level, xoffset, yoffset, zoffset, woffset, width, height, depth, size4d, format, type, pixels)
return void
param target TextureTarget in value
param level CheckedInt32 in value
param xoffset CheckedInt32 in value
param yoffset CheckedInt32 in value
param zoffset CheckedInt32 in value
param woffset CheckedInt32 in value
param width SizeI in value
param height SizeI in value
param depth SizeI in value
param size4d SizeI in value
param format PixelFormat in value
param type PixelType in value
param pixels Void in array [COMPSIZE(format/type/width/height/depth/size4d)]
category SGIS_texture4D
dlflags handcode
glxflags client-handcode server-handcode SGI
version 1.0
glxropcode 2058
extension
glsflags pixel-unpack
glsopcode 0x016F
offset 438
###############################################################################
#
# Extension #17
# SGI_texture_color_table commands
#
###############################################################################
# (none)
newcategory: SGI_texture_color_table
###############################################################################
#
# Extension #18
# EXT_cmyka commands
#
###############################################################################
# (none)
newcategory: EXT_cmyka
###############################################################################
#
# Extension #19 - skipped
#
###############################################################################
###############################################################################
#
# Extension #20
# EXT_texture_object commands
#
###############################################################################
AreTexturesResidentEXT(n, textures, residences)
return Boolean
param n SizeI in value
param textures Texture in array [n]
param residences Boolean out array [n]
category EXT_texture_object
glxflags EXT
glxvendorpriv 11
dlflags notlistable
version 1.0
extension
glsflags get
glsopcode 0x0147
offset 439
BindTextureEXT(target, texture)
return void
param target TextureTarget in value
param texture Texture in value
category EXT_texture_object
version 1.0
glxflags EXT
glxropcode 4117
extension
alias BindTexture
glsalias BindTexture
DeleteTexturesEXT(n, textures)
return void
param n SizeI in value
param textures Texture in array [n]
category EXT_texture_object
dlflags notlistable
version 1.0
glxflags EXT
glxvendorpriv 12
extension
glsopcode 0x0149
offset 561
GenTexturesEXT(n, textures)
return void
param n SizeI in value
param textures Texture out array [n]
category EXT_texture_object
dlflags notlistable
version 1.0
glxflags EXT
glxvendorpriv 13
extension
glsopcode 0x014A
offset 440
IsTextureEXT(texture)
return Boolean
param texture Texture in value
category EXT_texture_object
dlflags notlistable
version 1.0
glxflags EXT
glxvendorpriv 14
extension
glsflags get
glsopcode 0x014B
offset 441
PrioritizeTexturesEXT(n, textures, priorities)
return void
param n SizeI in value
param textures Texture in array [n]
param priorities ClampedFloat32 in array [n]
category EXT_texture_object
glxflags EXT
version 1.0
glxropcode 4118
extension
alias PrioritizeTextures
glsalias PrioritizeTextures
###############################################################################
#
# Extension #21
# SGIS_detail_texture commands
#
###############################################################################
DetailTexFuncSGIS(target, n, points)
return void
param target TextureTarget in value
param n SizeI in value
param points Float32 in array [n*2]
category SGIS_detail_texture
glxflags SGI
version 1.0
glxropcode 2051
extension
glsopcode 0x0163
offset 442
GetDetailTexFuncSGIS(target, points)
return void
param target TextureTarget in value
param points Float32 out array [COMPSIZE(target)]
category SGIS_detail_texture
dlflags notlistable
version 1.0
glxflags SGI
glxvendorpriv 4096
extension
glsflags get
glsopcode 0x0164
offset 443
###############################################################################
#
# Extension #22
# SGIS_sharpen_texture commands
#
###############################################################################
SharpenTexFuncSGIS(target, n, points)
return void
param target TextureTarget in value
param n SizeI in value
param points Float32 in array [n*2]
category SGIS_sharpen_texture
glxflags SGI
version 1.0
glxropcode 2052
extension
glsopcode 0x0165
offset 444
GetSharpenTexFuncSGIS(target, points)
return void
param target TextureTarget in value
param points Float32 out array [COMPSIZE(target)]
category SGIS_sharpen_texture
dlflags notlistable
version 1.0
glxflags SGI
glxvendorpriv 4097
extension
glsflags get
glsopcode 0x0166
offset 445
###############################################################################
#
# EXT_packed_pixels commands
# Extension #23
#
###############################################################################
# (none)
newcategory: EXT_packed_pixels
###############################################################################
#
# Extension #24
# SGIS_texture_lod commands
#
###############################################################################
# (none)
newcategory: SGIS_texture_lod
###############################################################################
#
# Extension #25
# SGIS_multisample commands
#
###############################################################################
SampleMaskSGIS(value, invert)
return void
param value ClampedFloat32 in value
param invert Boolean in value
category SGIS_multisample
version 1.1
glxropcode 2048
glxflags SGI
extension
alias SampleMaskEXT
glsalias SampleMaskEXT
SamplePatternSGIS(pattern)
return void
param pattern SamplePatternSGIS in value
category SGIS_multisample
version 1.0
glxropcode 2049
glxflags SGI
extension
alias SamplePatternEXT
glsalias SamplePatternEXT
###############################################################################
#
# Extension #26 - no specification?
#
###############################################################################
###############################################################################
#
# Extension #27
# EXT_rescale_normal commands
#
###############################################################################
# (none)
newcategory: EXT_rescale_normal
###############################################################################
#
# Extension #28 - GLX_EXT_visual_info
# Extension #29 - skipped
#
###############################################################################
###############################################################################
#
# Extension #30
# EXT_vertex_array commands
#
###############################################################################
ArrayElementEXT(i)
return void
param i Int32 in value
category EXT_vertex_array
dlflags handcode
glxflags client-handcode server-handcode EXT
version 1.0
extension
alias ArrayElement
glsalias ArrayElement
ColorPointerEXT(size, type, stride, count, pointer)
return void
param size Int32 in value
param type ColorPointerType in value
param stride SizeI in value
param count SizeI in value
param pointer Void in array [COMPSIZE(size/type/stride/count)] retained
category EXT_vertex_array
dlflags notlistable
glxflags client-handcode server-handcode EXT
version 1.0
extension
glsflags client
glsopcode 0x013F
offset 448
DrawArraysEXT(mode, first, count)
return void
param mode BeginMode in value
param first Int32 in value
param count SizeI in value
category EXT_vertex_array
dlflags handcode
glxflags client-handcode server-handcode EXT
version 1.0
glxropcode 4116
extension
alias DrawArrays
glsopcode 0x0140
EdgeFlagPointerEXT(stride, count, pointer)
return void
param stride SizeI in value
param count SizeI in value
param pointer Boolean in array [COMPSIZE(stride/count)] retained
category EXT_vertex_array
dlflags notlistable
glxflags client-handcode server-handcode EXT
version 1.0
extension
glsflags client
glsopcode 0x0141
offset 449
GetPointervEXT(pname, params)
return void
param pname GetPointervPName in value
param params VoidPointer out array [1]
category EXT_vertex_array
dlflags notlistable
glxflags client-handcode server-handcode EXT
version 1.0
extension
alias GetPointerv
glsalias GetPointerv
IndexPointerEXT(type, stride, count, pointer)
return void
param type IndexPointerType in value
param stride SizeI in value
param count SizeI in value
param pointer Void in array [COMPSIZE(type/stride/count)] retained
category EXT_vertex_array
dlflags notlistable
glxflags client-handcode server-handcode EXT
version 1.0
extension
glsflags client
glsopcode 0x0143
offset 450
NormalPointerEXT(type, stride, count, pointer)
return void
param type NormalPointerType in value
param stride SizeI in value
param count SizeI in value
param pointer Void in array [COMPSIZE(type/stride/count)] retained
category EXT_vertex_array
dlflags notlistable
glxflags client-handcode server-handcode EXT
version 1.0
extension
glsflags client
glsopcode 0x0144
offset 451
TexCoordPointerEXT(size, type, stride, count, pointer)
return void
param size Int32 in value
param type TexCoordPointerType in value
param stride SizeI in value
param count SizeI in value
param pointer Void in array [COMPSIZE(size/type/stride/count)] retained
category EXT_vertex_array
dlflags notlistable
glxflags client-handcode server-handcode EXT
version 1.0
extension
glsflags client
glsopcode 0x0145
offset 452
VertexPointerEXT(size, type, stride, count, pointer)
return void
param size Int32 in value
param type VertexPointerType in value
param stride SizeI in value
param count SizeI in value
param pointer Void in array [COMPSIZE(size/type/stride/count)] retained
category EXT_vertex_array
dlflags notlistable
glxflags client-handcode server-handcode EXT
version 1.0
extension
glsflags client
glsopcode 0x0146
offset 453
###############################################################################
#
# Extension #31
# EXT_misc_attribute commands
#
###############################################################################
# (none)
newcategory: EXT_misc_attribute
###############################################################################
#
# Extension #32
# SGIS_generate_mipmap commands
#
###############################################################################
# (none)
newcategory: SGIS_generate_mipmap
###############################################################################
#
# Extension #33
# SGIX_clipmap commands
#
###############################################################################
# (none)
newcategory: SGIX_clipmap
###############################################################################
#
# Extension #34
# SGIX_shadow commands
#
###############################################################################
# (none)
newcategory: SGIX_shadow
###############################################################################
#
# Extension #35
# SGIS_texture_edge_clamp commands
#
###############################################################################
# (none)
newcategory: SGIS_texture_edge_clamp
###############################################################################
#
# Extension #36
# SGIS_texture_border_clamp commands
#
###############################################################################
# (none)
newcategory: SGIS_texture_border_clamp
###############################################################################
#
# Extension #37
# EXT_blend_minmax commands
#
###############################################################################
BlendEquationEXT(mode)
return void
param mode BlendEquationModeEXT in value
category EXT_blend_minmax
version 1.0
glxropcode 4097
glxflags EXT
extension soft
alias BlendEquation
glsalias BlendEquation
###############################################################################
#
# Extension #38
# EXT_blend_subtract commands
#
###############################################################################
# (none)
newcategory: EXT_blend_subtract
###############################################################################
#
# Extension #39
# EXT_blend_logic_op commands
#
###############################################################################
# (none)
newcategory: EXT_blend_logic_op
###############################################################################
#
# Extension #40 - GLX_SGI_swap_control
# Extension #41 - GLX_SGI_video_sync
# Extension #42 - GLX_SGI_make_current_read
# Extension #43 - GLX_SGIX_video_source
# Extension #44 - GLX_EXT_visual_rating
#
###############################################################################
###############################################################################
#
# Extension #45
# SGIX_interlace commands
#
###############################################################################
# (none)
newcategory: SGIX_interlace
###############################################################################
#
# Extension #46
# SGIX_pixel_tiles commands
#
###############################################################################
# (none)
newcategory: SGIX_pixel_tiles
###############################################################################
#
# Extension #47 - GLX_EXT_import_context
# Extension #48 - skipped
# Extension #49 - GLX_SGIX_fbconfig
# Extension #50 - GLX_SGIX_pbuffer
#
###############################################################################
###############################################################################
#
# Extension #51
# SGIX_texture_select commands
#
###############################################################################
# (none)
newcategory: SGIX_texture_select
###############################################################################
#
# Extension #52
# SGIX_sprite commands
#
###############################################################################
SpriteParameterfSGIX(pname, param)
return void
param pname SpriteParameterNameSGIX in value
param param CheckedFloat32 in value
category SGIX_sprite
version 1.0
glxflags SGI
glxropcode 2060
extension
glsflags gl-enum
glsopcode 0x0171
offset 454
SpriteParameterfvSGIX(pname, params)
return void
param pname SpriteParameterNameSGIX in value
param params CheckedFloat32 in array [COMPSIZE(pname)]
category SGIX_sprite
version 1.0
glxflags SGI
glxropcode 2061
extension
glsflags gl-enum
glsopcode 0x0172
offset 455
SpriteParameteriSGIX(pname, param)
return void
param pname SpriteParameterNameSGIX in value
param param CheckedInt32 in value
category SGIX_sprite
version 1.0
glxflags SGI
glxropcode 2062
extension
glsflags gl-enum
glsopcode 0x0173
offset 456
SpriteParameterivSGIX(pname, params)
return void
param pname SpriteParameterNameSGIX in value
param params CheckedInt32 in array [COMPSIZE(pname)]
category SGIX_sprite
version 1.0
glxflags SGI
glxropcode 2063
extension
glsflags gl-enum
glsopcode 0x0174
offset 457
###############################################################################
#
# Extension #53
# SGIX_texture_multi_buffer commands
#
###############################################################################
# (none)
newcategory: SGIX_texture_multi_buffer
###############################################################################
#
# Extension #54
# EXT_point_parameters / SGIS_point_parameters commands
#
###############################################################################
PointParameterfEXT(pname, param)
return void
param pname PointParameterNameARB in value
param param CheckedFloat32 in value
category EXT_point_parameters
version 1.0
glxflags SGI
extension
alias PointParameterfARB
glsalias PointParameterfARB
PointParameterfvEXT(pname, params)
return void
param pname PointParameterNameARB in value
param params CheckedFloat32 in array [COMPSIZE(pname)]
category EXT_point_parameters
version 1.0
glxflags SGI
extension
alias PointParameterfvARB
glsalias PointParameterfvARB
PointParameterfSGIS(pname, param)
return void
param pname PointParameterNameARB in value
param param CheckedFloat32 in value
category SGIS_point_parameters
version 1.0
glxflags SGI
extension
alias PointParameterfARB
glsalias PointParameterfARB
PointParameterfvSGIS(pname, params)
return void
param pname PointParameterNameARB in value
param params CheckedFloat32 in array [COMPSIZE(pname)]
category SGIS_point_parameters
version 1.0
glxflags SGI
extension
alias PointParameterfvARB
glsalias PointParameterfvARB
###############################################################################
#
# Extension #55
# SGIX_instruments commands
#
###############################################################################
GetInstrumentsSGIX()
return Int32
dlflags notlistable
category SGIX_instruments
version 1.0
glxflags SGI
glxvendorpriv 4102
extension
glsflags get
glsopcode 0x017A
offset 460
InstrumentsBufferSGIX(size, buffer)
return void
param size SizeI in value
param buffer Int32 out array [size] retained
dlflags notlistable
category SGIX_instruments
version 1.0
glxflags SGI
glxvendorpriv 4103
extension
glsflags client
glsopcode 0x017B
offset 461
PollInstrumentsSGIX(marker_p)
return Int32
param marker_p Int32 out array [1]
dlflags notlistable
category SGIX_instruments
version 1.0
glxflags SGI
glxvendorpriv 4104
extension
glsflags get
glsopcode 0x017C
offset 462
ReadInstrumentsSGIX(marker)
return void
param marker Int32 in value
category SGIX_instruments
version 1.0
glxflags SGI
glxropcode 2077
extension
glsopcode 0x017D
offset 463
StartInstrumentsSGIX()
return void
category SGIX_instruments
version 1.0
glxflags SGI
glxropcode 2069
extension
glsopcode 0x017E
offset 464
StopInstrumentsSGIX(marker)
return void
param marker Int32 in value
category SGIX_instruments
version 1.0
glxflags SGI
glxropcode 2070
extension
glsopcode 0x017F
offset 465
###############################################################################
#
# Extension #56
# SGIX_texture_scale_bias commands
#
###############################################################################
# (none)
newcategory: SGIX_texture_scale_bias
###############################################################################
#
# Extension #57
# SGIX_framezoom commands
#
###############################################################################
FrameZoomSGIX(factor)
return void
param factor CheckedInt32 in value
category SGIX_framezoom
version 1.0
glxflags SGI
glxropcode 2072
extension
glsopcode 0x0182
offset 466
###############################################################################
#
# Extension #58
# SGIX_tag_sample_buffer commands
#
###############################################################################
TagSampleBufferSGIX()
return void
category SGIX_tag_sample_buffer
version 1.0
glxropcode 2050
glxflags SGI
extension
glsopcode 0x0162
offset 467
###############################################################################
#
# Extension #59
# SGIX_polynomial_ffd commands
#
###############################################################################
DeformationMap3dSGIX(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, w1, w2, wstride, worder, points)
return void
param target FfdTargetSGIX in value
param u1 CoordD in value
param u2 CoordD in value
param ustride Int32 in value
param uorder CheckedInt32 in value
param v1 CoordD in value
param v2 CoordD in value
param vstride Int32 in value
param vorder CheckedInt32 in value
param w1 CoordD in value
param w2 CoordD in value
param wstride Int32 in value
param worder CheckedInt32 in value
param points CoordD in array [COMPSIZE(target/ustride/uorder/vstride/vorder/wstride/worder)]
dlflags handcode
category SGIX_polynomial_ffd
version 1.0
glxflags SGI ignore
glxropcode 2073
extension
glsflags capture-handcode
glsopcode 0x0184
offset ?
DeformationMap3fSGIX(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, w1, w2, wstride, worder, points)
return void
param target FfdTargetSGIX in value
param u1 CoordF in value
param u2 CoordF in value
param ustride Int32 in value
param uorder CheckedInt32 in value
param v1 CoordF in value
param v2 CoordF in value
param vstride Int32 in value
param vorder CheckedInt32 in value
param w1 CoordF in value
param w2 CoordF in value
param wstride Int32 in value
param worder CheckedInt32 in value
param points CoordF in array [COMPSIZE(target/ustride/uorder/vstride/vorder/wstride/worder)]
category SGIX_polynomial_ffd
dlflags handcode
version 1.0
glxflags SGI ignore
glxropcode 2074
extension
glsflags capture-handcode
glsopcode 0x0185
offset ?
DeformSGIX(mask)
return void
param mask FfdMaskSGIX in value
category SGIX_polynomial_ffd
version 1.0
glxflags SGI ignore
glxropcode 2075
extension
glsopcode 0x0186
offset ?
LoadIdentityDeformationMapSGIX(mask)
return void
param mask FfdMaskSGIX in value
category SGIX_polynomial_ffd
version 1.0
glxflags SGI ignore
glxropcode 2076
extension
glsopcode 0x0187
offset ?
###############################################################################
#
# Extension #60
# SGIX_reference_plane commands
#
###############################################################################
ReferencePlaneSGIX(equation)
return void
param equation Float64 in array [4]
category SGIX_reference_plane
version 1.0
glxflags SGI
glxropcode 2071
extension
glsopcode 0x0181
offset 468
###############################################################################
#
# Extension #61
# SGIX_flush_raster commands
#
###############################################################################
FlushRasterSGIX()
return void
category SGIX_flush_raster
version 1.0
dlflags notlistable
glxflags SGI
glxvendorpriv 4105
extension
glsopcode 0x0180
offset 469
###############################################################################
#
# Extension #62 - GLX_SGIX_cushion
#
###############################################################################
###############################################################################
#
# Extension #63
# SGIX_depth_texture commands
#
###############################################################################
# (none)
newcategory: SGIX_depth_texture
###############################################################################
#
# Extension #64
# SGIS_fog_function commands
#
###############################################################################
FogFuncSGIS(n, points)
return void
param n SizeI in value
param points Float32 in array [n*2]
category SGIS_fog_function
version 1.1
glxflags SGI
glxropcode 2067
extension
glsopcode 0x0179
offset
# Need to insert GLX information
GetFogFuncSGIS(points)
return void
param points Float32 out array [COMPSIZE()]
category SGIS_fog_function
version 1.1
dlflags notlistable
glxflags ignore
extension
glsflags get
glsopcode 0x0191
offset
###############################################################################
#
# Extension #65
# SGIX_fog_offset commands
#
###############################################################################
# (none)
newcategory: SGIX_fog_offset
###############################################################################
#
# Extension #66
# HP_image_transform commands
#
###############################################################################
ImageTransformParameteriHP(target, pname, param)
return void
param target ImageTransformTargetHP in value
param pname ImageTransformPNameHP in value
param param Int32 in value
category HP_image_transform
version 1.1
glxropcode ?
glsflags ignore
offset ?
ImageTransformParameterfHP(target, pname, param)
return void
param target ImageTransformTargetHP in value
param pname ImageTransformPNameHP in value
param param Float32 in value
category HP_image_transform
version 1.1
glxropcode ?
glsflags ignore
offset ?
ImageTransformParameterivHP(target, pname, params)
return void
param target ImageTransformTargetHP in value
param pname ImageTransformPNameHP in value
param params Int32 in array [COMPSIZE(pname)]
category HP_image_transform
version 1.1
glxropcode ?
glsflags ignore
offset ?
ImageTransformParameterfvHP(target, pname, params)
return void
param target ImageTransformTargetHP in value
param pname ImageTransformPNameHP in value
param params Float32 in array [COMPSIZE(pname)]
category HP_image_transform
version 1.1
glxropcode ?
glsflags ignore
offset ?
GetImageTransformParameterivHP(target, pname, params)
return void
param target ImageTransformTargetHP in value
param pname ImageTransformPNameHP in value
param params Int32 out array [COMPSIZE(pname)]
dlflags notlistable
category HP_image_transform
version 1.1
glxropcode ?
glsflags ignore
offset ?
GetImageTransformParameterfvHP(target, pname, params)
return void
param target ImageTransformTargetHP in value
param pname ImageTransformPNameHP in value
param params Float32 out array [COMPSIZE(pname)]
category HP_image_transform
version 1.1
glxropcode ?
glsflags ignore
offset ?
###############################################################################
#
# Extension #67
# HP_convolution_border_modes commands
#
###############################################################################
# (none)
newcategory: HP_convolution_border_modes
###############################################################################
#
# Extension #68
# INGR_palette_buffer commands
#
###############################################################################
#@ (Intergraph hasn't provided a spec)
###############################################################################
#
# Extension #69
# SGIX_texture_add_env commands
#
###############################################################################
# (none)
newcategory: SGIX_texture_add_env
###############################################################################
#
# Extension #70 - skipped
# Extension #71 - skipped
# Extension #72 - skipped
# Extension #73 - skipped
#
###############################################################################
###############################################################################
#
# Extension #74
# EXT_color_subtable commands
#
# This was probably never actually shipped as an EXT - just written up as a
# reference for OpenGL 1.2 ARB_imaging.
#
###############################################################################
ColorSubTableEXT(target, start, count, format, type, data)
return void
param target ColorTableTarget in value
param start SizeI in value
param count SizeI in value
param format PixelFormat in value
param type PixelType in value
param data Void in array [COMPSIZE(format/type/count)]
category EXT_color_subtable
version 1.2
alias ColorSubTable
glsalias ColorSubTable
CopyColorSubTableEXT(target, start, x, y, width)
return void
param target ColorTableTarget in value
param start SizeI in value
param x WinCoord in value
param y WinCoord in value
param width SizeI in value
category EXT_color_subtable
version 1.2
alias CopyColorSubTable
glsalias CopyColorSubTable
###############################################################################
#
# Extension #75 - GLU_EXT_object_space_tess
#
###############################################################################
###############################################################################
#
# Extension #76
# PGI_vertex_hints commands
#
###############################################################################
# (none)
newcategory: PGI_vertex_hints
###############################################################################
#
# Extension #77
# PGI_misc_hints commands
#
###############################################################################
HintPGI(target, mode)
return void
param target HintTargetPGI in value
param mode Int32 in value
category PGI_misc_hints
version 1.1
offset 544
glsopcode 0x01D0
###############################################################################
#
# Extension #78
# EXT_paletted_texture commands
#
###############################################################################
ColorTableEXT(target, internalFormat, width, format, type, table)
return void
param target ColorTableTarget in value
param internalFormat PixelInternalFormat in value
param width SizeI in value
param format PixelFormat in value
param type PixelType in value
param table Void in array [COMPSIZE(format/type/width)]
category EXT_paletted_texture
version 1.1
alias ColorTable
glsalias ColorTable
GetColorTableEXT(target, format, type, data)
return void
param target ColorTableTarget in value
param format PixelFormat in value
param type PixelType in value
param data Void out array [COMPSIZE(target/format/type)]
category EXT_paletted_texture
version 1.1
offset 550
glsalias GetColorTable
GetColorTableParameterivEXT(target, pname, params)
return void
param target ColorTableTarget in value
param pname GetColorTableParameterPName in value
param params Int32 out array [COMPSIZE(pname)]
category EXT_paletted_texture
version 1.1
offset 551
glsalias GetColorTableParameteriv
GetColorTableParameterfvEXT(target, pname, params)
return void
param target ColorTableTarget in value
param pname GetColorTableParameterPName in value
param params Float32 out array [COMPSIZE(pname)]
category EXT_paletted_texture
version 1.1
offset 552
glsalias GetColorTableParameterfv
###############################################################################
#
# Extension #79
# EXT_clip_volume_hint commands
#
###############################################################################
# (none)
newcategory: EXT_clip_volume_hint
###############################################################################
#
# Extension #80
# SGIX_list_priority commands
#
###############################################################################
# @@@ Needs vendorpriv opcodes assigned
GetListParameterfvSGIX(list, pname, params)
return void
param list List in value
param pname ListParameterName in value
param params CheckedFloat32 out array [COMPSIZE(pname)]
dlflags notlistable
glxflags ignore
category SGIX_list_priority
version 1.0
glxvendorpriv ?
extension
glsopcode 0x0188
offset 470
# @@@ Needs vendorpriv opcodes assigned
GetListParameterivSGIX(list, pname, params)
return void
param list List in value
param pname ListParameterName in value
param params CheckedInt32 out array [COMPSIZE(pname)]
dlflags notlistable
glxflags ignore
category SGIX_list_priority
version 1.0
glxvendorpriv ?
extension
glsopcode 0x0189
offset 471
ListParameterfSGIX(list, pname, param)
return void
param list List in value
param pname ListParameterName in value
param param CheckedFloat32 in value
dlflags notlistable
glxflags ignore
category SGIX_list_priority
version 1.0
glxropcode 2078
extension
glsopcode 0x018A
offset 472
ListParameterfvSGIX(list, pname, params)
return void
param list List in value
param pname ListParameterName in value
param params CheckedFloat32 in array [COMPSIZE(pname)]
dlflags notlistable
glxflags ignore
category SGIX_list_priority
version 1.0
glxropcode 2079
extension
glsopcode 0x018B
offset 473
ListParameteriSGIX(list, pname, param)
return void
param list List in value
param pname ListParameterName in value
param param CheckedInt32 in value
dlflags notlistable
glxflags ignore
category SGIX_list_priority
version 1.0
glxropcode 2080
extension
glsopcode 0x018C
offset 474
ListParameterivSGIX(list, pname, params)
return void
param list List in value
param pname ListParameterName in value
param params CheckedInt32 in array [COMPSIZE(pname)]
dlflags notlistable
glxflags ignore
category SGIX_list_priority
version 1.0
glxropcode 2081
extension
glsopcode 0x018D
offset 475
###############################################################################
#
# Extension #81
# SGIX_ir_instrument1 commands
#
###############################################################################
# (none)
newcategory: SGIX_ir_instrument1
###############################################################################
#
# Extension #82
# SGIX_calligraphic_fragment commands
#
###############################################################################
# (none)
newcategory: SGIX_calligraphic_fragment
###############################################################################
#
# Extension #83 - GLX_SGIX_video_resize
#
###############################################################################
###############################################################################
#
# Extension #84
# SGIX_texture_lod_bias commands
#
###############################################################################
# (none)
newcategory: SGIX_texture_lod_bias
###############################################################################
#
# Extension #85 - skipped
# Extension #86 - GLX_SGIX_dmbuffer
# Extension #87 - skipped
# Extension #88 - skipped
# Extension #89 - skipped
#
###############################################################################
###############################################################################
#
# Extension #90
# SGIX_shadow_ambient commands
#
###############################################################################
# (none)
newcategory: SGIX_shadow_ambient
###############################################################################
#
# Extension #91 - GLX_SGIX_swap_group
# Extension #92 - GLX_SGIX_swap_barrier
#
###############################################################################
###############################################################################
#
# Extension #93
# EXT_index_texture commands
#
###############################################################################
# (none)
newcategory: EXT_index_texture
###############################################################################
#
# Extension #94
# EXT_index_material commands
#
###############################################################################
IndexMaterialEXT(face, mode)
return void
param face MaterialFace in value
param mode IndexMaterialParameterEXT in value
category EXT_index_material
version 1.1
extension soft
glxflags ignore
glsopcode 0x01D1
offset 538
###############################################################################
#
# Extension #95
# EXT_index_func commands
#
###############################################################################
IndexFuncEXT(func, ref)
return void
param func IndexFunctionEXT in value
param ref ClampedFloat32 in value
category EXT_index_func
version 1.1
extension soft
glxflags ignore
glsopcode 0x01D2
offset 539
###############################################################################
#
# Extension #96
# EXT_index_array_formats commands
#
###############################################################################
# (none)
newcategory: EXT_index_array_formats
###############################################################################
#
# Extension #97
# EXT_compiled_vertex_array commands
#
###############################################################################
LockArraysEXT(first, count)
return void
param first Int32 in value
param count SizeI in value
category EXT_compiled_vertex_array
version 1.1
dlflags notlistable
extension soft
glxflags ignore
glsopcode 0x01D3
offset 540
UnlockArraysEXT()
return void
category EXT_compiled_vertex_array
version 1.1
dlflags notlistable
extension soft
glxflags ignore
glsopcode 0x01D4
offset 541
###############################################################################
#
# Extension #98
# EXT_cull_vertex commands
#
###############################################################################
CullParameterdvEXT(pname, params)
return void
param pname CullParameterEXT in value
param params Float64 out array [4]
category EXT_cull_vertex
version 1.1
dlflags notlistable
extension soft
glxflags ignore
glsopcode 0x01D5
offset 542
CullParameterfvEXT(pname, params)
return void
param pname CullParameterEXT in value
param params Float32 out array [4]
category EXT_cull_vertex
version 1.1
dlflags notlistable
extension soft
glxflags ignore
glsopcode 0x01D6
offset 543
###############################################################################
#
# Extension #99 - skipped
# Extension #100 - GLU_EXT_nurbs_tessellator
#
###############################################################################
###############################################################################
#
# Extension #101
# SGIX_ycrcb commands
#
###############################################################################
# (none)
newcategory: SGIX_ycrcb
###############################################################################
#
# Extension #102
# SGIX_fragment_lighting commands
#
###############################################################################
FragmentColorMaterialSGIX(face, mode)
return void
param face MaterialFace in value
param mode MaterialParameter in value
category SGIX_fragment_lighting
glxflags ignore
version 1.0
extension
glsopcode 0x019E
offset 476
FragmentLightfSGIX(light, pname, param)
return void
param light FragmentLightNameSGIX in value
param pname FragmentLightParameterSGIX in value
param param CheckedFloat32 in value
category SGIX_fragment_lighting
glxflags ignore
version 1.0
extension
glsopcode 0x019F
offset 477
FragmentLightfvSGIX(light, pname, params)
return void
param light FragmentLightNameSGIX in value
param pname FragmentLightParameterSGIX in value
param params CheckedFloat32 in array [COMPSIZE(pname)]
category SGIX_fragment_lighting
glxflags ignore
version 1.0
extension
glsopcode 0x01A0
offset 478
FragmentLightiSGIX(light, pname, param)
return void
param light FragmentLightNameSGIX in value
param pname FragmentLightParameterSGIX in value
param param CheckedInt32 in value
category SGIX_fragment_lighting
glxflags ignore
version 1.0
extension
glsopcode 0x01A1
offset 479
FragmentLightivSGIX(light, pname, params)
return void
param light FragmentLightNameSGIX in value
param pname FragmentLightParameterSGIX in value
param params CheckedInt32 in array [COMPSIZE(pname)]
category SGIX_fragment_lighting
glxflags ignore
version 1.0
extension
glsopcode 0x01A2
offset 480
FragmentLightModelfSGIX(pname, param)
return void
param pname FragmentLightModelParameterSGIX in value
param param CheckedFloat32 in value
category SGIX_fragment_lighting
glxflags ignore
version 1.0
extension
glsflags gl-enum
glsopcode 0x01A3
offset 481
FragmentLightModelfvSGIX(pname, params)
return void
param pname FragmentLightModelParameterSGIX in value
param params CheckedFloat32 in array [COMPSIZE(pname)]
category SGIX_fragment_lighting
glxflags ignore
version 1.0
extension
glsflags gl-enum
glsopcode 0x01A4
offset 482
FragmentLightModeliSGIX(pname, param)
return void
param pname FragmentLightModelParameterSGIX in value
param param CheckedInt32 in value
category SGIX_fragment_lighting
glxflags ignore
version 1.0
extension
glsflags gl-enum
glsopcode 0x01A5
offset 483
FragmentLightModelivSGIX(pname, params)
return void
param pname FragmentLightModelParameterSGIX in value
param params CheckedInt32 in array [COMPSIZE(pname)]
category SGIX_fragment_lighting
glxflags ignore
version 1.0
extension
glsflags gl-enum
glsopcode 0x01A6
offset 484
FragmentMaterialfSGIX(face, pname, param)
return void
param face MaterialFace in value
param pname MaterialParameter in value
param param CheckedFloat32 in value
category SGIX_fragment_lighting
glxflags ignore
version 1.0
extension
glsopcode 0x01A7
offset 485
FragmentMaterialfvSGIX(face, pname, params)
return void
param face MaterialFace in value
param pname MaterialParameter in value
param params CheckedFloat32 in array [COMPSIZE(pname)]
category SGIX_fragment_lighting
glxflags ignore
version 1.0
extension
glsopcode 0x01A8
offset 486
FragmentMaterialiSGIX(face, pname, param)
return void
param face MaterialFace in value
param pname MaterialParameter in value
param param CheckedInt32 in value
category SGIX_fragment_lighting
glxflags ignore
version 1.0
extension
glsopcode 0x01A9
offset 487
FragmentMaterialivSGIX(face, pname, params)
return void
param face MaterialFace in value
param pname MaterialParameter in value
param params CheckedInt32 in array [COMPSIZE(pname)]
category SGIX_fragment_lighting
glxflags ignore
version 1.0
extension
glsopcode 0x01AA
offset 488
GetFragmentLightfvSGIX(light, pname, params)
return void
param light FragmentLightNameSGIX in value
param pname FragmentLightParameterSGIX in value
param params Float32 out array [COMPSIZE(pname)]
category SGIX_fragment_lighting
dlflags notlistable
glxflags ignore
version 1.0
extension
glsflags get
glsopcode 0x01AB
offset 489
GetFragmentLightivSGIX(light, pname, params)
return void
param light FragmentLightNameSGIX in value
param pname FragmentLightParameterSGIX in value
param params Int32 out array [COMPSIZE(pname)]
category SGIX_fragment_lighting
dlflags notlistable
glxflags ignore
version 1.0
extension
glsflags get
glsopcode 0x01AC
offset 490
GetFragmentMaterialfvSGIX(face, pname, params)
return void
param face MaterialFace in value
param pname MaterialParameter in value
param params Float32 out array [COMPSIZE(pname)]
category SGIX_fragment_lighting
dlflags notlistable
glxflags ignore
version 1.0
extension
glsflags get
glsopcode 0x01AD
offset 491
GetFragmentMaterialivSGIX(face, pname, params)
return void
param face MaterialFace in value
param pname MaterialParameter in value
param params Int32 out array [COMPSIZE(pname)]
category SGIX_fragment_lighting
dlflags notlistable
glxflags ignore
version 1.0
extension
glsflags get
glsopcode 0x01AE
offset 492
LightEnviSGIX(pname, param)
return void
param pname LightEnvParameterSGIX in value
param param CheckedInt32 in value
category SGIX_fragment_lighting
glxflags ignore
version 1.0
extension
glsflags gl-enum
glsopcode 0x01AF
offset 493
###############################################################################
#
# Extension #103 - skipped
# Extension #104 - skipped
# Extension #105 - skipped
# Extension #106 - skipped
# Extension #107 - skipped
# Extension #108 - skipped
# Extension #109 - skipped
#
###############################################################################
###############################################################################
#
# Extension #110
# IBM_rasterpos_clip commands
#
###############################################################################
# (none)
newcategory: IBM_rasterpos_clip
###############################################################################
#
# Extension #111
# HP_texture_lighting commands
#
###############################################################################
# (none)
newcategory: HP_texture_lighting
###############################################################################
#
# Extension #112
# EXT_draw_range_elements commands
#
###############################################################################
# Spec entries to be written
DrawRangeElementsEXT(mode, start, end, count, type, indices)
return void
param mode BeginMode in value
param start UInt32 in value
param end UInt32 in value
param count SizeI in value
param type DrawElementsType in value
param indices Void in array [COMPSIZE(count/type)]
category EXT_draw_range_elements
dlflags handcode
glxflags client-handcode client-intercept server-handcode
version 1.1
alias DrawRangeElements
glsalias DrawRangeElements
###############################################################################
#
# Extension #113
# WIN_phong_shading commands
#
###############################################################################
# (none)
newcategory: WIN_phong_shading
###############################################################################
#
# Extension #114
# WIN_specular_fog commands
#
###############################################################################
# (none)
newcategory: WIN_specular_fog
###############################################################################
#
# Extension #115 - skipped
# Extension #116 - skipped
#
###############################################################################
###############################################################################
#
# Extension #117
# EXT_light_texture commands
#
###############################################################################
# Spec entries to be written
ApplyTextureEXT(mode)
return void
param mode LightTextureModeEXT in value
category EXT_light_texture
version 1.1
glxropcode ?
glsflags ignore
offset ?
TextureLightEXT(pname)
return void
param pname LightTexturePNameEXT in value
category EXT_light_texture
version 1.1
glxropcode ?
glsflags ignore
offset ?
TextureMaterialEXT(face, mode)
return void
param face MaterialFace in value
param mode MaterialParameter in value
category EXT_light_texture
version 1.1
glxropcode ?
glsflags ignore
offset ?
###############################################################################
#
# Extension #118 - skipped
#
###############################################################################
###############################################################################
#
# Extension #119
# SGIX_blend_alpha_minmax commands
#
###############################################################################
# (none)
newcategory: SGIX_blend_alpha_minmax
###############################################################################
#
# Extension #120 - skipped
# Extension #121 - skipped
# Extension #122 - skipped
# Extension #123 - skipped
# Extension #124 - skipped
# Extension #125 - skipped
# Extension #126 - skipped
# Extension #127 - skipped
# Extension #128 - skipped
#
###############################################################################
###############################################################################
#
# Extension #129
# EXT_bgra commands
#
###############################################################################
# (none)
newcategory: EXT_bgra
###############################################################################
#
# Extension #130 - skipped
# Extension #131 - skipped
#
###############################################################################
###############################################################################
#
# Extension #132
# SGIX_async commands
#
###############################################################################
AsyncMarkerSGIX(marker)
return void
param marker UInt32 in value
category SGIX_async
version 1.0
glxflags ignore
extension
glsopcode 0x0198
offset ?
FinishAsyncSGIX(markerp)
return Int32
param markerp UInt32 out array [1]
category SGIX_async
version 1.0
dlflags notlistable
glxflags ignore
extension
glsopcode 0x0199
offset ?
PollAsyncSGIX(markerp)
return Int32
param markerp UInt32 out array [1]
category SGIX_async
version 1.0
dlflags notlistable
glxflags ignore
extension
glsopcode 0x019A
offset ?
GenAsyncMarkersSGIX(range)
return UInt32
param range SizeI in value
category SGIX_async
version 1.0
dlflags notlistable
glxflags ignore
extension
glsopcode 0x019B
offset ?
DeleteAsyncMarkersSGIX(marker, range)
return void
param marker UInt32 in value
param range SizeI in value
category SGIX_async
version 1.0
dlflags notlistable
glxflags ignore
extension
glsopcode 0x019C
offset ?
IsAsyncMarkerSGIX(marker)
return Boolean
param marker UInt32 in value
category SGIX_async
version 1.0
dlflags notlistable
glxflags ignore
extension
glsopcode 0x019D
offset ?
###############################################################################
#
# Extension #133
# SGIX_async_pixel commands
#
###############################################################################
# (none)
newcategory: SGIX_async_pixel
###############################################################################
#
# Extension #134
# SGIX_async_histogram commands
#
###############################################################################
# (none)
newcategory: SGIX_async_histogram
###############################################################################
#
# Extension #135 - skipped (INTEL_texture_scissor was never implemented)
#
###############################################################################
###############################################################################
#
# Extension #136
# INTEL_parallel_arrays commands
#
###############################################################################
VertexPointervINTEL(size, type, pointer)
return void
param size Int32 in value
param type VertexPointerType in value
param pointer VoidPointer in array [4] retained
category INTEL_parallel_arrays
dlflags notlistable
glxflags client-handcode server-handcode EXT
version 1.1
glsflags ignore client
offset ?
NormalPointervINTEL(type, pointer)
return void
param type NormalPointerType in value
param pointer VoidPointer in array [4] retained
category INTEL_parallel_arrays
dlflags notlistable
glxflags client-handcode server-handcode EXT
version 1.1
glsflags ignore client
offset ?
ColorPointervINTEL(size, type, pointer)
return void
param size Int32 in value
param type VertexPointerType in value
param pointer VoidPointer in array [4] retained
category INTEL_parallel_arrays
dlflags notlistable
glxflags client-handcode server-handcode EXT
version 1.1
glsflags ignore client
offset ?
TexCoordPointervINTEL(size, type, pointer)
return void
param size Int32 in value
param type VertexPointerType in value
param pointer VoidPointer in array [4] retained
category INTEL_parallel_arrays
dlflags notlistable
glxflags client-handcode server-handcode EXT
version 1.1
glsflags ignore client
offset ?
###############################################################################
#
# Extension #137
# HP_occlusion_test commands
#
###############################################################################
# (none)
newcategory: HP_occlusion_test
###############################################################################
#
# Extension #138
# EXT_pixel_transform commands
#
###############################################################################
PixelTransformParameteriEXT(target, pname, param)
return void
param target PixelTransformTargetEXT in value
param pname PixelTransformPNameEXT in value
param param Int32 in value
category EXT_pixel_transform
version 1.1
glxropcode ?
glsflags ignore
offset ?
PixelTransformParameterfEXT(target, pname, param)
return void
param target PixelTransformTargetEXT in value
param pname PixelTransformPNameEXT in value
param param Float32 in value
category EXT_pixel_transform
version 1.1
glxropcode ?
glsflags ignore
offset ?
PixelTransformParameterivEXT(target, pname, params)
return void
param target PixelTransformTargetEXT in value
param pname PixelTransformPNameEXT in value
param params Int32 in array [1]
category EXT_pixel_transform
version 1.1
glxropcode ?
glsflags ignore
offset ?
PixelTransformParameterfvEXT(target, pname, params)
return void
param target PixelTransformTargetEXT in value
param pname PixelTransformPNameEXT in value
param params Float32 in array [1]
category EXT_pixel_transform
version 1.1
glxropcode ?
glsflags ignore
offset ?
###############################################################################
#
# Extension #139
# EXT_pixel_transform_color_table commands
#
###############################################################################
# (none)
newcategory: EXT_pixel_transform_color_table
###############################################################################
#
# Extension #140 - skipped
#
###############################################################################
###############################################################################
#
# Extension #141
# EXT_shared_texture_palette commands
#
###############################################################################
# (none)
newcategory: EXT_shared_texture_palette
###############################################################################
#
# Extension #142 - GLX_SGIS_blended_overlay
# Extension #143 - GLX_SGIS_shared_multisample
#
###############################################################################
###############################################################################
#
# Extension #144
# EXT_separate_specular_color commands
#
###############################################################################
# (none)
newcategory: EXT_separate_specular_color
###############################################################################
#
# Extension #145
# EXT_secondary_color commands
#
###############################################################################
SecondaryColor3bEXT(red, green, blue)
return void
param red ColorB in value
param green ColorB in value
param blue ColorB in value
category EXT_secondary_color
vectorequiv SecondaryColor3bvEXT
version 1.1
alias SecondaryColor3b
glsalias SecondaryColor3b
SecondaryColor3bvEXT(v)
return void
param v ColorB in array [3]
category EXT_secondary_color
version 1.1
glxropcode 4126
alias SecondaryColor3bv
glsalias SecondaryColor3bv
SecondaryColor3dEXT(red, green, blue)
return void
param red ColorD in value
param green ColorD in value
param blue ColorD in value
category EXT_secondary_color
vectorequiv SecondaryColor3dvEXT
version 1.1
alias SecondaryColor3d
glsalias SecondaryColor3d
SecondaryColor3dvEXT(v)
return void
param v ColorD in array [3]
category EXT_secondary_color
version 1.1
glxropcode 4130
alias SecondaryColor3dv
glsalias SecondaryColor3dv
SecondaryColor3fEXT(red, green, blue)
return void
param red ColorF in value
param green ColorF in value
param blue ColorF in value
category EXT_secondary_color
vectorequiv SecondaryColor3fvEXT
version 1.1
alias SecondaryColor3f
glsalias SecondaryColor3f
SecondaryColor3fvEXT(v)
return void
param v ColorF in array [3]
category EXT_secondary_color
version 1.1
glxropcode 4129
alias SecondaryColor3fv
glsalias SecondaryColor3fv
SecondaryColor3iEXT(red, green, blue)
return void
param red ColorI in value
param green ColorI in value
param blue ColorI in value
category EXT_secondary_color
vectorequiv SecondaryColor3ivEXT
version 1.1
alias SecondaryColor3i
glsalias SecondaryColor3i
SecondaryColor3ivEXT(v)
return void
param v ColorI in array [3]
category EXT_secondary_color
version 1.1
glxropcode 4128
glsopcode 0x0200
offset 568
alias SecondaryColor3iv
glsalias SecondaryColor3iv
SecondaryColor3sEXT(red, green, blue)
return void
param red ColorS in value
param green ColorS in value
param blue ColorS in value
category EXT_secondary_color
vectorequiv SecondaryColor3svEXT
version 1.1
alias SecondaryColor3s
glsalias SecondaryColor3s
SecondaryColor3svEXT(v)
return void
param v ColorS in array [3]
category EXT_secondary_color
version 1.1
glxropcode 4127
alias SecondaryColor3sv
glsalias SecondaryColor3sv
SecondaryColor3ubEXT(red, green, blue)
return void
param red ColorUB in value
param green ColorUB in value
param blue ColorUB in value
category EXT_secondary_color
vectorequiv SecondaryColor3ubvEXT
version 1.1
alias SecondaryColor3ub
glsalias SecondaryColor3ub
SecondaryColor3ubvEXT(v)
return void
param v ColorUB in array [3]
category EXT_secondary_color
version 1.1
glxropcode 4131
alias SecondaryColor3ubv
glsalias SecondaryColor3ubv
SecondaryColor3uiEXT(red, green, blue)
return void
param red ColorUI in value
param green ColorUI in value
param blue ColorUI in value
category EXT_secondary_color
vectorequiv SecondaryColor3uivEXT
version 1.1
alias SecondaryColor3ui
glsalias SecondaryColor3ui
SecondaryColor3uivEXT(v)
return void
param v ColorUI in array [3]
category EXT_secondary_color
version 1.1
glxropcode 4133
alias SecondaryColor3uiv
glsalias SecondaryColor3uiv
SecondaryColor3usEXT(red, green, blue)
return void
param red ColorUS in value
param green ColorUS in value
param blue ColorUS in value
category EXT_secondary_color
vectorequiv SecondaryColor3usvEXT
version 1.1
alias SecondaryColor3us
glsalias SecondaryColor3us
SecondaryColor3usvEXT(v)
return void
param v ColorUS in array [3]
category EXT_secondary_color
version 1.1
glxropcode 4132
alias SecondaryColor3usv
glsalias SecondaryColor3usv
SecondaryColorPointerEXT(size, type, stride, pointer)
return void
param size Int32 in value
param type ColorPointerType in value
param stride SizeI in value
param pointer Void in array [COMPSIZE(size/type/stride)] retained
category EXT_secondary_color
dlflags notlistable
glxflags client-handcode server-handcode EXT
version 1.1
extension
alias SecondaryColorPointer
glsalias SecondaryColorPointer
###############################################################################
#
# Extension #146
# EXT_texture_env commands
#
###############################################################################
# Dead extension - never implemented (removed from registry!)
# (none)
# newcategory: EXT_texture_env
###############################################################################
#
# Extension #147
# EXT_texture_perturb_normal commands
#
###############################################################################
TextureNormalEXT(mode)
return void
param mode TextureNormalModeEXT in value
category EXT_texture_perturb_normal
version 1.1
glxropcode ?
glsflags ignore
offset ?
###############################################################################
#
# Extension #148
# EXT_multi_draw_arrays commands
#
###############################################################################
# first and count are really 'in'
MultiDrawArraysEXT(mode, first, count, primcount)
return void
param mode BeginMode in value
param first Int32 out array [COMPSIZE(primcount)]
param count SizeI out array [COMPSIZE(primcount)]
param primcount SizeI in value
category EXT_multi_draw_arrays
version 1.1
glxropcode ?
alias MultiDrawArrays
glsalias MultiDrawArrays
MultiDrawElementsEXT(mode, count, type, indices, primcount)
return void
param mode BeginMode in value
param count SizeI in array [COMPSIZE(primcount)]
param type DrawElementsType in value
param indices VoidPointer in array [COMPSIZE(primcount)]
param primcount SizeI in value
category EXT_multi_draw_arrays
version 1.1
glxropcode ?
alias MultiDrawElements
glsalias MultiDrawElements
###############################################################################
#
# Extension #149
# EXT_fog_coord commands
#
###############################################################################
FogCoordfEXT(coord)
return void
param coord CoordF in value
category EXT_fog_coord
vectorequiv FogCoordfvEXT
version 1.1
alias FogCoordf
glsalias FogCoordf
FogCoordfvEXT(coord)
return void
param coord CoordF in array [1]
category EXT_fog_coord
version 1.1
glxropcode 4124
alias FogCoordfv
glsalias FogCoordfv
FogCoorddEXT(coord)
return void
param coord CoordD in value
category EXT_fog_coord
vectorequiv FogCoorddvEXT
version 1.1
alias FogCoordd
glsalias FogCoordd
FogCoorddvEXT(coord)
return void
param coord CoordD in array [1]
category EXT_fog_coord
version 1.1
glxropcode 4125
alias FogCoorddv
glsalias FogCoorddv
FogCoordPointerEXT(type, stride, pointer)
return void
param type FogPointerTypeEXT in value
param stride SizeI in value
param pointer Void in array [COMPSIZE(type/stride)] retained
category EXT_fog_coord
dlflags notlistable
version 1.1
glxflags client-handcode server-handcode EXT
alias FogCoordPointer
glsalias FogCoordPointer
###############################################################################
#
# Extension #150 - skipped
# Extension #151 - skipped
# Extension #152 - skipped
# Extension #153 - skipped
# Extension #154 - skipped
#
###############################################################################
###############################################################################
#
# Extension #155
# REND_screen_coordinates commands
#
###############################################################################
# (none)
newcategory: REND_screen_coordinates
###############################################################################
#
# Extension #156
# EXT_coordinate_frame commands
#
###############################################################################
Tangent3bEXT(tx, ty, tz)
return void
param tx Int8 in value
param ty Int8 in value
param tz Int8 in value
category EXT_coordinate_frame
vectorequiv Tangent3bvEXT
version 1.1
glsflags ignore
offset ?
Tangent3bvEXT(v)
return void
param v Int8 in array [3]
category EXT_coordinate_frame
version 1.1
glxropcode ?
glsflags ignore
offset ?
Tangent3dEXT(tx, ty, tz)
return void
param tx CoordD in value
param ty CoordD in value
param tz CoordD in value
category EXT_coordinate_frame
vectorequiv Tangent3dvEXT
version 1.1
glsflags ignore
offset ?
Tangent3dvEXT(v)
return void
param v CoordD in array [3]
category EXT_coordinate_frame
version 1.1
glxropcode ?
glsflags ignore
offset ?
Tangent3fEXT(tx, ty, tz)
return void
param tx CoordF in value
param ty CoordF in value
param tz CoordF in value
category EXT_coordinate_frame
vectorequiv Tangent3fvEXT
version 1.1
glsflags ignore
offset ?
Tangent3fvEXT(v)
return void
param v CoordF in array [3]
category EXT_coordinate_frame
version 1.1
glxropcode ?
glsflags ignore
offset ?
Tangent3iEXT(tx, ty, tz)
return void
param tx Int32 in value
param ty Int32 in value
param tz Int32 in value
category EXT_coordinate_frame
vectorequiv Tangent3ivEXT
version 1.1
glsflags ignore
offset ?
Tangent3ivEXT(v)
return void
param v Int32 in array [3]
category EXT_coordinate_frame
version 1.1
glxropcode ?
glsflags ignore
offset ?
Tangent3sEXT(tx, ty, tz)
return void
param tx Int16 in value
param ty Int16 in value
param tz Int16 in value
category EXT_coordinate_frame
vectorequiv Tangent3svEXT
version 1.1
glsflags ignore
offset ?
Tangent3svEXT(v)
return void
param v Int16 in array [3]
category EXT_coordinate_frame
version 1.1
glxropcode ?
glsflags ignore
offset ?
Binormal3bEXT(bx, by, bz)
return void
param bx Int8 in value
param by Int8 in value
param bz Int8 in value
category EXT_coordinate_frame
vectorequiv Binormal3bvEXT
version 1.1
glsflags ignore
offset ?
Binormal3bvEXT(v)
return void
param v Int8 in array [3]
category EXT_coordinate_frame
version 1.1
glxropcode ?
glsflags ignore
offset ?
Binormal3dEXT(bx, by, bz)
return void
param bx CoordD in value
param by CoordD in value
param bz CoordD in value
category EXT_coordinate_frame
vectorequiv Binormal3dvEXT
version 1.1
glsflags ignore
offset ?
Binormal3dvEXT(v)
return void
param v CoordD in array [3]
category EXT_coordinate_frame
version 1.1
glxropcode ?
glsflags ignore
offset ?
Binormal3fEXT(bx, by, bz)
return void
param bx CoordF in value
param by CoordF in value
param bz CoordF in value
category EXT_coordinate_frame
vectorequiv Binormal3fvEXT
version 1.1
glsflags ignore
offset ?
Binormal3fvEXT(v)
return void
param v CoordF in array [3]
category EXT_coordinate_frame
version 1.1
glxropcode ?
glsflags ignore
offset ?
Binormal3iEXT(bx, by, bz)
return void
param bx Int32 in value
param by Int32 in value
param bz Int32 in value
category EXT_coordinate_frame
vectorequiv Binormal3ivEXT
version 1.1
glsflags ignore
offset ?
Binormal3ivEXT(v)
return void
param v Int32 in array [3]
category EXT_coordinate_frame
version 1.1
glxropcode ?
glsflags ignore
offset ?
Binormal3sEXT(bx, by, bz)
return void
param bx Int16 in value
param by Int16 in value
param bz Int16 in value
category EXT_coordinate_frame
vectorequiv Binormal3svEXT
version 1.1
glsflags ignore
offset ?
Binormal3svEXT(v)
return void
param v Int16 in array [3]
category EXT_coordinate_frame
version 1.1
glxropcode ?
glsflags ignore
offset ?
TangentPointerEXT(type, stride, pointer)
return void
param type TangentPointerTypeEXT in value
param stride SizeI in value
param pointer Void in array [COMPSIZE(type/stride)] retained
category EXT_coordinate_frame
dlflags notlistable
glxflags client-handcode client-intercept server-handcode
version 1.1
glsflags ignore
offset ?
BinormalPointerEXT(type, stride, pointer)
return void
param type BinormalPointerTypeEXT in value
param stride SizeI in value
param pointer Void in array [COMPSIZE(type/stride)] retained
category EXT_coordinate_frame
dlflags notlistable
glxflags client-handcode client-intercept server-handcode
version 1.1
glsflags ignore
offset ?
###############################################################################
#
# Extension #157 - skipped
#
###############################################################################
###############################################################################
#
# Extension #158
# EXT_texture_env_combine commands
#
###############################################################################
# (none)
newcategory: EXT_texture_env_combine
###############################################################################
#
# Extension #159
# APPLE_specular_vector commands
#
###############################################################################
# (none)
newcategory: APPLE_specular_vector
###############################################################################
#
# Extension #160
# APPLE_transform_hint commands
#
###############################################################################
# (none)
newcategory: APPLE_transform_hint
###############################################################################
#
# Extension #161
# SGIX_fog_scale commands
#
###############################################################################
# (none)
newcategory: SGIX_fog_scale
###############################################################################
#
# Extension #162 - skipped
#
###############################################################################
###############################################################################
#
# Extension #163
# SUNX_constant_data commands
#
###############################################################################
FinishTextureSUNX()
return void
category SUNX_constant_data
version 1.1
glxropcode ?
glsflags ignore
offset ?
###############################################################################
#
# Extension #164
# SUN_global_alpha commands
#
###############################################################################
GlobalAlphaFactorbSUN(factor)
return void
param factor Int8 in value
category SUN_global_alpha
version 1.1
glxropcode ?
glsflags ignore
offset ?
GlobalAlphaFactorsSUN(factor)
return void
param factor Int16 in value
category SUN_global_alpha
version 1.1
glxropcode ?
glsflags ignore
offset ?
GlobalAlphaFactoriSUN(factor)
return void
param factor Int32 in value
category SUN_global_alpha
version 1.1
glxropcode ?
glsflags ignore
offset ?
GlobalAlphaFactorfSUN(factor)
return void
param factor Float32 in value
category SUN_global_alpha
version 1.1
glxropcode ?
glsflags ignore
offset ?
GlobalAlphaFactordSUN(factor)
return void
param factor Float64 in value
category SUN_global_alpha
version 1.1
glxropcode ?
glsflags ignore
offset ?
GlobalAlphaFactorubSUN(factor)
return void
param factor UInt8 in value
category SUN_global_alpha
version 1.1
glxropcode ?
glsflags ignore
offset ?
GlobalAlphaFactorusSUN(factor)
return void
param factor UInt16 in value
category SUN_global_alpha
version 1.1
glxropcode ?
glsflags ignore
offset ?
GlobalAlphaFactoruiSUN(factor)
return void
param factor UInt32 in value
category SUN_global_alpha
version 1.1
glxropcode ?
glsflags ignore
offset ?
###############################################################################
#
# Extension #165
# SUN_triangle_list commands
#
###############################################################################
ReplacementCodeuiSUN(code)
return void
param code UInt32 in value
category SUN_triangle_list
version 1.1
glxropcode ?
glsflags ignore
offset ?
ReplacementCodeusSUN(code)
return void
param code UInt16 in value
category SUN_triangle_list
version 1.1
glxropcode ?
glsflags ignore
offset ?
ReplacementCodeubSUN(code)
return void
param code UInt8 in value
category SUN_triangle_list
version 1.1
glxropcode ?
glsflags ignore
offset ?
ReplacementCodeuivSUN(code)
return void
param code UInt32 in array [COMPSIZE()]
category SUN_triangle_list
version 1.1
glxropcode ?
glsflags ignore
offset ?
ReplacementCodeusvSUN(code)
return void
param code UInt16 in array [COMPSIZE()]
category SUN_triangle_list
version 1.1
glxropcode ?
glsflags ignore
offset ?
ReplacementCodeubvSUN(code)
return void
param code UInt8 in array [COMPSIZE()]
category SUN_triangle_list
version 1.1
glxropcode ?
glsflags ignore
offset ?
ReplacementCodePointerSUN(type, stride, pointer)
return void
param type ReplacementCodeTypeSUN in value
param stride SizeI in value
param pointer VoidPointer in array [COMPSIZE(type/stride)] retained
category SUN_triangle_list
version 1.1
glxropcode ?
glsflags ignore
offset ?
###############################################################################
#
# Extension #166
# SUN_vertex commands
#
###############################################################################
Color4ubVertex2fSUN(r, g, b, a, x, y)
return void
param r UInt8 in value
param g UInt8 in value
param b UInt8 in value
param a UInt8 in value
param x Float32 in value
param y Float32 in value
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
Color4ubVertex2fvSUN(c, v)
return void
param c UInt8 in array [4]
param v Float32 in array [2]
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
Color4ubVertex3fSUN(r, g, b, a, x, y, z)
return void
param r UInt8 in value
param g UInt8 in value
param b UInt8 in value
param a UInt8 in value
param x Float32 in value
param y Float32 in value
param z Float32 in value
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
Color4ubVertex3fvSUN(c, v)
return void
param c UInt8 in array [4]
param v Float32 in array [3]
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
Color3fVertex3fSUN(r, g, b, x, y, z)
return void
param r Float32 in value
param g Float32 in value
param b Float32 in value
param x Float32 in value
param y Float32 in value
param z Float32 in value
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
Color3fVertex3fvSUN(c, v)
return void
param c Float32 in array [3]
param v Float32 in array [3]
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
Normal3fVertex3fSUN(nx, ny, nz, x, y, z)
return void
param nx Float32 in value
param ny Float32 in value
param nz Float32 in value
param x Float32 in value
param y Float32 in value
param z Float32 in value
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
Normal3fVertex3fvSUN(n, v)
return void
param n Float32 in array [3]
param v Float32 in array [3]
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
Color4fNormal3fVertex3fSUN(r, g, b, a, nx, ny, nz, x, y, z)
return void
param r Float32 in value
param g Float32 in value
param b Float32 in value
param a Float32 in value
param nx Float32 in value
param ny Float32 in value
param nz Float32 in value
param x Float32 in value
param y Float32 in value
param z Float32 in value
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
Color4fNormal3fVertex3fvSUN(c, n, v)
return void
param c Float32 in array [4]
param n Float32 in array [3]
param v Float32 in array [3]
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
TexCoord2fVertex3fSUN(s, t, x, y, z)
return void
param s Float32 in value
param t Float32 in value
param x Float32 in value
param y Float32 in value
param z Float32 in value
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
TexCoord2fVertex3fvSUN(tc, v)
return void
param tc Float32 in array [2]
param v Float32 in array [3]
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
TexCoord4fVertex4fSUN(s, t, p, q, x, y, z, w)
return void
param s Float32 in value
param t Float32 in value
param p Float32 in value
param q Float32 in value
param x Float32 in value
param y Float32 in value
param z Float32 in value
param w Float32 in value
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
TexCoord4fVertex4fvSUN(tc, v)
return void
param tc Float32 in array [4]
param v Float32 in array [4]
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
TexCoord2fColor4ubVertex3fSUN(s, t, r, g, b, a, x, y, z)
return void
param s Float32 in value
param t Float32 in value
param r UInt8 in value
param g UInt8 in value
param b UInt8 in value
param a UInt8 in value
param x Float32 in value
param y Float32 in value
param z Float32 in value
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
TexCoord2fColor4ubVertex3fvSUN(tc, c, v)
return void
param tc Float32 in array [2]
param c UInt8 in array [4]
param v Float32 in array [3]
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
TexCoord2fColor3fVertex3fSUN(s, t, r, g, b, x, y, z)
return void
param s Float32 in value
param t Float32 in value
param r Float32 in value
param g Float32 in value
param b Float32 in value
param x Float32 in value
param y Float32 in value
param z Float32 in value
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
TexCoord2fColor3fVertex3fvSUN(tc, c, v)
return void
param tc Float32 in array [2]
param c Float32 in array [3]
param v Float32 in array [3]
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
TexCoord2fNormal3fVertex3fSUN(s, t, nx, ny, nz, x, y, z)
return void
param s Float32 in value
param t Float32 in value
param nx Float32 in value
param ny Float32 in value
param nz Float32 in value
param x Float32 in value
param y Float32 in value
param z Float32 in value
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
TexCoord2fNormal3fVertex3fvSUN(tc, n, v)
return void
param tc Float32 in array [2]
param n Float32 in array [3]
param v Float32 in array [3]
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
TexCoord2fColor4fNormal3fVertex3fSUN(s, t, r, g, b, a, nx, ny, nz, x, y, z)
return void
param s Float32 in value
param t Float32 in value
param r Float32 in value
param g Float32 in value
param b Float32 in value
param a Float32 in value
param nx Float32 in value
param ny Float32 in value
param nz Float32 in value
param x Float32 in value
param y Float32 in value
param z Float32 in value
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
TexCoord2fColor4fNormal3fVertex3fvSUN(tc, c, n, v)
return void
param tc Float32 in array [2]
param c Float32 in array [4]
param n Float32 in array [3]
param v Float32 in array [3]
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
TexCoord4fColor4fNormal3fVertex4fSUN(s, t, p, q, r, g, b, a, nx, ny, nz, x, y, z, w)
return void
param s Float32 in value
param t Float32 in value
param p Float32 in value
param q Float32 in value
param r Float32 in value
param g Float32 in value
param b Float32 in value
param a Float32 in value
param nx Float32 in value
param ny Float32 in value
param nz Float32 in value
param x Float32 in value
param y Float32 in value
param z Float32 in value
param w Float32 in value
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
TexCoord4fColor4fNormal3fVertex4fvSUN(tc, c, n, v)
return void
param tc Float32 in array [4]
param c Float32 in array [4]
param n Float32 in array [3]
param v Float32 in array [4]
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
ReplacementCodeuiVertex3fSUN(rc, x, y, z)
return void
param rc ReplacementCodeSUN in value
param x Float32 in value
param y Float32 in value
param z Float32 in value
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
ReplacementCodeuiVertex3fvSUN(rc, v)
return void
param rc ReplacementCodeSUN in array [1]
param v Float32 in array [3]
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
ReplacementCodeuiColor4ubVertex3fSUN(rc, r, g, b, a, x, y, z)
return void
param rc ReplacementCodeSUN in value
param r UInt8 in value
param g UInt8 in value
param b UInt8 in value
param a UInt8 in value
param x Float32 in value
param y Float32 in value
param z Float32 in value
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
ReplacementCodeuiColor4ubVertex3fvSUN(rc, c, v)
return void
param rc ReplacementCodeSUN in array [1]
param c UInt8 in array [4]
param v Float32 in array [3]
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
ReplacementCodeuiColor3fVertex3fSUN(rc, r, g, b, x, y, z)
return void
param rc ReplacementCodeSUN in value
param r Float32 in value
param g Float32 in value
param b Float32 in value
param x Float32 in value
param y Float32 in value
param z Float32 in value
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
ReplacementCodeuiColor3fVertex3fvSUN(rc, c, v)
return void
param rc ReplacementCodeSUN in array [1]
param c Float32 in array [3]
param v Float32 in array [3]
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
ReplacementCodeuiNormal3fVertex3fSUN(rc, nx, ny, nz, x, y, z)
return void
param rc ReplacementCodeSUN in value
param nx Float32 in value
param ny Float32 in value
param nz Float32 in value
param x Float32 in value
param y Float32 in value
param z Float32 in value
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
ReplacementCodeuiNormal3fVertex3fvSUN(rc, n, v)
return void
param rc ReplacementCodeSUN in array [1]
param n Float32 in array [3]
param v Float32 in array [3]
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
ReplacementCodeuiColor4fNormal3fVertex3fSUN(rc, r, g, b, a, nx, ny, nz, x, y, z)
return void
param rc ReplacementCodeSUN in value
param r Float32 in value
param g Float32 in value
param b Float32 in value
param a Float32 in value
param nx Float32 in value
param ny Float32 in value
param nz Float32 in value
param x Float32 in value
param y Float32 in value
param z Float32 in value
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
ReplacementCodeuiColor4fNormal3fVertex3fvSUN(rc, c, n, v)
return void
param rc ReplacementCodeSUN in array [1]
param c Float32 in array [4]
param n Float32 in array [3]
param v Float32 in array [3]
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
ReplacementCodeuiTexCoord2fVertex3fSUN(rc, s, t, x, y, z)
return void
param rc ReplacementCodeSUN in value
param s Float32 in value
param t Float32 in value
param x Float32 in value
param y Float32 in value
param z Float32 in value
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
ReplacementCodeuiTexCoord2fVertex3fvSUN(rc, tc, v)
return void
param rc ReplacementCodeSUN in array [1]
param tc Float32 in array [2]
param v Float32 in array [3]
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN(rc, s, t, nx, ny, nz, x, y, z)
return void
param rc ReplacementCodeSUN in value
param s Float32 in value
param t Float32 in value
param nx Float32 in value
param ny Float32 in value
param nz Float32 in value
param x Float32 in value
param y Float32 in value
param z Float32 in value
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN(rc, tc, n, v)
return void
param rc ReplacementCodeSUN in array [1]
param tc Float32 in array [2]
param n Float32 in array [3]
param v Float32 in array [3]
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN(rc, s, t, r, g, b, a, nx, ny, nz, x, y, z)
return void
param rc ReplacementCodeSUN in value
param s Float32 in value
param t Float32 in value
param r Float32 in value
param g Float32 in value
param b Float32 in value
param a Float32 in value
param nx Float32 in value
param ny Float32 in value
param nz Float32 in value
param x Float32 in value
param y Float32 in value
param z Float32 in value
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN(rc, tc, c, n, v)
return void
param rc ReplacementCodeSUN in array [1]
param tc Float32 in array [2]
param c Float32 in array [4]
param n Float32 in array [3]
param v Float32 in array [3]
category SUN_vertex
version 1.1
glxropcode ?
glsflags ignore
offset ?
###############################################################################
#
# Extension #167 - WGL_EXT_display_color_table
# Extension #168 - WGL_EXT_extensions_string
# Extension #169 - WGL_EXT_make_current_read
# Extension #170 - WGL_EXT_pixel_format
# Extension #171 - WGL_EXT_pbuffer
# Extension #172 - WGL_EXT_swap_control
#
###############################################################################
###############################################################################
#
# Extension #173
# EXT_blend_func_separate commands (also INGR_blend_func_separate)
#
###############################################################################
BlendFuncSeparateEXT(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha)
return void
param sfactorRGB BlendFuncSeparateParameterEXT in value
param dfactorRGB BlendFuncSeparateParameterEXT in value
param sfactorAlpha BlendFuncSeparateParameterEXT in value
param dfactorAlpha BlendFuncSeparateParameterEXT in value
category EXT_blend_func_separate
glxropcode 4134
version 1.0
extension
alias BlendFuncSeparate
glsalias BlendFuncSeparate
BlendFuncSeparateINGR(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha)
return void
param sfactorRGB BlendFuncSeparateParameterEXT in value
param dfactorRGB BlendFuncSeparateParameterEXT in value
param sfactorAlpha BlendFuncSeparateParameterEXT in value
param dfactorAlpha BlendFuncSeparateParameterEXT in value
category INGR_blend_func_separate
glxropcode 4134
version 1.0
extension
alias BlendFuncSeparateEXT
glsalias BlendFuncSeparateEXT
###############################################################################
#
# Extension #174
# INGR_color_clamp commands
#
###############################################################################
# (none)
newcategory: INGR_color_clamp
###############################################################################
#
# Extension #175
# INGR_interlace_read commands
#
###############################################################################
# (none)
newcategory: INGR_interlace_read
###############################################################################
#
# Extension #176
# EXT_stencil_wrap commands
#
###############################################################################
# (none)
newcategory: EXT_stencil_wrap
###############################################################################
#
# Extension #177 - skipped
#
###############################################################################
###############################################################################
#
# Extension #178
# EXT_422_pixels commands
#
###############################################################################
# (none)
newcategory: EXT_422_pixels
###############################################################################
#
# Extension #179
# NV_texgen_reflection commands
#
###############################################################################
# (none)
newcategory: NV_texgen_reflection
###############################################################################
#
# Extension #???
# @ EXT_texture_cube_map commands
#
###############################################################################
# (none)
###############################################################################
#
# Extension #180 - skipped
# Extension #181 - skipped
#
###############################################################################
###############################################################################
#
# Extension #182
# SUN_convolution_border_modes commands
#
###############################################################################
# (none)
newcategory: SUN_convolution_border_modes
###############################################################################
#
# Extension #183 - GLX_SUN_get_transparent_index
# Extension #184 - skipped
#
###############################################################################
###############################################################################
#
# Extension #185
# EXT_texture_env_add commands
#
###############################################################################
# (none)
newcategory: EXT_texture_env_add
###############################################################################
#
# Extension #186
# EXT_texture_lod_bias commands
#
###############################################################################
# (none)
newcategory: EXT_texture_lod_bias
###############################################################################
#
# Extension #187
# EXT_texture_filter_anisotropic commands
#
###############################################################################
# (none)
newcategory: EXT_texture_filter_anisotropic
###############################################################################
#
# Extension #188
# EXT_vertex_weighting commands
#
###############################################################################
# GLX stuff to be written
VertexWeightfEXT(weight)
return void
param weight Float32 in value
category EXT_vertex_weighting
vectorequiv VertexWeightfvEXT
version 1.1
extension soft WINSOFT NV10
glxflags ignore
offset 494
VertexWeightfvEXT(weight)
return void
param weight Float32 in array [1]
category EXT_vertex_weighting
version 1.1
extension soft WINSOFT NV10
glxropcode 4135
glxflags ignore
glsopcode 0x01DE
offset 495
VertexWeightPointerEXT(size, type, stride, pointer)
return void
param size SizeI in value
param type VertexWeightPointerTypeEXT in value
param stride SizeI in value
param pointer Void in array [COMPSIZE(type/stride)] retained
category EXT_vertex_weighting
version 1.1
extension soft WINSOFT NV10
dlflags notlistable
glxflags ignore
glsflags client
glsopcode 0x01DF
offset 496
###############################################################################
#
# Extension #189
# NV_light_max_exponent commands
#
###############################################################################
# (none)
newcategory: NV_light_max_exponent
###############################################################################
#
# Extension #190
# NV_vertex_array_range commands
#
###############################################################################
FlushVertexArrayRangeNV()
return void
category NV_vertex_array_range
version 1.1
extension soft WINSOFT NV10
dlflags notlistable
glxflags client-handcode server-handcode ignore
glsflags client
glsopcode 0x01E0
offset 497
VertexArrayRangeNV(length, pointer)
return void
param length SizeI in value
param pointer Void in array [COMPSIZE(length)] retained
category NV_vertex_array_range
version 1.1
extension soft WINSOFT NV10
dlflags notlistable
glxflags client-handcode server-handcode ignore
glsflags client
glsopcode 0x01E1
offset 498
###############################################################################
#
# Extension #191
# NV_register_combiners commands
#
###############################################################################
CombinerParameterfvNV(pname, params)
return void
param pname CombinerParameterNV in value
param params CheckedFloat32 in array [COMPSIZE(pname)]
category NV_register_combiners
version 1.1
extension soft WINSOFT NV10
glxropcode 4137
glxflags ignore
glsflags gl-enum
glsopcode 0x01E2
offset 499
CombinerParameterfNV(pname, param)
return void
param pname CombinerParameterNV in value
param param Float32 in value
category NV_register_combiners
version 1.1
extension soft WINSOFT NV10
glxropcode 4136
glxflags ignore
glsflags gl-enum
glsopcode 0x01E3
offset 500
CombinerParameterivNV(pname, params)
return void
param pname CombinerParameterNV in value
param params CheckedInt32 in array [COMPSIZE(pname)]
category NV_register_combiners
version 1.1
extension soft WINSOFT NV10
glxropcode 4139
glxflags ignore
glsflags gl-enum
glsopcode 0x01E4
offset 501
CombinerParameteriNV(pname, param)
return void
param pname CombinerParameterNV in value
param param Int32 in value
category NV_register_combiners
version 1.1
extension soft WINSOFT NV10
glxropcode 4138
glxflags ignore
glsflags gl-enum
glsopcode 0x01E5
offset 502
CombinerInputNV(stage, portion, variable, input, mapping, componentUsage)
return void
param stage CombinerStageNV in value
param portion CombinerPortionNV in value
param variable CombinerVariableNV in value
param input CombinerRegisterNV in value
param mapping CombinerMappingNV in value
param componentUsage CombinerComponentUsageNV in value
category NV_register_combiners
version 1.1
extension soft WINSOFT NV10
glxropcode 4140
glxflags ignore
glsopcode 0x01E6
offset 503
CombinerOutputNV(stage, portion, abOutput, cdOutput, sumOutput, scale, bias, abDotProduct, cdDotProduct, muxSum)
return void
param stage CombinerStageNV in value
param portion CombinerPortionNV in value
param abOutput CombinerRegisterNV in value
param cdOutput CombinerRegisterNV in value
param sumOutput CombinerRegisterNV in value
param scale CombinerScaleNV in value
param bias CombinerBiasNV in value
param abDotProduct Boolean in value
param cdDotProduct Boolean in value
param muxSum Boolean in value
category NV_register_combiners
version 1.1
extension soft WINSOFT NV10
glxropcode 4141
glxflags ignore
glsopcode 0x01E7
offset 504
FinalCombinerInputNV(variable, input, mapping, componentUsage)
return void
param variable CombinerVariableNV in value
param input CombinerRegisterNV in value
param mapping CombinerMappingNV in value
param componentUsage CombinerComponentUsageNV in value
category NV_register_combiners
version 1.1
extension soft WINSOFT NV10
glxropcode 4142
glxflags ignore
glsopcode 0x01E8
offset 505
GetCombinerInputParameterfvNV(stage, portion, variable, pname, params)
return void
param stage CombinerStageNV in value
param portion CombinerPortionNV in value
param variable CombinerVariableNV in value
param pname CombinerParameterNV in value
param params Float32 out array [COMPSIZE(pname)]
dlflags notlistable
category NV_register_combiners
version 1.1
extension soft WINSOFT NV10
glxvendorpriv 1270
glxflags ignore
glsflags get
glsopcode 0x01E9
offset 506
GetCombinerInputParameterivNV(stage, portion, variable, pname, params)
return void
param stage CombinerStageNV in value
param portion CombinerPortionNV in value
param variable CombinerVariableNV in value
param pname CombinerParameterNV in value
param params Int32 out array [COMPSIZE(pname)]
dlflags notlistable
category NV_register_combiners
version 1.1
extension soft WINSOFT NV10
glxvendorpriv 1271
glxflags ignore
glsflags get
glsopcode 0x01EA
offset 507
GetCombinerOutputParameterfvNV(stage, portion, pname, params)
return void
param stage CombinerStageNV in value
param portion CombinerPortionNV in value
param pname CombinerParameterNV in value
param params Float32 out array [COMPSIZE(pname)]
dlflags notlistable
category NV_register_combiners
version 1.1
extension soft WINSOFT NV10
glxvendorpriv 1272
glxflags ignore
glsflags get
glsopcode 0x01EB
offset 508
GetCombinerOutputParameterivNV(stage, portion, pname, params)
return void
param stage CombinerStageNV in value
param portion CombinerPortionNV in value
param pname CombinerParameterNV in value
param params Int32 out array [COMPSIZE(pname)]
dlflags notlistable
category NV_register_combiners
version 1.1
extension soft WINSOFT NV10
glxvendorpriv 1273
glxflags ignore
glsflags get
glsopcode 0x01EC
offset 509
GetFinalCombinerInputParameterfvNV(variable, pname, params)
return void
param variable CombinerVariableNV in value
param pname CombinerParameterNV in value
param params Float32 out array [COMPSIZE(pname)]
dlflags notlistable
category NV_register_combiners
version 1.1
extension soft WINSOFT NV10
glxvendorpriv 1274
glxflags ignore
glsflags get
glsopcode 0x01ED
offset 510
GetFinalCombinerInputParameterivNV(variable, pname, params)
return void
param variable CombinerVariableNV in value
param pname CombinerParameterNV in value
param params Int32 out array [COMPSIZE(pname)]
dlflags notlistable
category NV_register_combiners
version 1.1
extension soft WINSOFT NV10
glxvendorpriv 1275
glxflags ignore
glsflags get
glsopcode 0x01EE
offset 511
###############################################################################
#
# Extension #192
# NV_fog_distance commands
#
###############################################################################
# (none)
newcategory: NV_fog_distance
###############################################################################
#
# Extension #193
# NV_texgen_emboss commands
#
###############################################################################
# (none)
newcategory: NV_texgen_emboss
###############################################################################
#
# Extension #194
# NV_blend_square commands
#
###############################################################################
# (none)
newcategory: NV_blend_square
###############################################################################
#
# Extension #195
# NV_texture_env_combine4 commands
#
###############################################################################
# (none)
newcategory: NV_texture_env_combine4
###############################################################################
#
# Extension #196
# MESA_resize_buffers commands
#
###############################################################################
ResizeBuffersMESA()
return void
category MESA_resize_buffers
version 1.0
glxropcode ?
glsopcode 0x01EF
offset 512
###############################################################################
#
# Extension #197
# MESA_window_pos commands
#
# Note that the 2- and 3-component versions are now aliases of ARB
# entry points.
#
###############################################################################
WindowPos2dMESA(x, y)
return void
param x CoordD in value
param y CoordD in value
category MESA_window_pos
vectorequiv WindowPos2dvMESA
version 1.0
alias WindowPos2dARB
WindowPos2dvMESA(v)
return void
param v CoordD in array [2]
category MESA_window_pos
version 1.0
glxropcode ?
glsopcode 0x01F0
alias WindowPos2dvARB
WindowPos2fMESA(x, y)
return void
param x CoordF in value
param y CoordF in value
category MESA_window_pos
vectorequiv WindowPos2fvMESA
version 1.0
alias WindowPos2fARB
WindowPos2fvMESA(v)
return void
param v CoordF in array [2]
category MESA_window_pos
version 1.0
glxropcode ?
glsopcode 0x01F1
alias WindowPos2fvARB
WindowPos2iMESA(x, y)
return void
param x CoordI in value
param y CoordI in value
category MESA_window_pos
vectorequiv WindowPos2ivMESA
version 1.0
alias WindowPos2iARB
WindowPos2ivMESA(v)
return void
param v CoordI in array [2]
category MESA_window_pos
version 1.0
glxropcode ?
glsopcode 0x01F2
alias WindowPos2ivARB
WindowPos2sMESA(x, y)
return void
param x CoordS in value
param y CoordS in value
category MESA_window_pos
vectorequiv WindowPos2svMESA
version 1.0
alias WindowPos2sARB
WindowPos2svMESA(v)
return void
param v CoordS in array [2]
category MESA_window_pos
version 1.0
glxropcode ?
glsopcode 0x01F3
alias WindowPos2svARB
WindowPos3dMESA(x, y, z)
return void
param x CoordD in value
param y CoordD in value
param z CoordD in value
vectorequiv WindowPos3dvMESA
category MESA_window_pos
version 1.0
alias WindowPos3dARB
WindowPos3dvMESA(v)
return void
param v CoordD in array [3]
category MESA_window_pos
version 1.0
glxropcode ?
glsopcode 0x01F4
alias WindowPos3dvARB
WindowPos3fMESA(x, y, z)
return void
param x CoordF in value
param y CoordF in value
param z CoordF in value
category MESA_window_pos
vectorequiv WindowPos3fvMESA
version 1.0
alias WindowPos3fARB
WindowPos3fvMESA(v)
return void
param v CoordF in array [3]
category MESA_window_pos
version 1.0
glxropcode ?
glsopcode 0x01F5
alias WindowPos3fvARB
WindowPos3iMESA(x, y, z)
return void
param x CoordI in value
param y CoordI in value
param z CoordI in value
category MESA_window_pos
vectorequiv WindowPos3ivMESA
version 1.0
alias WindowPos3iARB
WindowPos3ivMESA(v)
return void
param v CoordI in array [3]
category MESA_window_pos
version 1.0
glxropcode ?
glsopcode 0x01F6
alias WindowPos3ivARB
WindowPos3sMESA(x, y, z)
return void
param x CoordS in value
param y CoordS in value
param z CoordS in value
category MESA_window_pos
vectorequiv WindowPos3svMESA
version 1.0
alias WindowPos3sARB
WindowPos3svMESA(v)
return void
param v CoordS in array [3]
category MESA_window_pos
version 1.0
glxropcode ?
glsopcode 0x01F7
alias WindowPos3svARB
WindowPos4dMESA(x, y, z, w)
return void
param x CoordD in value
param y CoordD in value
param z CoordD in value
param w CoordD in value
vectorequiv WindowPos4dvMESA
category MESA_window_pos
version 1.0
offset 529
WindowPos4dvMESA(v)
return void
param v CoordD in array [4]
category MESA_window_pos
version 1.0
glxropcode ?
glsopcode 0x01F8
offset 530
WindowPos4fMESA(x, y, z, w)
return void
param x CoordF in value
param y CoordF in value
param z CoordF in value
param w CoordF in value
category MESA_window_pos
vectorequiv WindowPos4fvMESA
version 1.0
offset 531
WindowPos4fvMESA(v)
return void
param v CoordF in array [4]
category MESA_window_pos
version 1.0
glxropcode ?
glsopcode 0x01F9
offset 532
WindowPos4iMESA(x, y, z, w)
return void
param x CoordI in value
param y CoordI in value
param z CoordI in value
param w CoordI in value
category MESA_window_pos
vectorequiv WindowPos4ivMESA
version 1.0
offset 533
WindowPos4ivMESA(v)
return void
param v CoordI in array [4]
category MESA_window_pos
version 1.0
glxropcode ?
glsopcode 0x01FA
offset 534
WindowPos4sMESA(x, y, z, w)
return void
param x CoordS in value
param y CoordS in value
param z CoordS in value
param w CoordS in value
category MESA_window_pos
vectorequiv WindowPos4svMESA
version 1.0
offset 535
WindowPos4svMESA(v)
return void
param v CoordS in array [4]
category MESA_window_pos
version 1.0
glxropcode ?
glsopcode 0x01FB
offset 536
###############################################################################
#
# Extension #198
# EXT_texture_compression_s3tc commands
#
###############################################################################
#@@ (none yet)
###############################################################################
#
# Extension #199
# IBM_cull_vertex commands
#
###############################################################################
# (none)
newcategory: IBM_cull_vertex
###############################################################################
#
# Extension #200
# IBM_multimode_draw_arrays commands
#
###############################################################################
MultiModeDrawArraysIBM(mode, first, count, primcount, modestride)
return void
param mode BeginMode in array [COMPSIZE(primcount)]
param first Int32 in array [COMPSIZE(primcount)]
param count SizeI in array [COMPSIZE(primcount)]
param primcount SizeI in value
param modestride Int32 in value
category IBM_multimode_draw_arrays
version 1.1
glxropcode ?
glsflags ignore
offset 708
MultiModeDrawElementsIBM(mode, count, type, indices, primcount, modestride)
return void
param mode BeginMode in array [COMPSIZE(primcount)]
param count SizeI in array [COMPSIZE(primcount)]
param type DrawElementsType in value
param indices ConstVoidPointer in array [COMPSIZE(primcount)]
param primcount SizeI in value
param modestride Int32 in value
category IBM_multimode_draw_arrays
version 1.1
glxropcode ?
glsflags ignore
offset 709
###############################################################################
#
# Extension #201
# IBM_vertex_array_lists commands
#
###############################################################################
ColorPointerListIBM(size, type, stride, pointer, ptrstride)
return void
param size Int32 in value
param type ColorPointerType in value
param stride Int32 in value
param pointer VoidPointer in array [COMPSIZE(size/type/stride)] retained
param ptrstride Int32 in value
category IBM_vertex_array_lists
version 1.1
glxropcode ?
glsflags ignore
offset ?
SecondaryColorPointerListIBM(size, type, stride, pointer, ptrstride)
return void
param size Int32 in value
param type SecondaryColorPointerTypeIBM in value
param stride Int32 in value
param pointer VoidPointer in array [COMPSIZE(size/type/stride)] retained
param ptrstride Int32 in value
category IBM_vertex_array_lists
version 1.1
glxropcode ?
glsflags ignore
offset ?
EdgeFlagPointerListIBM(stride, pointer, ptrstride)
return void
param stride Int32 in value
param pointer BooleanPointer in array [COMPSIZE(stride)] retained
param ptrstride Int32 in value
category IBM_vertex_array_lists
version 1.1
glxropcode ?
glsflags ignore
offset ?
FogCoordPointerListIBM(type, stride, pointer, ptrstride)
return void
param type FogPointerTypeIBM in value
param stride Int32 in value
param pointer VoidPointer in array [COMPSIZE(type/stride)] retained
param ptrstride Int32 in value
category IBM_vertex_array_lists
version 1.1
glxropcode ?
glsflags ignore
offset ?
IndexPointerListIBM(type, stride, pointer, ptrstride)
return void
param type IndexPointerType in value
param stride Int32 in value
param pointer VoidPointer in array [COMPSIZE(type/stride)] retained
param ptrstride Int32 in value
category IBM_vertex_array_lists
version 1.1
glxropcode ?
glsflags ignore
offset ?
NormalPointerListIBM(type, stride, pointer, ptrstride)
return void
param type NormalPointerType in value
param stride Int32 in value
param pointer VoidPointer in array [COMPSIZE(type/stride)] retained
param ptrstride Int32 in value
category IBM_vertex_array_lists
version 1.1
glxropcode ?
glsflags ignore
offset ?
TexCoordPointerListIBM(size, type, stride, pointer, ptrstride)
return void
param size Int32 in value
param type TexCoordPointerType in value
param stride Int32 in value
param pointer VoidPointer in array [COMPSIZE(size/type/stride)] retained
param ptrstride Int32 in value
category IBM_vertex_array_lists
version 1.1
glxropcode ?
glsflags ignore
offset ?
VertexPointerListIBM(size, type, stride, pointer, ptrstride)
return void
param size Int32 in value
param type VertexPointerType in value
param stride Int32 in value
param pointer VoidPointer in array [COMPSIZE(size/type/stride)] retained
param ptrstride Int32 in value
category IBM_vertex_array_lists
version 1.1
glxropcode ?
glsflags ignore
offset ?
###############################################################################
#
# Extension #202
# SGIX_subsample commands
#
###############################################################################
# (none)
newcategory: SGIX_subsample
###############################################################################
#
# Extension #203
# SGIX_ycrcba commands
#
###############################################################################
# (none)
newcategory: SGIX_ycrcba
###############################################################################
#
# Extension #204
# SGIX_ycrcb_subsample commands
#
###############################################################################
# (none)
newcategory: SGIX_ycrcb_subsample
###############################################################################
#
# Extension #205
# SGIX_depth_pass_instrument commands
#
###############################################################################
# (none)
newcategory: SGIX_depth_pass_instrument
###############################################################################
#
# Extension #206
# 3DFX_texture_compression_FXT1 commands
#
###############################################################################
# (none)
newcategory: 3DFX_texture_compression_FXT1
###############################################################################
#
# Extension #207
# 3DFX_multisample commands
#
###############################################################################
# (none)
newcategory: 3DFX_multisample
###############################################################################
#
# Extension #208
# 3DFX_tbuffer commands
#
###############################################################################
TbufferMask3DFX(mask)
return void
param mask UInt32 in value
category 3DFX_tbuffer
version 1.2
glxropcode ?
glsflags ignore
glsopcode 0x01FC
offset 553
###############################################################################
#
# Extension #209
# EXT_multisample commands
#
###############################################################################
SampleMaskEXT(value, invert)
return void
param value ClampedFloat32 in value
param invert Boolean in value
category EXT_multisample
version 1.0
glxropcode ?
extension
glsopcode 0x0160
offset 446
SamplePatternEXT(pattern)
return void
param pattern SamplePatternEXT in value
category EXT_multisample
version 1.0
glxropcode ?
glxflags
extension
glsopcode 0x0161
offset 447
###############################################################################
#
# Extension #210
# SGIX_vertex_preclip commands
#
###############################################################################
# (none)
newcategory: SGIX_vertex_preclip
###############################################################################
#
# Extension #211
# SGIX_convolution_accuracy commands
#
###############################################################################
# (none)
newcategory: SGIX_convolution_accuracy
###############################################################################
#
# Extension #212
# SGIX_resample commands
#
###############################################################################
# (none)
newcategory: SGIX_resample
###############################################################################
#
# Extension #213
# SGIS_point_line_texgen commands
#
###############################################################################
# (none)
newcategory: SGIS_point_line_texgen
###############################################################################
#
# Extension #214
# SGIS_texture_color_mask commands
#
###############################################################################
TextureColorMaskSGIS(red, green, blue, alpha)
return void
param red Boolean in value
param green Boolean in value
param blue Boolean in value
param alpha Boolean in value
category SGIS_texture_color_mask
version 1.1
glxropcode 2082
extension
glsopcode 0x01B0
offset ?
###############################################################################
#
# Extension #215 - GLX_MESA_copy_sub_buffer
# Extension #216 - GLX_MESA_pixmap_colormap
# Extension #217 - GLX_MESA_release_buffers
# Extension #218 - GLX_MESA_set_3dfx_mode
#
###############################################################################
###############################################################################
#
# Extension #219
# SGIX_igloo_interface commands
#
###############################################################################
IglooInterfaceSGIX(pname, params)
return void
dlflags notlistable
param pname IglooFunctionSelectSGIX in value
param params IglooParameterSGIX in array [COMPSIZE(pname)]
category SGIX_igloo_interface
version 1.0
glxflags SGI ignore
extension
glxropcode 200
glsopcode 0x0183
offset ?
###############################################################################
#
# Extension #220
# EXT_texture_env_dot3 commands
#
###############################################################################
# (none)
newcategory: EXT_texture_env_dot3
###############################################################################
#
# Extension #221
# ATI_texture_mirror_once commands
#
###############################################################################
# (none)
newcategory: ATI_texture_mirror_once
###############################################################################
#
# Extension #222
# NV_fence commands
#
###############################################################################
DeleteFencesNV(n, fences)
return void
param n SizeI in value
param fences FenceNV in array [n]
category NV_fence
dlflags notlistable
version 1.2
extension soft WINSOFT NV10
glxvendorpriv 1276
glxflags ignore
glsopcode 0x0216
offset 647
GenFencesNV(n, fences)
return void
param n SizeI in value
param fences FenceNV out array [n]
category NV_fence
dlflags notlistable
version 1.2
extension soft WINSOFT NV10
glxvendorpriv 1277
glxflags ignore
glsopcode 0x0215
offset 648
IsFenceNV(fence)
return Boolean
param fence FenceNV in value
category NV_fence
dlflags notlistable
version 1.2
extension soft WINSOFT NV10
glxvendorpriv 1278
glxflags ignore
glsflags get
glsopcode 0x021A
offset 649
TestFenceNV(fence)
return Boolean
param fence FenceNV in value
category NV_fence
dlflags notlistable
version 1.2
extension soft WINSOFT NV10
glxvendorpriv 1279
glxflags ignore
glsflags get
glsopcode 0x0218
offset 650
GetFenceivNV(fence, pname, params)
return void
param fence FenceNV in value
param pname FenceParameterNameNV in value
param params Int32 out array [COMPSIZE(pname)]
category NV_fence
dlflags notlistable
version 1.2
extension soft WINSOFT NV10
glxvendorpriv 1280
glxflags ignore
glsflags get
glsopcode 0x021B
offset 651
FinishFenceNV(fence)
return void
param fence FenceNV in value
category NV_fence
dlflags notlistable
version 1.2
extension soft WINSOFT NV10
glxvendorpriv 1312
glxflags ignore
glsflags get
glsopcode 0x0219
offset 652
SetFenceNV(fence, condition)
return void
param fence FenceNV in value
param condition FenceConditionNV in value
category NV_fence
version 1.2
extension soft WINSOFT NV10
glxflags ignore
glsopcode 0x0217
offset 653
###############################################################################
#
# Extension #225
# NV_evaluators commands
#
###############################################################################
MapControlPointsNV(target, index, type, ustride, vstride, uorder, vorder, packed, points)
return void
param target EvalTargetNV in value
param index UInt32 in value
param type MapTypeNV in value
param ustride SizeI in value
param vstride SizeI in value
param uorder CheckedInt32 in value
param vorder CheckedInt32 in value
param packed Boolean in value
param points Void in array [COMPSIZE(target/uorder/vorder)]
category NV_evaluators
dlflags handcode
version 1.1
extension soft WINSOFT NV10
glxflags ignore
glsflags ignore
glsopcode 0x021C
offset ?
MapParameterivNV(target, pname, params)
return void
param target EvalTargetNV in value
param pname MapParameterNV in value
param params CheckedInt32 in array [COMPSIZE(target/pname)]
category NV_evaluators
version 1.1
extension soft WINSOFT NV10
glxflags ignore
glsflags ignore
glsopcode 0x021D
offset ?
MapParameterfvNV(target, pname, params)
return void
param target EvalTargetNV in value
param pname MapParameterNV in value
param params CheckedFloat32 in array [COMPSIZE(target/pname)]
category NV_evaluators
version 1.1
extension soft WINSOFT NV10
glxflags ignore
glsflags ignore
glsopcode 0x021E
offset ?
GetMapControlPointsNV(target, index, type, ustride, vstride, packed, points)
return void
param target EvalTargetNV in value
param index UInt32 in value
param type MapTypeNV in value
param ustride SizeI in value
param vstride SizeI in value
param packed Boolean in value
param points Void out array [COMPSIZE(target)]
category NV_evaluators
dlflags notlistable
version 1.1
extension soft WINSOFT NV10
glxflags ignore
glsflags get
glsopcode 0x021F
offset ?
GetMapParameterivNV(target, pname, params)
return void
param target EvalTargetNV in value
param pname MapParameterNV in value
param params Int32 out array [COMPSIZE(target/pname)]
category NV_evaluators
dlflags notlistable
version 1.1
extension soft WINSOFT NV10
glxflags ignore
glsflags get
glsopcode 0x0220
offset ?
GetMapParameterfvNV(target, pname, params)
return void
param target EvalTargetNV in value
param pname MapParameterNV in value
param params Float32 out array [COMPSIZE(target/pname)]
category NV_evaluators
dlflags notlistable
version 1.1
extension soft WINSOFT NV10
glxflags ignore
glsflags get
glsopcode 0x0221
offset ?
GetMapAttribParameterivNV(target, index, pname, params)
return void
param target EvalTargetNV in value
param index UInt32 in value
param pname MapAttribParameterNV in value
param params Int32 out array [COMPSIZE(pname)]
category NV_evaluators
dlflags notlistable
version 1.1
extension soft WINSOFT NV10
glxflags ignore
glsflags get
glsopcode 0x0222
offset ?
GetMapAttribParameterfvNV(target, index, pname, params)
return void
param target EvalTargetNV in value
param index UInt32 in value
param pname MapAttribParameterNV in value
param params Float32 out array [COMPSIZE(pname)]
category NV_evaluators
dlflags notlistable
version 1.1
extension soft WINSOFT NV10
glxflags ignore
glsflags get
glsopcode 0x0223
offset ?
EvalMapsNV(target, mode)
return void
param target EvalTargetNV in value
param mode EvalMapsModeNV in value
category NV_evaluators
version 1.1
extension soft WINSOFT NV10
glxflags ignore
glsopcode 0x0224
offset ?
###############################################################################
#
# Extension #226
# NV_packed_depth_stencil commands
#
###############################################################################
# (none)
newcategory: NV_packed_depth_stencil
###############################################################################
#
# Extension #227
# NV_register_combiners2 commands
#
###############################################################################
CombinerStageParameterfvNV(stage, pname, params)
return void
param stage CombinerStageNV in value
param pname CombinerParameterNV in value
param params CheckedFloat32 in array [COMPSIZE(pname)]
category NV_register_combiners2
version 1.1
extension
glxflags ignore
glsopcode 0x0225
offset ?
GetCombinerStageParameterfvNV(stage, pname, params)
return void
param stage CombinerStageNV in value
param pname CombinerParameterNV in value
param params Float32 out array [COMPSIZE(pname)]
dlflags notlistable
category NV_register_combiners2
version 1.1
extension
glxflags ignore
glsflags get
glsopcode 0x0226
offset ?
###############################################################################
#
# Extension #228
# NV_texture_compression_vtc commands
#
###############################################################################
# (none)
newcategory: NV_texture_compression_vtc
###############################################################################
#
# Extension #229
# NV_texture_rectangle commands
#
###############################################################################
# (none)
newcategory: NV_texture_rectangle
###############################################################################
#
# Extension #230
# NV_texture_shader commands
#
###############################################################################
# (none)
newcategory: NV_texture_shader
###############################################################################
#
# Extension #231
# NV_texture_shader2 commands
#
###############################################################################
# (none)
newcategory: NV_texture_shader2
###############################################################################
#
# Extension #232
# NV_vertex_array_range2 commands
#
###############################################################################
# (none)
newcategory: NV_vertex_array_range2
###############################################################################
#
# Extension #233
# NV_vertex_program commands
#
###############################################################################
AreProgramsResidentNV(n, programs, residences)
return Boolean
param n SizeI in value
param programs UInt32 in array [n]
param residences Boolean out array [n]
category NV_vertex_program
dlflags notlistable
version 1.2
extension soft WINSOFT NV10
glxflags ignore
glxvendorpriv 1293
glsflags get
glsopcode 0x022B
offset 578
BindProgramNV(target, id)
return void
param target VertexAttribEnumNV in value
param id UInt32 in value
category NV_vertex_program
version 1.2
extension soft WINSOFT NV10
glxropcode 4180
glsopcode 0x0227
alias BindProgramARB
glsalias BindProgramARB
DeleteProgramsNV(n, programs)
return void
param n SizeI in value
param programs UInt32 in array [n]
category NV_vertex_program
dlflags notlistable
version 1.2
extension soft WINSOFT NV10
glxvendorpriv 1294
glsopcode 0x0228
alias DeleteProgramsARB
glsalias DeleteProgramsARB
ExecuteProgramNV(target, id, params)
return void
param target VertexAttribEnumNV in value
param id UInt32 in value
param params Float32 in array [4]
category NV_vertex_program
version 1.2
extension soft WINSOFT NV10
glxflags ignore
glxropcode 4181
glsopcode 0x0229
offset 581
GenProgramsNV(n, programs)
return void
param n SizeI in value
param programs UInt32 out array [n]
category NV_vertex_program
dlflags notlistable
version 1.2
extension soft WINSOFT NV10
glxvendorpriv 1295
glsopcode 0x022A
alias GenProgramsARB
glsalias GenProgramsARB
GetProgramParameterdvNV(target, index, pname, params)
return void
param target VertexAttribEnumNV in value
param index UInt32 in value
param pname VertexAttribEnumNV in value
param params Float64 out array [4]
category NV_vertex_program
dlflags notlistable
version 1.2
extension soft WINSOFT NV10
glxflags ignore
glxvendorpriv 1297
glsflags get
glsopcode 0x022E
offset 583
GetProgramParameterfvNV(target, index, pname, params)
return void
param target VertexAttribEnumNV in value
param index UInt32 in value
param pname VertexAttribEnumNV in value
param params Float32 out array [4]
category NV_vertex_program
dlflags notlistable
version 1.2
extension soft WINSOFT NV10
glxflags ignore
glxvendorpriv 1296
glsflags get
glsopcode 0x022D
offset 584
# GetProgramParameterSigneddvNV(target, index, pname, params)
# return void
# param target VertexAttribEnumNV in value
# param index Int32 in value
# param pname VertexAttribEnumNV in value
# param params Float64 out array [4]
# category NV_vertex_program1_1_dcc
# dlflags notlistable
# version 1.2
# extension soft WINSOFT NV20
# glsflags ignore
# glxflags ignore
# offset ?
#
# GetProgramParameterSignedfvNV(target, index, pname, params)
# return void
# param target VertexAttribEnumNV in value
# param index Int32 in value
# param pname VertexAttribEnumNV in value
# param params Float32 out array [4]
# category NV_vertex_program1_1_dcc
# dlflags notlistable
# version 1.2
# extension soft WINSOFT NV20
# glsflags ignore
# glxflags ignore
# offset ?
GetProgramivNV(id, pname, params)
return void
param id UInt32 in value
param pname VertexAttribEnumNV in value
param params Int32 out array [4]
category NV_vertex_program
dlflags notlistable
version 1.2
extension soft WINSOFT NV10
glxflags ignore
glxvendorpriv 1298
glsflags get
glsopcode 0x022F
offset 585
GetProgramStringNV(id, pname, program)
return void
param id UInt32 in value
param pname VertexAttribEnumNV in value
param program ProgramCharacterNV out array [COMPSIZE(id/pname)]
category NV_vertex_program
dlflags notlistable
version 1.2
extension soft WINSOFT NV10
glxflags ignore
glxvendorpriv 1299
glsflags get
glsopcode 0x0230
offset 586
GetTrackMatrixivNV(target, address, pname, params)
return void
param target VertexAttribEnumNV in value
param address UInt32 in value
param pname VertexAttribEnumNV in value
param params Int32 out array [1]
category NV_vertex_program
dlflags notlistable
version 1.2
extension soft WINSOFT NV10
glxflags ignore
glxvendorpriv 1300
glsflags get
glsopcode 0x0231
offset 587
GetVertexAttribdvNV(index, pname, params)
return void
param index UInt32 in value
param pname VertexAttribEnumNV in value
param params Float64 out array [1]
category NV_vertex_program
dlflags notlistable
version 1.2
extension soft WINSOFT NV10
glxvendorpriv 1301
glsflags client get
glsopcode 0x0232
alias GetVertexAttribdv
glsalias GetVertexAttribdv
GetVertexAttribfvNV(index, pname, params)
return void
param index UInt32 in value
param pname VertexAttribEnumNV in value
param params Float32 out array [1]
category NV_vertex_program
dlflags notlistable
version 1.2
extension soft WINSOFT NV10
glxvendorpriv 1302
glsflags client get
glsopcode 0x0233
alias GetVertexAttribfv
glsalias GetVertexAttribfv
GetVertexAttribivNV(index, pname, params)
return void
param index UInt32 in value
param pname VertexAttribEnumNV in value
param params Int32 out array [1]
category NV_vertex_program
dlflags notlistable
version 1.2
extension soft WINSOFT NV10
glxvendorpriv 1303
glsflags client get
glsopcode 0x0234
alias GetVertexAttribiv
glsalias GetVertexAttribiv
GetVertexAttribPointervNV(index, pname, pointer)
return void
param index UInt32 in value
param pname VertexAttribEnumNV in value
param pointer VoidPointer out array [1]
category NV_vertex_program
dlflags notlistable
version 1.2
extension soft WINSOFT NV10
glxflags ignore
glsflags client get
glsopcode 0x0235
alias GetVertexAttribPointerv
glsalias GetVertexAttribPointerv
IsProgramNV(id)
return Boolean
param id UInt32 in value
category NV_vertex_program
dlflags notlistable
version 1.2
extension soft WINSOFT NV10
glxvendorpriv 1304
glsflags get
glsopcode 0x0236
alias IsProgram
glsalias IsProgram
LoadProgramNV(target, id, len, program)
return void
param target VertexAttribEnumNV in value
param id UInt32 in value
param len SizeI in value
param program UInt8 in array [len]
category NV_vertex_program
version 1.2
extension soft WINSOFT NV10
glxropcode 4183
glsopcode 0x0237
offset 593
ProgramParameter4dNV(target, index, x, y, z, w)
return void
param target VertexAttribEnumNV in value
param index UInt32 in value
param x Float64 in value
param y Float64 in value
param z Float64 in value
param w Float64 in value
category NV_vertex_program
version 1.2
vectorequiv ProgramParameter4dvNV
extension soft WINSOFT NV10
offset 594
ProgramParameter4dvNV(target, index, v)
return void
param target VertexAttribEnumNV in value
param index UInt32 in value
param v Float64 in array [4]
category NV_vertex_program
version 1.2
extension soft WINSOFT NV10
glxropcode 4185
glsopcode 0x0238
offset 595
ProgramParameter4fNV(target, index, x, y, z, w)
return void
param target VertexAttribEnumNV in value
param index UInt32 in value
param x Float32 in value
param y Float32 in value
param z Float32 in value
param w Float32 in value
category NV_vertex_program
version 1.2
vectorequiv ProgramParameter4fvNV
extension soft WINSOFT NV10
offset 596
ProgramParameter4fvNV(target, index, v)
return void
param target VertexAttribEnumNV in value
param index UInt32 in value
param v Float32 in array [4]
category NV_vertex_program
version 1.2
extension soft WINSOFT NV10
glxropcode 4184
glsopcode 0x0239
offset 597
#??? 'count' was SizeI in the latest NVIDIA gl.spec, but UInt32 in the
#??? extension specification in the registry.
ProgramParameters4dvNV(target, index, count, v)
return void
param target VertexAttribEnumNV in value
param index UInt32 in value
param count UInt32 in value
param v Float64 in array [count*4]
category NV_vertex_program
version 1.2
extension soft WINSOFT NV10
glxropcode 4187
glsopcode 0x023A
offset 598
#??? 'count' was SizeI in the latest NVIDIA gl.spec, but UInt32 in the
#??? extension specification in the registry.
ProgramParameters4fvNV(target, index, count, v)
return void
param target VertexAttribEnumNV in value
param index UInt32 in value
param count UInt32 in value
param v Float32 in array [count*4]
category NV_vertex_program
version 1.2
extension soft WINSOFT NV10
glxropcode 4186
glsopcode 0x023B
offset 599
# ProgramParameterSigned4dNV(target, index, x, y, z, w)
# return void
# param target VertexAttribEnumNV in value
# param index Int32 in value
# param x Float64 in value
# param y Float64 in value
# param z Float64 in value
# param w Float64 in value
# category NV_vertex_program1_1_dcc
# version 1.2
# vectorequiv ProgramParameterSigned4dvNV
# extension soft WINSOFT NV20
# offset ?
#
# ProgramParameterSigned4dvNV(target, index, v)
# return void
# param target VertexAttribEnumNV in value
# param index Int32 in value
# param v Float64 in array [4]
# category NV_vertex_program1_1_dcc
# version 1.2
# extension soft WINSOFT NV20
# glsflags ignore
# glxflags ignore
# offset ?
#
# ProgramParameterSigned4fNV(target, index, x, y, z, w)
# return void
# param target VertexAttribEnumNV in value
# param index Int32 in value
# param x Float32 in value
# param y Float32 in value
# param z Float32 in value
# param w Float32 in value
# category NV_vertex_program1_1_dcc
# version 1.2
# vectorequiv ProgramParameterSigned4fvNV
# extension soft WINSOFT NV20
# offset ?
#
# ProgramParameterSigned4fvNV(target, index, v)
# return void
# param target VertexAttribEnumNV in value
# param index Int32 in value
# param v Float32 in array [4]
# category NV_vertex_program1_1_dcc
# version 1.2
# extension soft WINSOFT NV20
# glsflags ignore
# glxflags ignore
# offset ?
#
# ProgramParametersSigned4dvNV(target, index, count, v)
# return void
# param target VertexAttribEnumNV in value
# param index Int32 in value
# param count SizeI in value
# param v Float64 in array [count*4]
# category NV_vertex_program1_1_dcc
# version 1.2
# extension soft WINSOFT NV20
# glsflags ignore
# glxflags ignore
# offset ?
#
# ProgramParametersSigned4fvNV(target, index, count, v)
# return void
# param target VertexAttribEnumNV in value
# param index Int32 in value
# param count SizeI in value
# param v Float32 in array [count*4]
# category NV_vertex_program1_1_dcc
# version 1.2
# extension soft WINSOFT NV20
# glsflags ignore
# glxflags ignore
# offset ?
RequestResidentProgramsNV(n, programs)
return void
param n SizeI in value
param programs UInt32 in array [n]
category NV_vertex_program
version 1.2
extension soft WINSOFT NV10
glxropcode 4182
glsopcode 0x022C
offset 600
TrackMatrixNV(target, address, matrix, transform)
return void
param target VertexAttribEnumNV in value
param address UInt32 in value
param matrix VertexAttribEnumNV in value
param transform VertexAttribEnumNV in value
category NV_vertex_program
version 1.2
extension soft WINSOFT NV10
glxropcode 4188
glsopcode 0x023C
offset 601
VertexAttribPointerNV(index, fsize, type, stride, pointer)
return void
param index UInt32 in value
param fsize Int32 in value
param type VertexAttribEnumNV in value
param stride SizeI in value
param pointer Void in array [COMPSIZE(fsize/type/stride)] retained
category NV_vertex_program
dlflags notlistable
version 1.2
extension soft WINSOFT NV10
glxflags ignore
glsflags client
glsopcode 0x023D
offset 602
VertexAttrib1dNV(index, x)
return void
param index UInt32 in value
param x Float64 in value
category NV_vertex_program
version 1.2
vectorequiv VertexAttrib1dvNV
extension soft WINSOFT NV10
alias VertexAttrib1d
glsalias VertexAttrib1d
VertexAttrib1dvNV(index, v)
return void
param index UInt32 in value
param v Float64 in array [1]
category NV_vertex_program
version 1.2
extension soft WINSOFT NV10
glxropcode 4197
glsopcode 0x0240
alias VertexAttrib1dv
glsalias VertexAttrib1dv
VertexAttrib1fNV(index, x)
return void
param index UInt32 in value
param x Float32 in value
category NV_vertex_program
version 1.2
vectorequiv VertexAttrib1fvNV
extension soft WINSOFT NV10
alias VertexAttrib1f
glsalias VertexAttrib1f
VertexAttrib1fvNV(index, v)
return void
param index UInt32 in value
param v Float32 in array [1]
category NV_vertex_program
version 1.2
extension soft WINSOFT NV10
glxropcode 4193
glsopcode 0x023F
alias VertexAttrib1fv
glsalias VertexAttrib1fv
VertexAttrib1sNV(index, x)
return void
param index UInt32 in value
param x Int16 in value
category NV_vertex_program
version 1.2
vectorequiv VertexAttrib1svNV
extension soft WINSOFT NV10
alias VertexAttrib1s
glsalias VertexAttrib1s
VertexAttrib1svNV(index, v)
return void
param index UInt32 in value
param v Int16 in array [1]
category NV_vertex_program
version 1.2
extension soft WINSOFT NV10
glxropcode 4189
glsopcode 0x023E
alias VertexAttrib1sv
glsalias VertexAttrib1sv
VertexAttrib2dNV(index, x, y)
return void
param index UInt32 in value
param x Float64 in value
param y Float64 in value
category NV_vertex_program
version 1.2
vectorequiv VertexAttrib2dvNV
extension soft WINSOFT NV10
alias VertexAttrib2d
glsalias VertexAttrib2d
VertexAttrib2dvNV(index, v)
return void
param index UInt32 in value
param v Float64 in array [2]
category NV_vertex_program
version 1.2
extension soft WINSOFT NV10
glxropcode 4198
glsopcode 0x0243
alias VertexAttrib2dv
glsalias VertexAttrib2dv
VertexAttrib2fNV(index, x, y)
return void
param index UInt32 in value
param x Float32 in value
param y Float32 in value
category NV_vertex_program
version 1.2
vectorequiv VertexAttrib2fvNV
extension soft WINSOFT NV10
alias VertexAttrib2f
glsalias VertexAttrib2f
VertexAttrib2fvNV(index, v)
return void
param index UInt32 in value
param v Float32 in array [2]
category NV_vertex_program
version 1.2
extension soft WINSOFT NV10
glxropcode 4194
glsopcode 0x0242
alias VertexAttrib2fv
glsalias VertexAttrib2fv
VertexAttrib2sNV(index, x, y)
return void
param index UInt32 in value
param x Int16 in value
param y Int16 in value
category NV_vertex_program
version 1.2
vectorequiv VertexAttrib2svNV
extension soft WINSOFT NV10
alias VertexAttrib2s
glsalias VertexAttrib2s
VertexAttrib2svNV(index, v)
return void
param index UInt32 in value
param v Int16 in array [2]
category NV_vertex_program
version 1.2
extension soft WINSOFT NV10
glxropcode 4190
glsopcode 0x0241
alias VertexAttrib2sv
glsalias VertexAttrib2sv
VertexAttrib3dNV(index, x, y, z)
return void
param index UInt32 in value
param x Float64 in value
param y Float64 in value
param z Float64 in value
category NV_vertex_program
version 1.2
vectorequiv VertexAttrib3dvNV
extension soft WINSOFT NV10
alias VertexAttrib3d
glsalias VertexAttrib3d
VertexAttrib3dvNV(index, v)
return void
param index UInt32 in value
param v Float64 in array [3]
category NV_vertex_program
version 1.2
extension soft WINSOFT NV10
glxropcode 4199
glsopcode 0x0246
alias VertexAttrib3dv
glsalias VertexAttrib3dv
VertexAttrib3fNV(index, x, y, z)
return void
param index UInt32 in value
param x Float32 in value
param y Float32 in value
param z Float32 in value
category NV_vertex_program
version 1.2
vectorequiv VertexAttrib3fvNV
extension soft WINSOFT NV10
alias VertexAttrib3f
glsalias VertexAttrib3f
VertexAttrib3fvNV(index, v)
return void
param index UInt32 in value
param v Float32 in array [3]
category NV_vertex_program
version 1.2
extension soft WINSOFT NV10
glxropcode 4195
glsopcode 0x0245
alias VertexAttrib3fv
glsalias VertexAttrib3fv
VertexAttrib3sNV(index, x, y, z)
return void
param index UInt32 in value
param x Int16 in value
param y Int16 in value
param z Int16 in value
category NV_vertex_program
version 1.2
vectorequiv VertexAttrib3svNV
extension soft WINSOFT NV10
alias VertexAttrib3s
glsalias VertexAttrib3s
VertexAttrib3svNV(index, v)
return void
param index UInt32 in value
param v Int16 in array [3]
category NV_vertex_program
version 1.2
extension soft WINSOFT NV10
glxropcode 4191
glsopcode 0x0244
alias VertexAttrib3sv
glsalias VertexAttrib3sv
VertexAttrib4dNV(index, x, y, z, w)
return void
param index UInt32 in value
param x Float64 in value
param y Float64 in value
param z Float64 in value
param w Float64 in value
category NV_vertex_program
version 1.2
vectorequiv VertexAttrib4dvNV
extension soft WINSOFT NV10
alias VertexAttrib4d
glsalias VertexAttrib4d
VertexAttrib4dvNV(index, v)
return void
param index UInt32 in value
param v Float64 in array [4]
category NV_vertex_program
version 1.2
extension soft WINSOFT NV10
glxropcode 4200
glsopcode 0x0249
alias VertexAttrib4dv
glsalias VertexAttrib4dv
VertexAttrib4fNV(index, x, y, z, w)
return void
param index UInt32 in value
param x Float32 in value
param y Float32 in value
param z Float32 in value
param w Float32 in value
category NV_vertex_program
version 1.2
vectorequiv VertexAttrib4fvNV
extension soft WINSOFT NV10
alias VertexAttrib4f
glsalias VertexAttrib4f
VertexAttrib4fvNV(index, v)
return void
param index UInt32 in value
param v Float32 in array [4]
category NV_vertex_program
version 1.2
extension soft WINSOFT NV10
glxropcode 4196
glsopcode 0x0248
alias VertexAttrib4fv
glsalias VertexAttrib4fv
VertexAttrib4sNV(index, x, y, z, w)
return void
param index UInt32 in value
param x Int16 in value
param y Int16 in value
param z Int16 in value
param w Int16 in value
category NV_vertex_program
version 1.2
vectorequiv VertexAttrib4svNV
extension soft WINSOFT NV10
alias VertexAttrib4s
glsalias VertexAttrib4s
VertexAttrib4svNV(index, v)
return void
param index UInt32 in value
param v Int16 in array [4]
category NV_vertex_program
version 1.2
extension soft WINSOFT NV10
glxropcode 4192
glsopcode 0x0247
alias VertexAttrib4sv
glsalias VertexAttrib4sv
VertexAttrib4ubNV(index, x, y, z, w)
return void
param index UInt32 in value
param x ColorUB in value
param y ColorUB in value
param z ColorUB in value
param w ColorUB in value
category NV_vertex_program
version 1.2
extension soft WINSOFT NV10
vectorequiv VertexAttrib4ubvNV
alias VertexAttrib4Nub
glsalias VertexAttrib4Nub
VertexAttrib4ubvNV(index, v)
return void
param index UInt32 in value
param v ColorUB in array [4]
category NV_vertex_program
version 1.2
extension soft WINSOFT NV10
glxropcode 4201
glsopcode 0x024A
alias VertexAttrib4Nubv
glsalias VertexAttrib4Nubv
VertexAttribs1dvNV(index, count, v)
return void
param index UInt32 in value
param count SizeI in value
param v Float64 in array [count]
category NV_vertex_program
dlflags handcode
version 1.2
extension soft WINSOFT NV10
glxropcode 4210
glsopcode 0x024D
offset 629
VertexAttribs1fvNV(index, count, v)
return void
param index UInt32 in value
param count SizeI in value
param v Float32 in array [count]
category NV_vertex_program
dlflags handcode
version 1.2
extension soft WINSOFT NV10
glxropcode 4206
glsopcode 0x024C
offset 630
VertexAttribs1svNV(index, count, v)
return void
param index UInt32 in value
param count SizeI in value
param v Int16 in array [count]
category NV_vertex_program
dlflags handcode
version 1.2
extension soft WINSOFT NV10
glxropcode 4202
glsopcode 0x024B
offset 631
VertexAttribs2dvNV(index, count, v)
return void
param index UInt32 in value
param count SizeI in value
param v Float64 in array [count*2]
category NV_vertex_program
dlflags handcode
version 1.2
extension soft WINSOFT NV10
glxropcode 4211
glsopcode 0x0250
offset 632
VertexAttribs2fvNV(index, count, v)
return void
param index UInt32 in value
param count SizeI in value
param v Float32 in array [count*2]
category NV_vertex_program
dlflags handcode
version 1.2
extension soft WINSOFT NV10
glxropcode 4207
glsopcode 0x024F
offset 633
VertexAttribs2svNV(index, count, v)
return void
param index UInt32 in value
param count SizeI in value
param v Int16 in array [count*2]
category NV_vertex_program
dlflags handcode
version 1.2
extension soft WINSOFT NV10
glxropcode 4203
glsopcode 0x024E
offset 634
VertexAttribs3dvNV(index, count, v)
return void
param index UInt32 in value
param count SizeI in value
param v Float64 in array [count*3]
category NV_vertex_program
dlflags handcode
version 1.2
extension soft WINSOFT NV10
glxropcode 4212
glsopcode 0x0253
offset 635
VertexAttribs3fvNV(index, count, v)
return void
param index UInt32 in value
param count SizeI in value
param v Float32 in array [count*3]
category NV_vertex_program
dlflags handcode
version 1.2
extension soft WINSOFT NV10
glxropcode 4208
glsopcode 0x0252
offset 636
VertexAttribs3svNV(index, count, v)
return void
param index UInt32 in value
param count SizeI in value
param v Int16 in array [count*3]
category NV_vertex_program
dlflags handcode
version 1.2
extension soft WINSOFT NV10
glxropcode 4204
glsopcode 0x0251
offset 637
VertexAttribs4dvNV(index, count, v)
return void
param index UInt32 in value
param count SizeI in value
param v Float64 in array [count*4]
category NV_vertex_program
dlflags handcode
version 1.2
extension soft WINSOFT NV10
glxropcode 4213
glsopcode 0x0256
offset 638
VertexAttribs4fvNV(index, count, v)
return void
param index UInt32 in value
param count SizeI in value
param v Float32 in array [count*4]
category NV_vertex_program
dlflags handcode
version 1.2
extension soft WINSOFT NV10
glxropcode 4209
glsopcode 0x0255
offset 639
VertexAttribs4svNV(index, count, v)
return void
param index UInt32 in value
param count SizeI in value
param v Int16 in array [count*4]
category NV_vertex_program
dlflags handcode
version 1.2
extension soft WINSOFT NV10
glxropcode 4205
glsopcode 0x0254
offset 640
VertexAttribs4ubvNV(index, count, v)
return void
param index UInt32 in value
param count SizeI in value
param v ColorUB in array [count*4]
category NV_vertex_program
dlflags handcode
version 1.2
extension soft WINSOFT NV10
glxropcode 4214
glsopcode 0x0257
offset 641
###############################################################################
#
# Extension #234 - GLX_SGIX_visual_select_group
#
###############################################################################
###############################################################################
#
# Extension #235
# SGIX_texture_coordinate_clamp commands
#
###############################################################################
# (none)
newcategory: SGIX_texture_coordinate_clamp
###############################################################################
#
# Extension #236
# SGIX_scalebias_hint commands
#
###############################################################################
# (none)
newcategory: SGIX_scalebias_hint
###############################################################################
#
# Extension #237 - GLX_OML_swap_method commands
# Extension #238 - GLX_OML_sync_control commands
#
###############################################################################
###############################################################################
#
# Extension #239
# OML_interlace commands
#
###############################################################################
# (none)
newcategory: OML_interlace
###############################################################################
#
# Extension #240
# OML_subsample commands
#
###############################################################################
# (none)
newcategory: OML_subsample
###############################################################################
#
# Extension #241
# OML_resample commands
#
###############################################################################
# (none)
newcategory: OML_resample
###############################################################################
#
# Extension #242 - WGL_OML_sync_control commands
#
###############################################################################
###############################################################################
#
# Extension #243
# NV_copy_depth_to_color commands
#
###############################################################################
# (none)
newcategory: NV_copy_depth_to_color
###############################################################################
#
# Extension #244
# ATI_envmap_bumpmap commands
#
###############################################################################
TexBumpParameterivATI(pname, param)
return void
param pname TexBumpParameterATI in value
param param Int32 in array [COMPSIZE(pname)]
category ATI_envmap_bumpmap
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
TexBumpParameterfvATI(pname, param)
return void
param pname TexBumpParameterATI in value
param param Float32 in array [COMPSIZE(pname)]
category ATI_envmap_bumpmap
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
GetTexBumpParameterivATI(pname, param)
return void
param pname GetTexBumpParameterATI in value
param param Int32 out array [COMPSIZE(pname)]
category ATI_envmap_bumpmap
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
glsflags ignore get
offset ?
GetTexBumpParameterfvATI(pname, param)
return void
param pname GetTexBumpParameterATI in value
param param Float32 out array [COMPSIZE(pname)]
category ATI_envmap_bumpmap
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
glsflags ignore get
offset ?
###############################################################################
#
# Extension #245
# ATI_fragment_shader commands
#
###############################################################################
GenFragmentShadersATI(range)
return UInt32
param range UInt32 in value
category ATI_fragment_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
BindFragmentShaderATI(id)
return void
param id UInt32 in value
category ATI_fragment_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
DeleteFragmentShaderATI(id)
return void
param id UInt32 in value
category ATI_fragment_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
BeginFragmentShaderATI()
return void
category ATI_fragment_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
EndFragmentShaderATI()
return void
category ATI_fragment_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
PassTexCoordATI(dst, coord, swizzle)
return void
param dst UInt32 in value
param coord UInt32 in value
param swizzle SwizzleOpATI in value
category ATI_fragment_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
SampleMapATI(dst, interp, swizzle)
return void
param dst UInt32 in value
param interp UInt32 in value
param swizzle SwizzleOpATI in value
category ATI_fragment_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
ColorFragmentOp1ATI(op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod)
return void
param op FragmentOpATI in value
param dst UInt32 in value
param dstMask UInt32 in value
param dstMod UInt32 in value
param arg1 UInt32 in value
param arg1Rep UInt32 in value
param arg1Mod UInt32 in value
category ATI_fragment_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
ColorFragmentOp2ATI(op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod)
return void
param op FragmentOpATI in value
param dst UInt32 in value
param dstMask UInt32 in value
param dstMod UInt32 in value
param arg1 UInt32 in value
param arg1Rep UInt32 in value
param arg1Mod UInt32 in value
param arg2 UInt32 in value
param arg2Rep UInt32 in value
param arg2Mod UInt32 in value
category ATI_fragment_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
ColorFragmentOp3ATI(op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod)
return void
param op FragmentOpATI in value
param dst UInt32 in value
param dstMask UInt32 in value
param dstMod UInt32 in value
param arg1 UInt32 in value
param arg1Rep UInt32 in value
param arg1Mod UInt32 in value
param arg2 UInt32 in value
param arg2Rep UInt32 in value
param arg2Mod UInt32 in value
param arg3 UInt32 in value
param arg3Rep UInt32 in value
param arg3Mod UInt32 in value
category ATI_fragment_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
AlphaFragmentOp1ATI(op, dst, dstMod, arg1, arg1Rep, arg1Mod)
return void
param op FragmentOpATI in value
param dst UInt32 in value
param dstMod UInt32 in value
param arg1 UInt32 in value
param arg1Rep UInt32 in value
param arg1Mod UInt32 in value
category ATI_fragment_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
AlphaFragmentOp2ATI(op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod)
return void
param op FragmentOpATI in value
param dst UInt32 in value
param dstMod UInt32 in value
param arg1 UInt32 in value
param arg1Rep UInt32 in value
param arg1Mod UInt32 in value
param arg2 UInt32 in value
param arg2Rep UInt32 in value
param arg2Mod UInt32 in value
category ATI_fragment_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
AlphaFragmentOp3ATI(op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod)
return void
param op FragmentOpATI in value
param dst UInt32 in value
param dstMod UInt32 in value
param arg1 UInt32 in value
param arg1Rep UInt32 in value
param arg1Mod UInt32 in value
param arg2 UInt32 in value
param arg2Rep UInt32 in value
param arg2Mod UInt32 in value
param arg3 UInt32 in value
param arg3Rep UInt32 in value
param arg3Mod UInt32 in value
category ATI_fragment_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
SetFragmentShaderConstantATI(dst, value)
return void
param dst UInt32 in value
param value ConstFloat32 in array [4]
category ATI_fragment_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
###############################################################################
#
# Extension #246
# ATI_pn_triangles commands
#
###############################################################################
PNTrianglesiATI(pname, param)
return void
param pname PNTrianglesPNameATI in value
param param Int32 in value
category ATI_pn_triangles
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
PNTrianglesfATI(pname, param)
return void
param pname PNTrianglesPNameATI in value
param param Float32 in value
category ATI_pn_triangles
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
###############################################################################
#
# Extension #247
# ATI_vertex_array_object commands
#
###############################################################################
NewObjectBufferATI(size, pointer, usage)
return UInt32
param size SizeI in value
param pointer ConstVoid in array [size]
param usage ArrayObjectUsageATI in value
category ATI_vertex_array_object
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
IsObjectBufferATI(buffer)
return Boolean
param buffer UInt32 in value
category ATI_vertex_array_object
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore get
offset ?
UpdateObjectBufferATI(buffer, offset, size, pointer, preserve)
return void
param buffer UInt32 in value
param offset UInt32 in value
param size SizeI in value
param pointer ConstVoid in array [size]
param preserve PreserveModeATI in value
category ATI_vertex_array_object
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
GetObjectBufferfvATI(buffer, pname, params)
return void
param buffer UInt32 in value
param pname ArrayObjectPNameATI in value
param params Float32 out array [1]
category ATI_vertex_array_object
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
glsflags ignore get
offset ?
GetObjectBufferivATI(buffer, pname, params)
return void
param buffer UInt32 in value
param pname ArrayObjectPNameATI in value
param params Int32 out array [1]
category ATI_vertex_array_object
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
glsflags ignore get
offset ?
FreeObjectBufferATI(buffer)
return void
param buffer UInt32 in value
category ATI_vertex_array_object
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
ArrayObjectATI(array, size, type, stride, buffer, offset)
return void
param array EnableCap in value
param size Int32 in value
param type ScalarType in value
param stride SizeI in value
param buffer UInt32 in value
param offset UInt32 in value
category ATI_vertex_array_object
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
GetArrayObjectfvATI(array, pname, params)
return void
param array EnableCap in value
param pname ArrayObjectPNameATI in value
param params Float32 out array [1]
category ATI_vertex_array_object
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
glsflags ignore get
offset ?
GetArrayObjectivATI(array, pname, params)
return void
param array EnableCap in value
param pname ArrayObjectPNameATI in value
param params Int32 out array [1]
category ATI_vertex_array_object
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
glsflags ignore get
offset ?
VariantArrayObjectATI(id, type, stride, buffer, offset)
return void
param id UInt32 in value
param type ScalarType in value
param stride SizeI in value
param buffer UInt32 in value
param offset UInt32 in value
category ATI_vertex_array_object
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
GetVariantArrayObjectfvATI(id, pname, params)
return void
param id UInt32 in value
param pname ArrayObjectPNameATI in value
param params Float32 out array [1]
category ATI_vertex_array_object
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
glsflags ignore get
offset ?
GetVariantArrayObjectivATI(id, pname, params)
return void
param id UInt32 in value
param pname ArrayObjectPNameATI in value
param params Int32 out array [1]
category ATI_vertex_array_object
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
glsflags ignore get
offset ?
###############################################################################
#
# Extension #248
# EXT_vertex_shader commands
#
###############################################################################
BeginVertexShaderEXT()
return void
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
EndVertexShaderEXT()
return void
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
BindVertexShaderEXT(id)
return void
param id UInt32 in value
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
GenVertexShadersEXT(range)
return UInt32
param range UInt32 in value
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
DeleteVertexShaderEXT(id)
return void
param id UInt32 in value
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
ShaderOp1EXT(op, res, arg1)
return void
param op VertexShaderOpEXT in value
param res UInt32 in value
param arg1 UInt32 in value
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
ShaderOp2EXT(op, res, arg1, arg2)
return void
param op VertexShaderOpEXT in value
param res UInt32 in value
param arg1 UInt32 in value
param arg2 UInt32 in value
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
ShaderOp3EXT(op, res, arg1, arg2, arg3)
return void
param op VertexShaderOpEXT in value
param res UInt32 in value
param arg1 UInt32 in value
param arg2 UInt32 in value
param arg3 UInt32 in value
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
SwizzleEXT(res, in, outX, outY, outZ, outW)
return void
param res UInt32 in value
param in UInt32 in value
param outX VertexShaderCoordOutEXT in value
param outY VertexShaderCoordOutEXT in value
param outZ VertexShaderCoordOutEXT in value
param outW VertexShaderCoordOutEXT in value
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
WriteMaskEXT(res, in, outX, outY, outZ, outW)
return void
param res UInt32 in value
param in UInt32 in value
param outX VertexShaderWriteMaskEXT in value
param outY VertexShaderWriteMaskEXT in value
param outZ VertexShaderWriteMaskEXT in value
param outW VertexShaderWriteMaskEXT in value
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
InsertComponentEXT(res, src, num)
return void
param res UInt32 in value
param src UInt32 in value
param num UInt32 in value
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
ExtractComponentEXT(res, src, num)
return void
param res UInt32 in value
param src UInt32 in value
param num UInt32 in value
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
GenSymbolsEXT(datatype, storagetype, range, components)
return UInt32
param datatype DataTypeEXT in value
param storagetype VertexShaderStorageTypeEXT in value
param range ParameterRangeEXT in value
param components UInt32 in value
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
SetInvariantEXT(id, type, addr)
return void
param id UInt32 in value
param type ScalarType in value
param addr Void in array [COMPSIZE(id/type)]
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
SetLocalConstantEXT(id, type, addr)
return void
param id UInt32 in value
param type ScalarType in value
param addr Void in array [COMPSIZE(id/type)]
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VariantbvEXT(id, addr)
return void
param id UInt32 in value
param addr Int8 in array [COMPSIZE(id)]
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VariantsvEXT(id, addr)
return void
param id UInt32 in value
param addr Int16 in array [COMPSIZE(id)]
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VariantivEXT(id, addr)
return void
param id UInt32 in value
param addr Int32 in array [COMPSIZE(id)]
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VariantfvEXT(id, addr)
return void
param id UInt32 in value
param addr Float32 in array [COMPSIZE(id)]
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VariantdvEXT(id, addr)
return void
param id UInt32 in value
param addr Float64 in array [COMPSIZE(id)]
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VariantubvEXT(id, addr)
return void
param id UInt32 in value
param addr UInt8 in array [COMPSIZE(id)]
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VariantusvEXT(id, addr)
return void
param id UInt32 in value
param addr UInt16 in array [COMPSIZE(id)]
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VariantuivEXT(id, addr)
return void
param id UInt32 in value
param addr UInt32 in array [COMPSIZE(id)]
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VariantPointerEXT(id, type, stride, addr)
return void
param id UInt32 in value
param type ScalarType in value
param stride UInt32 in value
param addr Void in array [COMPSIZE(id/type/stride)]
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
EnableVariantClientStateEXT(id)
return void
param id UInt32 in value
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
DisableVariantClientStateEXT(id)
return void
param id UInt32 in value
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
BindLightParameterEXT(light, value)
return UInt32
param light LightName in value
param value LightParameter in value
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
BindMaterialParameterEXT(face, value)
return UInt32
param face MaterialFace in value
param value MaterialParameter in value
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
BindTexGenParameterEXT(unit, coord, value)
return UInt32
param unit TextureUnit in value
param coord TextureCoordName in value
param value TextureGenParameter in value
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
BindTextureUnitParameterEXT(unit, value)
return UInt32
param unit TextureUnit in value
param value VertexShaderTextureUnitParameter in value
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
BindParameterEXT(value)
return UInt32
param value VertexShaderParameterEXT in value
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
IsVariantEnabledEXT(id, cap)
return Boolean
param id UInt32 in value
param cap VariantCapEXT in value
category EXT_vertex_shader
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
GetVariantBooleanvEXT(id, value, data)
return void
param id UInt32 in value
param value GetVariantValueEXT in value
param data Boolean out array [COMPSIZE(id)]
category EXT_vertex_shader
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
glsflags ignore get
offset ?
GetVariantIntegervEXT(id, value, data)
return void
param id UInt32 in value
param value GetVariantValueEXT in value
param data Int32 out array [COMPSIZE(id)]
category EXT_vertex_shader
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
glsflags ignore get
offset ?
GetVariantFloatvEXT(id, value, data)
return void
param id UInt32 in value
param value GetVariantValueEXT in value
param data Float32 out array [COMPSIZE(id)]
category EXT_vertex_shader
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
glsflags ignore get
offset ?
GetVariantPointervEXT(id, value, data)
return void
param id UInt32 in value
param value GetVariantValueEXT in value
param data VoidPointer out array [COMPSIZE(id)]
category EXT_vertex_shader
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
glsflags ignore get
offset ?
GetInvariantBooleanvEXT(id, value, data)
return void
param id UInt32 in value
param value GetVariantValueEXT in value
param data Boolean out array [COMPSIZE(id)]
category EXT_vertex_shader
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
glsflags ignore get
offset ?
GetInvariantIntegervEXT(id, value, data)
return void
param id UInt32 in value
param value GetVariantValueEXT in value
param data Int32 out array [COMPSIZE(id)]
category EXT_vertex_shader
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
glsflags ignore get
offset ?
GetInvariantFloatvEXT(id, value, data)
return void
param id UInt32 in value
param value GetVariantValueEXT in value
param data Float32 out array [COMPSIZE(id)]
category EXT_vertex_shader
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
glsflags ignore get
offset ?
GetLocalConstantBooleanvEXT(id, value, data)
return void
param id UInt32 in value
param value GetVariantValueEXT in value
param data Boolean out array [COMPSIZE(id)]
category EXT_vertex_shader
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
glsflags ignore get
offset ?
GetLocalConstantIntegervEXT(id, value, data)
return void
param id UInt32 in value
param value GetVariantValueEXT in value
param data Int32 out array [COMPSIZE(id)]
category EXT_vertex_shader
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
glsflags ignore get
offset ?
GetLocalConstantFloatvEXT(id, value, data)
return void
param id UInt32 in value
param value GetVariantValueEXT in value
param data Float32 out array [COMPSIZE(id)]
category EXT_vertex_shader
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
glsflags ignore get
offset ?
###############################################################################
#
# Extension #249
# ATI_vertex_streams commands
#
###############################################################################
VertexStream1sATI(stream, x)
return void
param stream VertexStreamATI in value
param x Int16 in value
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexStream1svATI(stream, coords)
return void
param stream VertexStreamATI in value
param coords Int16 in array [1]
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexStream1iATI(stream, x)
return void
param stream VertexStreamATI in value
param x Int32 in value
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexStream1ivATI(stream, coords)
return void
param stream VertexStreamATI in value
param coords Int32 in array [1]
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexStream1fATI(stream, x)
return void
param stream VertexStreamATI in value
param x Float32 in value
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexStream1fvATI(stream, coords)
return void
param stream VertexStreamATI in value
param coords Float32 in array [1]
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexStream1dATI(stream, x)
return void
param stream VertexStreamATI in value
param x Float64 in value
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexStream1dvATI(stream, coords)
return void
param stream VertexStreamATI in value
param coords Float64 in array [1]
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexStream2sATI(stream, x, y)
return void
param stream VertexStreamATI in value
param x Int16 in value
param y Int16 in value
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexStream2svATI(stream, coords)
return void
param stream VertexStreamATI in value
param coords Int16 in array [2]
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexStream2iATI(stream, x, y)
return void
param stream VertexStreamATI in value
param x Int32 in value
param y Int32 in value
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexStream2ivATI(stream, coords)
return void
param stream VertexStreamATI in value
param coords Int32 in array [2]
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexStream2fATI(stream, x, y)
return void
param stream VertexStreamATI in value
param x Float32 in value
param y Float32 in value
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexStream2fvATI(stream, coords)
return void
param stream VertexStreamATI in value
param coords Float32 in array [2]
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexStream2dATI(stream, x, y)
return void
param stream VertexStreamATI in value
param x Float64 in value
param y Float64 in value
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexStream2dvATI(stream, coords)
return void
param stream VertexStreamATI in value
param coords Float64 in array [2]
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexStream3sATI(stream, x, y, z)
return void
param stream VertexStreamATI in value
param x Int16 in value
param y Int16 in value
param z Int16 in value
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexStream3svATI(stream, coords)
return void
param stream VertexStreamATI in value
param coords Int16 in array [3]
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexStream3iATI(stream, x, y, z)
return void
param stream VertexStreamATI in value
param x Int32 in value
param y Int32 in value
param z Int32 in value
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexStream3ivATI(stream, coords)
return void
param stream VertexStreamATI in value
param coords Int32 in array [3]
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexStream3fATI(stream, x, y, z)
return void
param stream VertexStreamATI in value
param x Float32 in value
param y Float32 in value
param z Float32 in value
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexStream3fvATI(stream, coords)
return void
param stream VertexStreamATI in value
param coords Float32 in array [3]
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexStream3dATI(stream, x, y, z)
return void
param stream VertexStreamATI in value
param x Float64 in value
param y Float64 in value
param z Float64 in value
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexStream3dvATI(stream, coords)
return void
param stream VertexStreamATI in value
param coords Float64 in array [3]
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexStream4sATI(stream, x, y, z, w)
return void
param stream VertexStreamATI in value
param x Int16 in value
param y Int16 in value
param z Int16 in value
param w Int16 in value
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexStream4svATI(stream, coords)
return void
param stream VertexStreamATI in value
param coords Int16 in array [4]
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexStream4iATI(stream, x, y, z, w)
return void
param stream VertexStreamATI in value
param x Int32 in value
param y Int32 in value
param z Int32 in value
param w Int32 in value
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexStream4ivATI(stream, coords)
return void
param stream VertexStreamATI in value
param coords Int32 in array [4]
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexStream4fATI(stream, x, y, z, w)
return void
param stream VertexStreamATI in value
param x Float32 in value
param y Float32 in value
param z Float32 in value
param w Float32 in value
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexStream4fvATI(stream, coords)
return void
param stream VertexStreamATI in value
param coords Float32 in array [4]
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexStream4dATI(stream, x, y, z, w)
return void
param stream VertexStreamATI in value
param x Float64 in value
param y Float64 in value
param z Float64 in value
param w Float64 in value
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexStream4dvATI(stream, coords)
return void
param stream VertexStreamATI in value
param coords Float64 in array [4]
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
NormalStream3bATI(stream, nx, ny, nz)
return void
param stream VertexStreamATI in value
param nx Int8 in value
param ny Int8 in value
param nz Int8 in value
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
NormalStream3bvATI(stream, coords)
return void
param stream VertexStreamATI in value
param coords Int8 in array [3]
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
NormalStream3sATI(stream, nx, ny, nz)
return void
param stream VertexStreamATI in value
param nx Int16 in value
param ny Int16 in value
param nz Int16 in value
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
NormalStream3svATI(stream, coords)
return void
param stream VertexStreamATI in value
param coords Int16 in array [3]
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
NormalStream3iATI(stream, nx, ny, nz)
return void
param stream VertexStreamATI in value
param nx Int32 in value
param ny Int32 in value
param nz Int32 in value
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
NormalStream3ivATI(stream, coords)
return void
param stream VertexStreamATI in value
param coords Int32 in array [3]
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
NormalStream3fATI(stream, nx, ny, nz)
return void
param stream VertexStreamATI in value
param nx Float32 in value
param ny Float32 in value
param nz Float32 in value
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
NormalStream3fvATI(stream, coords)
return void
param stream VertexStreamATI in value
param coords Float32 in array [3]
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
NormalStream3dATI(stream, nx, ny, nz)
return void
param stream VertexStreamATI in value
param nx Float64 in value
param ny Float64 in value
param nz Float64 in value
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
NormalStream3dvATI(stream, coords)
return void
param stream VertexStreamATI in value
param coords Float64 in array [3]
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
ClientActiveVertexStreamATI(stream)
return void
param stream VertexStreamATI in value
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexBlendEnviATI(pname, param)
return void
param pname VertexStreamATI in value
param param Int32 in value
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
VertexBlendEnvfATI(pname, param)
return void
param pname VertexStreamATI in value
param param Float32 in value
category ATI_vertex_streams
version 1.2
extension
glxropcode ?
glxflags ignore
glsflags ignore
offset ?
###############################################################################
#
# Extension #250 - WGL_I3D_digital_video_control
# Extension #251 - WGL_I3D_gamma
# Extension #252 - WGL_I3D_genlock
# Extension #253 - WGL_I3D_image_buffer
# Extension #254 - WGL_I3D_swap_frame_lock
# Extension #255 - WGL_I3D_swap_frame_usage
#
###############################################################################
###############################################################################
#
# Extension #256
# ATI_element_array commands
#
###############################################################################
ElementPointerATI(type, pointer)
return void
param type ElementPointerTypeATI in value
param pointer Void in array [COMPSIZE(type)] retained
category ATI_element_array
dlflags notlistable
glxflags client-handcode client-intercept server-handcode
version 1.2
glsflags ignore
offset ?
DrawElementArrayATI(mode, count)
return void
param mode BeginMode in value
param count SizeI in value
category ATI_element_array
dlflags handcode
glxflags client-handcode client-intercept server-handcode
version 1.2
glsopcode ?
offset ?
DrawRangeElementArrayATI(mode, start, end, count)
return void
param mode BeginMode in value
param start UInt32 in value
param end UInt32 in value
param count SizeI in value
category ATI_element_array
dlflags handcode
glxflags client-handcode client-intercept server-handcode
version 1.2
glsopcode ?
offset ?
###############################################################################
#
# Extension #257
# SUN_mesh_array commands
#
###############################################################################
DrawMeshArraysSUN(mode, first, count, width)
return void
param mode BeginMode in value
param first Int32 in value
param count SizeI in value
param width SizeI in value
category SUN_mesh_array
dlflags handcode
glxflags client-handcode client-intercept server-handcode
version 1.1
glxropcode ?
glsopcode ?
offset ?
###############################################################################
#
# Extension #258
# SUN_slice_accum commands
#
###############################################################################
# (none)
newcategory: SUN_slice_accum
###############################################################################
#
# Extension #259
# NV_multisample_filter_hint commands
#
###############################################################################
# (none)
newcategory: NV_multisample_filter_hint
###############################################################################
#
# Extension #260
# NV_depth_clamp commands
#
###############################################################################
# (none)
newcategory: NV_depth_clamp
###############################################################################
#
# Extension #261
# NV_occlusion_query commands
#
###############################################################################
GenOcclusionQueriesNV(n, ids)
return void
param n SizeI in value
param ids UInt32 out array [n]
dlflags notlistable
category NV_occlusion_query
version 1.2
extension soft WINSOFT NV20
glsflags ignore
glxflags ignore
DeleteOcclusionQueriesNV(n, ids)
return void
param n SizeI in value
param ids UInt32 in array [n]
dlflags notlistable
category NV_occlusion_query
version 1.2
extension soft WINSOFT NV20
glsflags ignore
glxflags ignore
IsOcclusionQueryNV(id)
return Boolean
param id UInt32 in value
dlflags notlistable
category NV_occlusion_query
version 1.2
extension soft WINSOFT NV20
glsflags ignore
glxflags ignore
BeginOcclusionQueryNV(id)
return void
param id UInt32 in value
category NV_occlusion_query
version 1.2
extension soft WINSOFT NV20
glsflags ignore
glxflags ignore
EndOcclusionQueryNV()
return void
category NV_occlusion_query
version 1.2
extension soft WINSOFT NV20
glsflags ignore
glxflags ignore
GetOcclusionQueryivNV(id, pname, params)
return void
param id UInt32 in value
param pname OcclusionQueryParameterNameNV in value
param params Int32 out array [COMPSIZE(pname)]
dlflags notlistable
category NV_occlusion_query
version 1.2
extension soft WINSOFT NV20
glsflags ignore
glxflags ignore
GetOcclusionQueryuivNV(id, pname, params)
return void
param id UInt32 in value
param pname OcclusionQueryParameterNameNV in value
param params UInt32 out array [COMPSIZE(pname)]
dlflags notlistable
category NV_occlusion_query
version 1.2
extension soft WINSOFT NV20
glsflags ignore
glxflags ignore
###############################################################################
#
# Extension #262
# NV_point_sprite commands
#
###############################################################################
PointParameteriNV(pname, param)
return void
param pname PointParameterNameARB in value
param param Int32 in value
category NV_point_sprite
version 1.2
extension soft WINSOFT NV20
glxropcode 4221
alias PointParameteri
glsalias PointParameteri
PointParameterivNV(pname, params)
return void
param pname PointParameterNameARB in value
param params Int32 in array [COMPSIZE(pname)]
category NV_point_sprite
version 1.2
extension soft WINSOFT NV20
glxropcode 4222
alias PointParameteriv
glsalias PointParameteriv
###############################################################################
#
# Extension #263 - WGL_NV_render_depth_texture
# Extension #264 - WGL_NV_render_texture_rectangle
#
###############################################################################
###############################################################################
#
# Extension #265
# NV_texture_shader3 commands
#
###############################################################################
# (none)
newcategory: NV_texture_shader3
###############################################################################
#
# Extension #266
# NV_vertex_program1_1 commands
#
###############################################################################
# (none)
newcategory: NV_vertex_program1_1
###############################################################################
#
# Extension #267
# EXT_shadow_funcs commands
#
###############################################################################
# (none)
newcategory: EXT_shadow_funcs
###############################################################################
#
# Extension #268
# EXT_stencil_two_side commands
#
###############################################################################
ActiveStencilFaceEXT(face)
return void
param face StencilFaceDirection in value
category EXT_stencil_two_side
version 1.3
glxropcode 4220
glsopcode ?
offset 646
###############################################################################
#
# Extension #269
# ATI_text_fragment_shader commands
#
###############################################################################
# Uses ARB_vertex_program entry points
newcategory: ATI_text_fragment_shader
###############################################################################
#
# Extension #270
# APPLE_client_storage commands
#
###############################################################################
# (none)
newcategory: APPLE_client_storage
###############################################################################
#
# Extension #271
# APPLE_element_array commands
#
###############################################################################
# @@ Need to verify/add GLX protocol
# @@@ like #256 ATI_element_array
ElementPointerAPPLE(type, pointer)
return void
param type ElementPointerTypeATI in value
param pointer Void in array [type]
category APPLE_element_array
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
DrawElementArrayAPPLE(mode, first, count)
return void
param mode BeginMode in value
param first Int32 in value
param count SizeI in value
category APPLE_element_array
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
DrawRangeElementArrayAPPLE(mode, start, end, first, count)
return void
param mode BeginMode in value
param start UInt32 in value
param end UInt32 in value
param first Int32 in value
param count SizeI in value
category APPLE_element_array
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
MultiDrawElementArrayAPPLE(mode, first, count, primcount)
return void
param mode BeginMode in value
param first Int32 in array [primcount]
param count SizeI in array [primcount]
param primcount SizeI in value
category APPLE_element_array
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
MultiDrawRangeElementArrayAPPLE(mode, start, end, first, count, primcount)
return void
param mode BeginMode in value
param start UInt32 in value
param end UInt32 in value
param first Int32 in array [primcount]
param count SizeI in array [primcount]
param primcount SizeI in value
category APPLE_element_array
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
###############################################################################
#
# Extension #272
# APPLE_fence commands
#
###############################################################################
# @@ Need to verify/add GLX protocol
# @@@ like #222 NV_fence
GenFencesAPPLE(n, fences)
return void
param n SizeI in value
param fences FenceNV out array [n]
category APPLE_fence
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
DeleteFencesAPPLE(n, fences)
return void
param n SizeI in value
param fences FenceNV in array [n]
category APPLE_fence
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
SetFenceAPPLE(fence)
return void
param fence FenceNV in value
category APPLE_fence
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
IsFenceAPPLE(fence)
return Boolean
param fence FenceNV in value
category APPLE_fence
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
TestFenceAPPLE(fence)
return Boolean
param fence FenceNV in value
category APPLE_fence
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
FinishFenceAPPLE(fence)
return void
param fence FenceNV in value
category APPLE_fence
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
TestObjectAPPLE(object, name)
return Boolean
param object ObjectTypeAPPLE in value
param name UInt32 in value
category APPLE_fence
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
FinishObjectAPPLE(object, name)
return void
param object ObjectTypeAPPLE in value
param name Int32 in value
category APPLE_fence
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
###############################################################################
#
# Extension #273
# APPLE_vertex_array_object commands
#
###############################################################################
# @@ Need to verify/add GLX protocol
# @@@ loosely derived from incomplete SGIX_vertex_array_object
BindVertexArrayAPPLE(array)
return void
param array UInt32 in value
category APPLE_vertex_array_object
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
DeleteVertexArraysAPPLE(n, arrays)
return void
param n SizeI in value
param arrays UInt32 in array [n]
category APPLE_vertex_array_object
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
GenVertexArraysAPPLE(n, arrays)
return void
param n SizeI in value
param arrays UInt32 out array [n]
category APPLE_vertex_array_object
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
IsVertexArrayAPPLE(array)
return Boolean
param array UInt32 in value
category APPLE_vertex_array_object
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
###############################################################################
#
# Extension #274
# APPLE_vertex_array_range commands
#
###############################################################################
# @@ Need to verify/add GLX protocol
# @@@ like #190 NV_vertex_array_range,
VertexArrayRangeAPPLE(length, pointer)
return void
param length SizeI in value
param pointer Void out array [length]
category APPLE_vertex_array_range
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
FlushVertexArrayRangeAPPLE(length, pointer)
return void
param length SizeI in value
param pointer Void out array [length]
category APPLE_vertex_array_range
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
VertexArrayParameteriAPPLE(pname, param)
return void
param pname VertexArrayPNameAPPLE in value
param param Int32 in value
category APPLE_vertex_array_range
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
###############################################################################
#
# Extension #275
# APPLE_ycbcr_422 commands
#
###############################################################################
# (none)
newcategory: APPLE_ycbcr_422
###############################################################################
#
# Extension #276
# S3_s3tc commands
#
###############################################################################
# (none)
newcategory: S3_s3tc
###############################################################################
#
# Extension #277
# ATI_draw_buffers commands
#
###############################################################################
DrawBuffersATI(n, bufs)
return void
param n SizeI in value
param bufs DrawBufferModeATI in array [n]
category ATI_draw_buffers
version 1.2
extension
glxropcode 233
alias DrawBuffers
glsalias DrawBuffers
###############################################################################
#
# Extension #278 - WGL_ATI_pixel_format_float
#
###############################################################################
newcategory: ATI_pixel_format_float
passthru: /* This is really a WGL extension, but defines some associated GL enums.
passthru: * ATI does not export "GL_ATI_pixel_format_float" in the GL_EXTENSIONS string.
passthru: */
###############################################################################
#
# Extension #279
# ATI_texture_env_combine3 commands
#
###############################################################################
# (none)
newcategory: ATI_texture_env_combine3
###############################################################################
#
# Extension #280
# ATI_texture_float commands
#
###############################################################################
# (none)
newcategory: ATI_texture_float
###############################################################################
#
# Extension #281 (also WGL_NV_float_buffer)
# NV_float_buffer commands
#
###############################################################################
# (none)
newcategory: NV_float_buffer
###############################################################################
#
# Extension #282
# NV_fragment_program commands
#
###############################################################################
# @@ Need to verify/add GLX protocol
# Some NV_fragment_program entry points are shared with ARB_vertex_program,
# and are only included in that #define block, for now.
newcategory: NV_fragment_program
passthru: /* Some NV_fragment_program entry points are shared with ARB_vertex_program. */
ProgramNamedParameter4fNV(id, len, name, x, y, z, w)
return void
param id UInt32 in value
param len SizeI in value
param name UInt8 in array [1]
param x Float32 in value
param y Float32 in value
param z Float32 in value
param w Float32 in value
category NV_fragment_program
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset 682
ProgramNamedParameter4dNV(id, len, name, x, y, z, w)
return void
param id UInt32 in value
param len SizeI in value
param name UInt8 in array [1]
param x Float64 in value
param y Float64 in value
param z Float64 in value
param w Float64 in value
category NV_fragment_program
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset 683
ProgramNamedParameter4fvNV(id, len, name, v)
return void
param id UInt32 in value
param len SizeI in value
param name UInt8 in array [1]
param v Float32 in array [4]
category NV_fragment_program
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset 684
ProgramNamedParameter4dvNV(id, len, name, v)
return void
param id UInt32 in value
param len SizeI in value
param name UInt8 in array [1]
param v Float64 in array [4]
category NV_fragment_program
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset 685
GetProgramNamedParameterfvNV(id, len, name, params)
return void
param id UInt32 in value
param len SizeI in value
param name UInt8 in array [1]
param params Float32 out array [4]
category NV_fragment_program
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
glsflags get
glsopcode ?
offset 686
GetProgramNamedParameterdvNV(id, len, name, params)
return void
param id UInt32 in value
param len SizeI in value
param name UInt8 in array [1]
param params Float64 out array [4]
category NV_fragment_program
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
glsflags get
glsopcode ?
offset 687
###############################################################################
#
# Extension #283
# NV_half_float commands
#
###############################################################################
# @@ Need to verify/add GLX protocol
Vertex2hNV(x, y)
return void
param x Half16NV in value
param y Half16NV in value
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
Vertex2hvNV(v)
return void
param v Half16NV in array [2]
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
Vertex3hNV(x, y, z)
return void
param x Half16NV in value
param y Half16NV in value
param z Half16NV in value
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
Vertex3hvNV(v)
return void
param v Half16NV in array [3]
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
Vertex4hNV(x, y, z, w)
return void
param x Half16NV in value
param y Half16NV in value
param z Half16NV in value
param w Half16NV in value
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
Vertex4hvNV(v)
return void
param v Half16NV in array [4]
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
Normal3hNV(nx, ny, nz)
return void
param nx Half16NV in value
param ny Half16NV in value
param nz Half16NV in value
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
Normal3hvNV(v)
return void
param v Half16NV in array [3]
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
Color3hNV(red, green, blue)
return void
param red Half16NV in value
param green Half16NV in value
param blue Half16NV in value
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
Color3hvNV(v)
return void
param v Half16NV in array [3]
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
Color4hNV(red, green, blue, alpha)
return void
param red Half16NV in value
param green Half16NV in value
param blue Half16NV in value
param alpha Half16NV in value
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
Color4hvNV(v)
return void
param v Half16NV in array [4]
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
TexCoord1hNV(s)
return void
param s Half16NV in value
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
TexCoord1hvNV(v)
return void
param v Half16NV in array [1]
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
TexCoord2hNV(s, t)
return void
param s Half16NV in value
param t Half16NV in value
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
TexCoord2hvNV(v)
return void
param v Half16NV in array [2]
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
TexCoord3hNV(s, t, r)
return void
param s Half16NV in value
param t Half16NV in value
param r Half16NV in value
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
TexCoord3hvNV(v)
return void
param v Half16NV in array [3]
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
TexCoord4hNV(s, t, r, q)
return void
param s Half16NV in value
param t Half16NV in value
param r Half16NV in value
param q Half16NV in value
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
TexCoord4hvNV(v)
return void
param v Half16NV in array [4]
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
MultiTexCoord1hNV(target, s)
return void
param target TextureUnit in value
param s Half16NV in value
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
MultiTexCoord1hvNV(target, v)
return void
param target TextureUnit in value
param v Half16NV in array [1]
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
MultiTexCoord2hNV(target, s, t)
return void
param target TextureUnit in value
param s Half16NV in value
param t Half16NV in value
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
MultiTexCoord2hvNV(target, v)
return void
param target TextureUnit in value
param v Half16NV in array [2]
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
MultiTexCoord3hNV(target, s, t, r)
return void
param target TextureUnit in value
param s Half16NV in value
param t Half16NV in value
param r Half16NV in value
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
MultiTexCoord3hvNV(target, v)
return void
param target TextureUnit in value
param v Half16NV in array [3]
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
MultiTexCoord4hNV(target, s, t, r, q)
return void
param target TextureUnit in value
param s Half16NV in value
param t Half16NV in value
param r Half16NV in value
param q Half16NV in value
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
MultiTexCoord4hvNV(target, v)
return void
param target TextureUnit in value
param v Half16NV in array [4]
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
FogCoordhNV(fog)
return void
param fog Half16NV in value
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
FogCoordhvNV(fog)
return void
param fog Half16NV in array [1]
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
SecondaryColor3hNV(red, green, blue)
return void
param red Half16NV in value
param green Half16NV in value
param blue Half16NV in value
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
SecondaryColor3hvNV(v)
return void
param v Half16NV in array [3]
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
VertexWeighthNV(weight)
return void
param weight Half16NV in value
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
VertexWeighthvNV(weight)
return void
param weight Half16NV in array [1]
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
VertexAttrib1hNV(index, x)
return void
param index UInt32 in value
param x Half16NV in value
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
VertexAttrib1hvNV(index, v)
return void
param index UInt32 in value
param v Half16NV in array [1]
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
VertexAttrib2hNV(index, x, y)
return void
param index UInt32 in value
param x Half16NV in value
param y Half16NV in value
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
VertexAttrib2hvNV(index, v)
return void
param index UInt32 in value
param v Half16NV in array [2]
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
VertexAttrib3hNV(index, x, y, z)
return void
param index UInt32 in value
param x Half16NV in value
param y Half16NV in value
param z Half16NV in value
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
VertexAttrib3hvNV(index, v)
return void
param index UInt32 in value
param v Half16NV in array [3]
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
VertexAttrib4hNV(index, x, y, z, w)
return void
param index UInt32 in value
param x Half16NV in value
param y Half16NV in value
param z Half16NV in value
param w Half16NV in value
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
VertexAttrib4hvNV(index, v)
return void
param index UInt32 in value
param v Half16NV in array [4]
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
VertexAttribs1hvNV(index, n, v)
return void
param index UInt32 in value
param n SizeI in value
param v Half16NV in array [n]
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
VertexAttribs2hvNV(index, n, v)
return void
param index UInt32 in value
param n SizeI in value
param v Half16NV in array [n]
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
VertexAttribs3hvNV(index, n, v)
return void
param index UInt32 in value
param n SizeI in value
param v Half16NV in array [n]
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
VertexAttribs4hvNV(index, n, v)
return void
param index UInt32 in value
param n SizeI in value
param v Half16NV in array [n]
category NV_half_float
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
###############################################################################
#
# Extension #284
# NV_pixel_data_range commands
#
###############################################################################
# @@ Need to verify/add GLX protocol
PixelDataRangeNV(target, length, pointer)
return void
param target PixelDataRangeTargetNV in value
param length SizeI in value
param pointer Void out array [length]
category NV_pixel_data_range
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
FlushPixelDataRangeNV(target)
return void
param target PixelDataRangeTargetNV in value
category NV_pixel_data_range
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
###############################################################################
#
# Extension #285
# NV_primitive_restart commands
#
###############################################################################
# @@ Need to verify/add GLX protocol
PrimitiveRestartNV()
return void
category NV_primitive_restart
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
PrimitiveRestartIndexNV(index)
return void
param index UInt32 in value
category NV_primitive_restart
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
###############################################################################
#
# Extension #286
# NV_texture_expand_normal commands
#
###############################################################################
# (none)
newcategory: NV_texture_expand_normal
###############################################################################
#
# Extension #287
# NV_vertex_program2 commands
#
###############################################################################
# (none)
newcategory: NV_vertex_program2
###############################################################################
#
# Extension #288
# ATI_map_object_buffer commands
#
###############################################################################
# @@ Need to verify/add GLX protocol
MapObjectBufferATI(buffer)
return VoidPointer
param buffer UInt32 in value
category ATI_map_object_buffer
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
UnmapObjectBufferATI(buffer)
return void
param buffer UInt32 in value
category ATI_map_object_buffer
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
###############################################################################
#
# Extension #289
# ATI_separate_stencil commands
#
###############################################################################
# @@ Need to verify/add GLX protocol
StencilOpSeparateATI(face, sfail, dpfail, dppass)
return void
param face StencilFaceDirection in value
param sfail StencilOp in value
param dpfail StencilOp in value
param dppass StencilOp in value
category ATI_separate_stencil
version 1.2
extension
glxropcode ?
glxflags ignore
alias StencilOpSeparate
glsalias StencilOpSeparate
StencilFuncSeparateATI(frontfunc, backfunc, ref, mask)
return void
param frontfunc StencilFunction in value
param backfunc StencilFunction in value
param ref ClampedStencilValue in value
param mask MaskedStencilValue in value
category ATI_separate_stencil
version 1.2
extension
glxropcode ?
glxflags ignore
alias StencilFuncSeparate
glsalias StencilFuncSeparate
###############################################################################
#
# Extension #290
# ATI_vertex_attrib_array_object commands
#
###############################################################################
# @@ Need to verify/add GLX protocol
VertexAttribArrayObjectATI(index, size, type, normalized, stride, buffer, offset)
return void
param index UInt32 in value
param size Int32 in value
param type VertexAttribPointerTypeARB in value
param normalized Boolean in value
param stride SizeI in value
param buffer UInt32 in value
param offset UInt32 in value
category ATI_vertex_attrib_array_object
version 1.2
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
GetVertexAttribArrayObjectfvATI(index, pname, params)
return void
param index UInt32 in value
param pname ArrayObjectPNameATI in value
param params Float32 out array [pname]
category ATI_vertex_attrib_array_object
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
glsflags get
glsopcode ?
offset ?
GetVertexAttribArrayObjectivATI(index, pname, params)
return void
param index UInt32 in value
param pname ArrayObjectPNameATI in value
param params Int32 out array [pname]
category ATI_vertex_attrib_array_object
dlflags notlistable
version 1.2
extension
glxsingle ?
glxflags ignore
glsflags get
glsopcode ?
offset ?
###############################################################################
#
# Extension #291 - OpenGL ES only, not in glext.h
# OES_byte_coordinates commands
#
###############################################################################
# void Vertex{234}bOES(T coords)
# void Vertex{234}bvOES(T *coords)
# void TexCoord{1234}bOES(T coords)
# void TexCoord{1234}bvOES(T *coords)
# void MultiTexCoord{1234}bOES(enum texture, T coords)
# void MultiTexCoord{1234}bvOES(enum texture, T *coords)
# All are handcode - mapped to non-byte GLX protocol on client side
# newcategory: OES_byte_coordinates
###############################################################################
#
# Extension #292 - OpenGL ES only, not in glext.h
# OES_fixed_point commands
#
###############################################################################
# Too many to list in just a comment - see spec in the extension registry
# All are handcode - mapped to non-byte GLX protocol on client side
# newcategory: OES_fixed_point
###############################################################################
#
# Extension #293 - OpenGL ES only, not in glext.h
# OES_single_precision commands
#
###############################################################################
# void DepthRangefOES(clampf n, clampf f)
# void FrustumfOES(float l, float r, float b, float t, float n, float f)
# void OrthofOES(float l, float r, float b, float t, float n, float f)
# void ClipPlanefOES(enum plane, const float* equation)
# void glClearDepthfOES(clampd depth)
# GLX ropcodes 4308-4312 (not respectively, see extension spec)
# void GetClipPlanefOES(enum plane, float* equation)
# GLX vendor private 1421
# newcategory: OES_single_precision
###############################################################################
#
# Extension #294 - OpenGL ES only, not in glext.h
# OES_compressed_paletted_texture commands
#
###############################################################################
# (none)
# newcategory: OES_compressed_paletted_texture
###############################################################################
#
# Extension #295 - This is an OpenGL ES extension, but also implemented in Mesa
# OES_read_format commands
#
###############################################################################
# (none)
newcategory: OES_read_format
###############################################################################
#
# Extension #296 - OpenGL ES only, not in glext.h
# OES_query_matrix commands
#
###############################################################################
# bitfield queryMatrixxOES(fixed mantissa[16], int exponent[16])
# All are handcode - mapped to non-byte GLX protocol on client side
# newcategory: OES_query_matrix
###############################################################################
#
# Extension #297
# EXT_depth_bounds_test commands
#
###############################################################################
DepthBoundsEXT(zmin, zmax)
return void
param zmin ClampedFloat64 in value
param zmax ClampedFloat64 in value
category EXT_depth_bounds_test
version 1.2
extension
glxropcode 4229
glsopcode ?
offset 699
###############################################################################
#
# Extension #298
# EXT_texture_mirror_clamp commands
#
###############################################################################
# (none)
newcategory: EXT_texture_mirror_clamp
###############################################################################
#
# Extension #299
# EXT_blend_equation_separate commands
#
###############################################################################
BlendEquationSeparateEXT(modeRGB, modeAlpha)
return void
param modeRGB BlendEquationModeEXT in value
param modeAlpha BlendEquationModeEXT in value
category EXT_blend_equation_separate
version 1.2
extension
glxropcode 4228
alias BlendEquationSeparate
glsalias BlendEquationSeparate
###############################################################################
#
# Extension #300
# MESA_pack_invert commands
#
###############################################################################
# (none)
newcategory: MESA_pack_invert
###############################################################################
#
# Extension #301
# MESA_ycbcr_texture commands
#
###############################################################################
# (none)
newcategory: MESA_ycbcr_texture
###############################################################################
#
# Extension #301
# MESA_ycbcr_texture commands
#
###############################################################################
# (none)
newcategory: MESA_ycbcr_texture
###############################################################################
#
# Extension #302
# EXT_pixel_buffer_object commands
#
###############################################################################
# (none)
newcategory: EXT_pixel_buffer_object
###############################################################################
#
# Extension #303
# NV_fragment_program_option commands
#
###############################################################################
# (none)
newcategory: NV_fragment_program_option
###############################################################################
#
# Extension #304
# NV_fragment_program2 commands
#
###############################################################################
# (none)
newcategory: NV_fragment_program2
###############################################################################
#
# Extension #305
# NV_vertex_program2_option commands
#
###############################################################################
# (none)
newcategory: NV_vertex_program2_option
###############################################################################
#
# Extension #306
# NV_vertex_program3 commands
#
###############################################################################
# (none)
newcategory: NV_vertex_program3
###############################################################################
#
# Extension #307 - GLX_SGIX_hyperpipe commands
# Extension #308 - GLX_MESA_agp_offset commands
# Extension #309 - GL_EXT_texture_compression_dxt1 (OpenGL ES only, subset of _st3c version)
#
###############################################################################
###############################################################################
#
# Extension #310
# EXT_framebuffer_object commands
#
###############################################################################
IsRenderbufferEXT(renderbuffer)
return Boolean
param renderbuffer UInt32 in value
category EXT_framebuffer_object
version 1.2
extension
glxvendorpriv 1422
glxflags ignore
glsopcode ?
offset ?
BindRenderbufferEXT(target, renderbuffer)
return void
param target RenderbufferTarget in value
param renderbuffer UInt32 in value
category EXT_framebuffer_object
version 1.2
extension
glxropcode 4316
glxflags ignore
glsopcode ?
offset ?
DeleteRenderbuffersEXT(n, renderbuffers)
return void
param n SizeI in value
param renderbuffers UInt32 in array [n]
category EXT_framebuffer_object
version 1.2
extension
glxropcode 4317
glxflags ignore
glsopcode ?
offset ?
GenRenderbuffersEXT(n, renderbuffers)
return void
param n SizeI in value
param renderbuffers UInt32 out array [n]
category EXT_framebuffer_object
version 1.2
extension
glxvendorpriv 1423
glxflags ignore
glsopcode ?
offset ?
RenderbufferStorageEXT(target, internalformat, width, height)
return void
param target RenderbufferTarget in value
param internalformat GLenum in value
param width SizeI in value
param height SizeI in value
category EXT_framebuffer_object
version 1.2
extension
glxropcode 4318
glxflags ignore
glsopcode ?
offset ?
GetRenderbufferParameterivEXT(target, pname, params)
return void
param target RenderbufferTarget in value
param pname GLenum in value
param params Int32 out array [COMPSIZE(pname)]
category EXT_framebuffer_object
dlflags notlistable
version 1.2
extension
glxvendorpriv 1424
glxflags ignore
glsflags get
glsopcode ?
offset ?
IsFramebufferEXT(framebuffer)
return Boolean
param framebuffer UInt32 in value
category EXT_framebuffer_object
version 1.2
extension
glxvendorpriv 1425
glxflags ignore
glsopcode ?
offset ?
BindFramebufferEXT(target, framebuffer)
return void
param target FramebufferTarget in value
param framebuffer UInt32 in value
category EXT_framebuffer_object
version 1.2
extension
glxropcode 4319
glxflags ignore
glsopcode ?
offset ?
DeleteFramebuffersEXT(n, framebuffers)
return void
param n SizeI in value
param framebuffers UInt32 in array [n]
category EXT_framebuffer_object
version 1.2
extension
glxropcode 4320
glxflags ignore
glsopcode ?
offset ?
GenFramebuffersEXT(n, framebuffers)
return void
param n SizeI in value
param framebuffers UInt32 out array [n]
category EXT_framebuffer_object
version 1.2
extension
glxvendorpriv 1426
glxflags ignore
glsopcode ?
offset ?
CheckFramebufferStatusEXT(target)
return GLenum
param target FramebufferTarget in value
category EXT_framebuffer_object
version 1.2
extension
glxvendorpriv 1427
glxflags ignore
glsopcode ?
offset ?
FramebufferTexture1DEXT(target, attachment, textarget, texture, level)
return void
param target FramebufferTarget in value
param attachment FramebufferAttachment in value
param textarget GLenum in value
param texture UInt32 in value
param level Int32 in value
category EXT_framebuffer_object
version 1.2
extension
glxropcode 4321
glxflags ignore
glsopcode ?
offset ?
FramebufferTexture2DEXT(target, attachment, textarget, texture, level)
return void
param target FramebufferTarget in value
param attachment FramebufferAttachment in value
param textarget GLenum in value
param texture UInt32 in value
param level Int32 in value
category EXT_framebuffer_object
version 1.2
extension
glxropcode 4322
glxflags ignore
glsopcode ?
offset ?
FramebufferTexture3DEXT(target, attachment, textarget, texture, level, zoffset)
return void
param target FramebufferTarget in value
param attachment FramebufferAttachment in value
param textarget GLenum in value
param texture UInt32 in value
param level Int32 in value
param zoffset Int32 in value
category EXT_framebuffer_object
version 1.2
extension
glxropcode 4323
glxflags ignore
glsopcode ?
offset ?
FramebufferRenderbufferEXT(target, attachment, renderbuffertarget, renderbuffer)
return void
param target FramebufferTarget in value
param attachment FramebufferAttachment in value
param renderbuffertarget RenderbufferTarget in value
param renderbuffer UInt32 in value
category EXT_framebuffer_object
version 1.2
extension
glxropcode 4324
glxflags ignore
glsopcode ?
offset ?
GetFramebufferAttachmentParameterivEXT(target, attachment, pname, params)
return void
param target FramebufferTarget in value
param attachment FramebufferAttachment in value
param pname GLenum in value
param params Int32 out array [COMPSIZE(pname)]
category EXT_framebuffer_object
dlflags notlistable
version 1.2
extension
glxvendorpriv 1428
glxflags ignore
glsflags get
glsopcode ?
offset ?
GenerateMipmapEXT(target)
return void
param target GLenum in value
category EXT_framebuffer_object
version 1.2
extension
glxropcode 4325
glxflags ignore
glsopcode ?
offset ?
###############################################################################
#
# Extension #311
# GREMEDY_string_marker commands
#
###############################################################################
StringMarkerGREMEDY(len, string)
return void
param len SizeI in value
param string Void in array [len]
category GREMEDY_string_marker
version 1.0
extension
glsflags ignore
glxflags ignore
offset ?
###############################################################################
#
# Extension #312
# EXT_packed_depth_stencil commands
#
###############################################################################
# (none)
newcategory: EXT_packed_depth_stencil
###############################################################################
#
# Extension #313 - WGL_3DL_stereo_control
#
###############################################################################
###############################################################################
#
# Extension #314
# EXT_stencil_clear_tag commands
#
###############################################################################
StencilClearTagEXT(stencilTagBits, stencilClearTag)
return void
param stencilTagBits SizeI in value
param stencilClearTag UInt32 in value
category EXT_stencil_clear_tag
version 1.5
extension
glxropcode 4223
glxflags ignore
glsopcode ?
offset ?
###############################################################################
#
# Extension #315
# EXT_texture_sRGB commands
#
###############################################################################
# (none)
newcategory: EXT_texture_sRGB
###############################################################################
#
# Extension #316
# EXT_framebuffer_blit commands
#
###############################################################################
BlitFramebufferEXT(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter)
return void
param srcX0 Int32 in value
param srcY0 Int32 in value
param srcX1 Int32 in value
param srcY1 Int32 in value
param dstX0 Int32 in value
param dstY0 Int32 in value
param dstX1 Int32 in value
param dstY1 Int32 in value
param mask ClearBufferMask in value
param filter GLenum in value
category EXT_framebuffer_blit
version 1.5
glxropcode 4330
glsopcode ?
offset ?
###############################################################################
#
# Extension #317
# EXT_framebuffer_multisample commands
#
###############################################################################
RenderbufferStorageMultisampleEXT(target, samples, internalformat, width, height)
return void
param target GLenum in value
param samples SizeI in value
param internalformat GLenum in value
param width SizeI in value
param height SizeI in value
category EXT_framebuffer_multisample
version 1.5
glxropcode 4331
glsopcode ?
offset ?
###############################################################################
#
# Extension #318
# MESAX_texture_stack commands
#
###############################################################################
# (none)
newcategory: MESAX_texture_stack
###############################################################################
#
# Extension #319
# EXT_timer_query commands
#
###############################################################################
GetQueryObjecti64vEXT(id, pname, params)
return void
param id UInt32 in value
param pname GLenum in value
param params Int64EXT out array [pname]
category EXT_timer_query
dlflags notlistable
version 1.5
glxvendorpriv 1328
glxflags ignore
glsflags get
glsopcode ?
offset ?
GetQueryObjectui64vEXT(id, pname, params)
return void
param id UInt32 in value
param pname GLenum in value
param params UInt64EXT out array [pname]
category EXT_timer_query
dlflags notlistable
version 1.5
glxvendorpriv 1329
glxflags ignore
glsflags get
glsopcode ?
offset ?
###############################################################################
#
# Extension #320
# EXT_gpu_program_parameters commands
#
###############################################################################
ProgramEnvParameters4fvEXT(target, index, count, params)
return void
param target ProgramTargetARB in value
param index UInt32 in value
param count SizeI in value
param params Float32 in array [count*4]
category EXT_gpu_program_parameters
version 1.2
glxropcode 4281
glsopcode ?
offset ?
ProgramLocalParameters4fvEXT(target, index, count, params)
return void
param target ProgramTargetARB in value
param index UInt32 in value
param count SizeI in value
param params Float32 in array [count*4]
category EXT_gpu_program_parameters
version 1.2
glxropcode 4282
glsopcode ?
offset ?
###############################################################################
#
# Extension #321
# APPLE_flush_buffer_range commands
#
###############################################################################
BufferParameteriAPPLE(target, pname, param)
return void
param target GLenum in value
param pname GLenum in value
param param Int32 in value
category APPLE_flush_buffer_range
version 1.5
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
FlushMappedBufferRangeAPPLE(target, offset, size)
return void
param target GLenum in value
param offset BufferOffset in value
param size BufferSize in value
category APPLE_flush_buffer_range
version 1.5
extension
glxropcode ?
glxflags ignore
glsopcode ?
offset ?
###############################################################################
#
# Extension #322
# NV_gpu_program4 commands
#
###############################################################################
ProgramLocalParameterI4iNV(target, index, x, y, z, w)
return void
param target ProgramTarget in value
param index UInt32 in value
param x Int32 in value
param y Int32 in value
param z Int32 in value
param w Int32 in value
category NV_gpu_program4
version 1.3
vectorequiv ProgramLocalParameterI4ivNV
glxvectorequiv ProgramLocalParameterI4ivNV
extension soft WINSOFT NV50
glfflags ignore
glsflags ignore
glxflags ignore
ProgramLocalParameterI4ivNV(target, index, params)
return void
param target ProgramTarget in value
param index UInt32 in value
param params Int32 in array [4]
category NV_gpu_program4
version 1.3
extension soft WINSOFT NV50
glfflags ignore
glsflags ignore
glxflags ignore
ProgramLocalParametersI4ivNV(target, index, count, params)
return void
param target ProgramTarget in value
param index UInt32 in value
param count SizeI in value
param params Int32 in array [count*4]
category NV_gpu_program4
version 1.3
extension soft WINSOFT NV50
glfflags ignore
glsflags ignore
glxflags ignore
ProgramLocalParameterI4uiNV(target, index, x, y, z, w)
return void
param target ProgramTarget in value
param index UInt32 in value
param x UInt32 in value
param y UInt32 in value
param z UInt32 in value
param w UInt32 in value
category NV_gpu_program4
version 1.3
vectorequiv ProgramLocalParameterI4uivNV
glxvectorequiv ProgramLocalParameterI4uivNV
extension soft WINSOFT NV50
glfflags ignore
glsflags ignore
glxflags ignore
ProgramLocalParameterI4uivNV(target, index, params)
return void
param target ProgramTarget in value
param index UInt32 in value
param params UInt32 in array [4]
category NV_gpu_program4
version 1.3
extension soft WINSOFT NV50
glfflags ignore
glsflags ignore
glxflags ignore
ProgramLocalParametersI4uivNV(target, index, count, params)
return void
param target ProgramTarget in value
param index UInt32 in value
param count SizeI in value
param params UInt32 in array [count*4]
category NV_gpu_program4
version 1.3
extension soft WINSOFT NV50
glfflags ignore
glsflags ignore
glxflags ignore
ProgramEnvParameterI4iNV(target, index, x, y, z, w)
return void
param target ProgramTarget in value
param index UInt32 in value
param x Int32 in value
param y Int32 in value
param z Int32 in value
param w Int32 in value
category NV_gpu_program4
version 1.3
vectorequiv ProgramEnvParameterI4ivNV
glxvectorequiv ProgramEnvParameterI4ivNV
extension soft WINSOFT NV50
glfflags ignore
glsflags ignore
glxflags ignore
ProgramEnvParameterI4ivNV(target, index, params)
return void
param target ProgramTarget in value
param index UInt32 in value
param params Int32 in array [4]
category NV_gpu_program4
version 1.3
extension soft WINSOFT NV50
glfflags ignore
glsflags ignore
glxflags ignore
ProgramEnvParametersI4ivNV(target, index, count, params)
return void
param target ProgramTarget in value
param index UInt32 in value
param count SizeI in value
param params Int32 in array [count*4]
category NV_gpu_program4
version 1.3
extension soft WINSOFT NV50
glfflags ignore
glsflags ignore
glxflags ignore
ProgramEnvParameterI4uiNV(target, index, x, y, z, w)
return void
param target ProgramTarget in value
param index UInt32 in value
param x UInt32 in value
param y UInt32 in value
param z UInt32 in value
param w UInt32 in value
category NV_gpu_program4
version 1.3
vectorequiv ProgramEnvParameterI4uivNV
glxvectorequiv ProgramEnvParameterI4uivNV
extension soft WINSOFT NV50
glfflags ignore
glsflags ignore
glxflags ignore
ProgramEnvParameterI4uivNV(target, index, params)
return void
param target ProgramTarget in value
param index UInt32 in value
param params UInt32 in array [4]
category NV_gpu_program4
version 1.3
extension soft WINSOFT NV50
glfflags ignore
glsflags ignore
glxflags ignore
ProgramEnvParametersI4uivNV(target, index, count, params)
return void
param target ProgramTarget in value
param index UInt32 in value
param count SizeI in value
param params UInt32 in array [count*4]
category NV_gpu_program4
version 1.3
extension soft WINSOFT NV50
glfflags ignore
glsflags ignore
glxflags ignore
GetProgramLocalParameterIivNV(target, index, params)
return void
param target ProgramTarget in value
param index UInt32 in value
param params Int32 out array [4]
dlflags notlistable
category NV_gpu_program4
version 1.3
extension soft WINSOFT NV50
glfflags ignore
glsflags ignore
glxflags ignore
GetProgramLocalParameterIuivNV(target, index, params)
return void
param target ProgramTarget in value
param index UInt32 in value
param params UInt32 out array [4]
dlflags notlistable
category NV_gpu_program4
version 1.3
extension soft WINSOFT NV50
glfflags ignore
glsflags ignore
glxflags ignore
GetProgramEnvParameterIivNV(target, index, params)
return void
param target ProgramTarget in value
param index UInt32 in value
param params Int32 out array [4]
dlflags notlistable
category NV_gpu_program4
version 1.3
extension soft WINSOFT NV50
glfflags ignore
glsflags ignore
glxflags ignore
GetProgramEnvParameterIuivNV(target, index, params)
return void
param target ProgramTarget in value
param index UInt32 in value
param params UInt32 out array [4]
dlflags notlistable
category NV_gpu_program4
version 1.3
extension soft WINSOFT NV50
glfflags ignore
glsflags ignore
glxflags ignore
###############################################################################
#
# Extension #323
# NV_geometry_program4 commands
#
###############################################################################
ProgramVertexLimitNV(target, limit)
return void
param target ProgramTarget in value
param limit Int32 in value
category NV_geometry_program4
version 2.0
extension soft WINSOFT
glfflags ignore
glsflags ignore
glxflags ignore
FramebufferTextureEXT(target, attachment, texture, level)
return void
param target FramebufferTarget in value
param attachment FramebufferAttachment in value
param texture Texture in value
param level CheckedInt32 in value
category NV_geometry_program4
version 2.0
extension soft WINSOFT
dlflags notlistable
glfflags ignore
glsflags ignore
glxflags ignore
FramebufferTextureLayerEXT(target, attachment, texture, level, layer)
return void
param target FramebufferTarget in value
param attachment FramebufferAttachment in value
param texture Texture in value
param level CheckedInt32 in value
param layer CheckedInt32 in value
category NV_geometry_program4
version 2.0
extension soft WINSOFT
dlflags notlistable
glfflags ignore
glsflags ignore
glxflags ignore
FramebufferTextureFaceEXT(target, attachment, texture, level, face)
return void
param target FramebufferTarget in value
param attachment FramebufferAttachment in value
param texture Texture in value
param level CheckedInt32 in value
param face TextureTarget in value
category NV_geometry_program4
version 2.0
extension soft WINSOFT
dlflags notlistable
glfflags ignore
glsflags ignore
glxflags ignore
###############################################################################
#
# Extension #324
# EXT_geometry_shader4 commands
#
###############################################################################
ProgramParameteriEXT(program, pname, value)
return void
param program UInt32 in value
param pname ProgramParameterPName in value
param value Int32 in value
category EXT_geometry_shader4
version 2.0
extension soft WINSOFT
glfflags ignore
glsflags ignore
glxflags ignore
###############################################################################
#
# Extension #325
# NV_vertex_program4 commands
#
###############################################################################
VertexAttribI1iEXT(index, x)
return void
param index UInt32 in value
param x Int32 in value
category NV_vertex_program4
beginend allow-inside
vectorequiv VertexAttribI1ivEXT
glxvectorequiv VertexAttribI1ivEXT
extension soft WINSOFT NV10
glfflags ignore
glsflags ignore
glxflags ignore
VertexAttribI2iEXT(index, x, y)
return void
param index UInt32 in value
param x Int32 in value
param y Int32 in value
category NV_vertex_program4
beginend allow-inside
vectorequiv VertexAttribI2ivEXT
glxvectorequiv VertexAttribI2ivEXT
extension soft WINSOFT NV10
glfflags ignore
glsflags ignore
glxflags ignore
VertexAttribI3iEXT(index, x, y, z)
return void
param index UInt32 in value
param x Int32 in value
param y Int32 in value
param z Int32 in value
category NV_vertex_program4
beginend allow-inside
vectorequiv VertexAttribI3ivEXT
glxvectorequiv VertexAttribI3ivEXT
extension soft WINSOFT NV10
glfflags ignore
glsflags ignore
glxflags ignore
VertexAttribI4iEXT(index, x, y, z, w)
return void
param index UInt32 in value
param x Int32 in value
param y Int32 in value
param z Int32 in value
param w Int32 in value
category NV_vertex_program4
beginend allow-inside
vectorequiv VertexAttribI4ivEXT
glxvectorequiv VertexAttribI4ivEXT
extension soft WINSOFT NV10
glfflags ignore
glsflags ignore
glxflags ignore
VertexAttribI1uiEXT(index, x)
return void
param index UInt32 in value
param x UInt32 in value
category NV_vertex_program4
beginend allow-inside
vectorequiv VertexAttribI1uivEXT
glxvectorequiv VertexAttribI1uivEXT
extension soft WINSOFT NV10
glfflags ignore
glsflags ignore
glxflags ignore
VertexAttribI2uiEXT(index, x, y)
return void
param index UInt32 in value
param x UInt32 in value
param y UInt32 in value
category NV_vertex_program4
beginend allow-inside
vectorequiv VertexAttribI2uivEXT
glxvectorequiv VertexAttribI2uivEXT
extension soft WINSOFT NV10
glfflags ignore
glsflags ignore
glxflags ignore
VertexAttribI3uiEXT(index, x, y, z)
return void
param index UInt32 in value
param x UInt32 in value
param y UInt32 in value
param z UInt32 in value
category NV_vertex_program4
beginend allow-inside
vectorequiv VertexAttribI3uivEXT
glxvectorequiv VertexAttribI3uivEXT
extension soft WINSOFT NV10
glfflags ignore
glsflags ignore
glxflags ignore
VertexAttribI4uiEXT(index, x, y, z, w)
return void
param index UInt32 in value
param x UInt32 in value
param y UInt32 in value
param z UInt32 in value
param w UInt32 in value
category NV_vertex_program4
beginend allow-inside
vectorequiv VertexAttribI4uivEXT
glxvectorequiv VertexAttribI4uivEXT
extension soft WINSOFT NV10
glfflags ignore
glsflags ignore
glxflags ignore
VertexAttribI1ivEXT(index, v)
return void
param index UInt32 in value
param v Int32 in array [1]
category NV_vertex_program4
beginend allow-inside
extension soft WINSOFT NV10
glfflags ignore
glsflags ignore
glxflags ignore
VertexAttribI2ivEXT(index, v)
return void
param index UInt32 in value
param v Int32 in array [2]
category NV_vertex_program4
beginend allow-inside
extension soft WINSOFT NV10
glfflags ignore
glsflags ignore
glxflags ignore
VertexAttribI3ivEXT(index, v)
return void
param index UInt32 in value
param v Int32 in array [3]
category NV_vertex_program4
beginend allow-inside
extension soft WINSOFT NV10
glfflags ignore
glsflags ignore
glxflags ignore
VertexAttribI4ivEXT(index, v)
return void
param index UInt32 in value
param v Int32 in array [4]
category NV_vertex_program4
beginend allow-inside
extension soft WINSOFT NV10
glfflags ignore
glsflags ignore
glxflags ignore
VertexAttribI1uivEXT(index, v)
return void
param index UInt32 in value
param v UInt32 in array [1]
category NV_vertex_program4
beginend allow-inside
extension soft WINSOFT NV10
glfflags ignore
glsflags ignore
glxflags ignore
VertexAttribI2uivEXT(index, v)
return void
param index UInt32 in value
param v UInt32 in array [2]
category NV_vertex_program4
beginend allow-inside
extension soft WINSOFT NV10
glfflags ignore
glsflags ignore
glxflags ignore
VertexAttribI3uivEXT(index, v)
return void
param index UInt32 in value
param v UInt32 in array [3]
category NV_vertex_program4
beginend allow-inside
extension soft WINSOFT NV10
glfflags ignore
glsflags ignore
glxflags ignore
VertexAttribI4uivEXT(index, v)
return void
param index UInt32 in value
param v UInt32 in array [4]
category NV_vertex_program4
beginend allow-inside
extension soft WINSOFT NV10
glfflags ignore
glsflags ignore
glxflags ignore
VertexAttribI4bvEXT(index, v)
return void
param index UInt32 in value
param v Int8 in array [4]
category NV_vertex_program4
beginend allow-inside
extension soft WINSOFT NV10
glfflags ignore
glsflags ignore
glxflags ignore
VertexAttribI4svEXT(index, v)
return void
param index UInt32 in value
param v Int16 in array [4]
category NV_vertex_program4
beginend allow-inside
extension soft WINSOFT NV10
glfflags ignore
glsflags ignore
glxflags ignore
VertexAttribI4ubvEXT(index, v)
return void
param index UInt32 in value
param v UInt8 in array [4]
category NV_vertex_program4
beginend allow-inside
extension soft WINSOFT NV10
glfflags ignore
glsflags ignore
glxflags ignore
VertexAttribI4usvEXT(index, v)
return void
param index UInt32 in value
param v UInt16 in array [4]
category NV_vertex_program4
beginend allow-inside
extension soft WINSOFT NV10
glfflags ignore
glsflags ignore
glxflags ignore
VertexAttribIPointerEXT(index, size, type, stride, pointer)
return void
param index UInt32 in value
param size Int32 in value
param type VertexAttribEnum in value
param stride SizeI in value
param pointer Void in array [COMPSIZE(size/type/stride)] retained
category NV_vertex_program4
dlflags notlistable
extension soft WINSOFT NV10
glfflags ignore
glsflags ignore
glxflags ignore
GetVertexAttribIivEXT(index, pname, params)
return void
param index UInt32 in value
param pname VertexAttribEnum in value
param params Int32 out array [1]
category NV_vertex_program4
dlflags notlistable
extension soft WINSOFT NV10
glfflags ignore
glsflags ignore
glxflags ignore
GetVertexAttribIuivEXT(index, pname, params)
return void
param index UInt32 in value
param pname VertexAttribEnum in value
param params UInt32 out array [1]
category NV_vertex_program4
dlflags notlistable
extension soft WINSOFT NV10
glfflags ignore
glsflags ignore
glxflags ignore
###############################################################################
#
# Extension #326
# EXT_gpu_shader4 commands
#
###############################################################################
GetUniformuivEXT(program, location, params)
return void
param program UInt32 in value
param location Int32 in value
param params UInt32 out array [COMPSIZE(program/location)]
category EXT_gpu_shader4
dlflags notlistable
version 2.0
extension soft WINSOFT
glfflags ignore
glsflags ignore
glxflags ignore
BindFragDataLocationEXT(program, color, name)
return void
param program UInt32 in value
param color UInt32 in value
param name Char in array [COMPSIZE(name)]
category EXT_gpu_shader4
dlflags notlistable
version 2.0
extension soft WINSOFT
glfflags ignore
glsflags ignore
glxflags ignore
GetFragDataLocationEXT(program, name)
return Int32
param program UInt32 in value
param name Char in array [COMPSIZE(name)]
category EXT_gpu_shader4
dlflags notlistable
version 2.0
extension soft WINSOFT
glfflags ignore
glsflags ignore
glxflags ignore
Uniform1uiEXT(location, v0)
return void
param location Int32 in value
param v0 UInt32 in value
category EXT_gpu_shader4
version 2.0
extension soft WINSOFT
glfflags ignore
glsflags ignore
glxflags ignore
Uniform2uiEXT(location, v0, v1)
return void
param location Int32 in value
param v0 UInt32 in value
param v1 UInt32 in value
category EXT_gpu_shader4
version 2.0
extension soft WINSOFT
glfflags ignore
glsflags ignore
glxflags ignore
Uniform3uiEXT(location, v0, v1, v2)
return void
param location Int32 in value
param v0 UInt32 in value
param v1 UInt32 in value
param v2 UInt32 in value
category EXT_gpu_shader4
version 2.0
extension soft WINSOFT
glfflags ignore
glsflags ignore
glxflags ignore
Uniform4uiEXT(location, v0, v1, v2, v3)
return void
param location Int32 in value
param v0 UInt32 in value
param v1 UInt32 in value
param v2 UInt32 in value
param v3 UInt32 in value
category EXT_gpu_shader4
version 2.0
extension soft WINSOFT
glfflags ignore
glsflags ignore
glxflags ignore
Uniform1uivEXT(location, count, value)
return void
param location Int32 in value
param count SizeI in value
param value UInt32 in array [count]
category EXT_gpu_shader4
version 2.0
extension soft WINSOFT
glfflags ignore
glsflags ignore
glxflags ignore
Uniform2uivEXT(location, count, value)
return void
param location Int32 in value
param count SizeI in value
param value UInt32 in array [count*2]
category EXT_gpu_shader4
version 2.0
extension soft WINSOFT
glfflags ignore
glsflags ignore
glxflags ignore
Uniform3uivEXT(location, count, value)
return void
param location Int32 in value
param count SizeI in value
param value UInt32 in array [count*3]
category EXT_gpu_shader4
version 2.0
extension soft WINSOFT
glfflags ignore
glsflags ignore
glxflags ignore
Uniform4uivEXT(location, count, value)
return void
param location Int32 in value
param count SizeI in value
param value UInt32 in array [count*4]
category EXT_gpu_shader4
version 2.0
extension soft WINSOFT
glfflags ignore
glsflags ignore
glxflags ignore
###############################################################################
#
# Extension #327
# EXT_draw_instanced commands
#
###############################################################################
DrawArraysInstancedEXT(mode, start, count, primcount)
return void
param mode BeginMode in value
param start Int32 in value
param count SizeI in value
param primcount SizeI in value
category EXT_draw_instanced
version 2.0
extension soft WINSOFT
dlflags notlistable
vectorequiv ArrayElement
glfflags ignore
glsflags ignore
glxflags ignore
DrawElementsInstancedEXT(mode, count, type, indices, primcount)
return void
param mode BeginMode in value
param count SizeI in value
param type DrawElementsType in value
param indices Void in array [COMPSIZE(count/type)]
param primcount SizeI in value
category EXT_draw_instanced
version 2.0
extension soft WINSOFT
dlflags notlistable
vectorequiv ArrayElement
glfflags ignore
glsflags ignore
glxflags ignore
###############################################################################
#
# Extension #328
# EXT_packed_float commands
#
###############################################################################
# (none)
newcategory: EXT_packed_float
###############################################################################
#
# Extension #329
# EXT_texture_array commands
#
###############################################################################
# (none)
newcategory: EXT_texture_array
###############################################################################
#
# Extension #330
# EXT_texture_buffer_object commands
#
###############################################################################
TexBufferEXT(target, internalformat, buffer)
return void
param target TextureTarget in value
param internalformat GLenum in value
param buffer UInt32 in value
category EXT_texture_buffer_object
version 2.0
extension soft WINSOFT NV50
glfflags ignore
glsflags ignore
glxflags ignore
###############################################################################
#
# Extension #331
# EXT_texture_compression_latc commands
#
###############################################################################
# (none)
newcategory: EXT_texture_compression_latc
###############################################################################
#
# Extension #332
# EXT_texture_compression_rgtc commands
#
###############################################################################
# (none)
newcategory: EXT_texture_compression_rgtc
###############################################################################
#
# Extension #333
# EXT_texture_shared_exponent commands
#
###############################################################################
# (none)
newcategory: EXT_texture_shared_exponent
###############################################################################
#
# Extension #334
# NV_depth_buffer_float commands
#
###############################################################################
DepthRangedNV(zNear, zFar)
return void
param zNear Float64 in value
param zFar Float64 in value
category NV_depth_buffer_float
extension soft WINSOFT NV50
version 2.0
glfflags ignore
glsflags ignore
glxflags ignore
ClearDepthdNV(depth)
return void
param depth Float64 in value
category NV_depth_buffer_float
extension soft WINSOFT NV50
version 2.0
glfflags ignore
glsflags ignore
glxflags ignore
DepthBoundsdNV(zmin, zmax)
return void
param zmin Float64 in value
param zmax Float64 in value
category NV_depth_buffer_float
extension soft WINSOFT NV50
version 2.0
glfflags ignore
glsflags ignore
glxflags ignore
###############################################################################
#
# Extension #335
# NV_fragment_program4 commands
#
###############################################################################
# (none)
newcategory: NV_fragment_program4
###############################################################################
#
# Extension #336
# NV_framebuffer_multisample_coverage commands
#
###############################################################################
RenderbufferStorageMultisampleCoverageNV(target, coverageSamples, colorSamples, internalformat, width, height)
return void
param target RenderbufferTarget in value
param coverageSamples SizeI in value
param colorSamples SizeI in value
param internalformat PixelInternalFormat in value
param width SizeI in value
param height SizeI in value
category NV_framebuffer_multisample_coverage
version 1.5
extension soft WINSOFT
dlflags notlistable
glfflags ignore
glsflags ignore
glxflags ignore
###############################################################################
#
# Extension #337
# EXT_framebuffer_sRGB commands
#
###############################################################################
# (none)
newcategory: EXT_framebuffer_sRGB
###############################################################################
#
# Extension #338
# NV_geometry_shader4 commands
#
###############################################################################
# (none)
newcategory: NV_geometry_shader4
###############################################################################
#
# Extension #339
# NV_parameter_buffer_object commands
#
###############################################################################
ProgramBufferParametersfvNV(target, buffer, index, count, params)
return void
param target ProgramTarget in value
param buffer UInt32 in value
param index UInt32 in value
param count SizeI in value
param params Float32 in array [count]
category NV_parameter_buffer_object
version 1.2
extension soft WINSOFT NV50
glfflags ignore
glsflags ignore
glxflags ignore
ProgramBufferParametersIivNV(target, buffer, index, count, params)
return void
param target ProgramTarget in value
param buffer UInt32 in value
param index UInt32 in value
param count SizeI in value
param params Int32 in array [count]
category NV_parameter_buffer_object
version 1.2
extension soft WINSOFT NV50
glfflags ignore
glsflags ignore
glxflags ignore
ProgramBufferParametersIuivNV(target, buffer, index, count, params)
return void
param target ProgramTarget in value
param buffer UInt32 in value
param index UInt32 in value
param count SizeI in value
param params UInt32 in array [count]
category NV_parameter_buffer_object
version 1.2
extension soft WINSOFT NV50
glfflags ignore
glsflags ignore
glxflags ignore
###############################################################################
#
# Extension #340
# EXT_draw_buffers2 commands
#
###############################################################################
ColorMaskIndexedEXT(index, r, g, b, a)
return void
param index UInt32 in value
param r Boolean in value
param g Boolean in value
param b Boolean in value
param a Boolean in value
category EXT_draw_buffers2
version 2.0
glxflags ignore
glfflags ignore
glsflags ignore
extension soft WINSOFT
GetBooleanIndexedvEXT(target, index, data)
return void
param target GLenum in value
param index UInt32 in value
param data Boolean out array [COMPSIZE(target)]
category EXT_draw_buffers2
version 2.0
dlflags notlistable
glxflags ignore
glfflags ignore
glsflags ignore
extension soft WINSOFT
GetIntegerIndexedvEXT(target, index, data)
return void
param target GLenum in value
param index UInt32 in value
param data Int32 out array [COMPSIZE(target)]
category EXT_draw_buffers2
version 2.0
dlflags notlistable
glxflags ignore
glfflags ignore
glsflags ignore
extension soft WINSOFT
EnableIndexedEXT(target, index)
return void
param target GLenum in value
param index UInt32 in value
category EXT_draw_buffers2
version 2.0
glxflags ignore
glfflags ignore
glsflags ignore
extension soft WINSOFT
DisableIndexedEXT(target, index)
return void
param target GLenum in value
param index UInt32 in value
category EXT_draw_buffers2
version 2.0
glxflags ignore
glfflags ignore
glsflags ignore
extension soft WINSOFT
IsEnabledIndexedEXT(target, index)
return Boolean
param target GLenum in value
param index UInt32 in value
category EXT_draw_buffers2
version 2.0
dlflags notlistable
glxflags ignore
glfflags ignore
glsflags ignore
extension soft WINSOFT
###############################################################################
#
# Extension #341
# NV_transform_feedback commands
#
###############################################################################
BeginTransformFeedbackNV(primitiveMode)
return void
param primitiveMode GLenum in value
category NV_transform_feedback
version 1.5
dlflags notlistable
glxflags ignore
glfflags ignore
glsflags ignore
extension soft WINSOFT
EndTransformFeedbackNV()
return void
category NV_transform_feedback
version 1.5
dlflags notlistable
glxflags ignore
glfflags ignore
glsflags ignore
extension soft WINSOFT
TransformFeedbackAttribsNV(count, attribs, bufferMode)
return void
param count UInt32 in value
param attribs Int32 in array [COMPSIZE(count)]
param bufferMode GLenum in value
category NV_transform_feedback
version 1.5
dlflags notlistable
glxflags ignore
glfflags ignore
glsflags ignore
extension soft WINSOFT
BindBufferRangeNV(target, index, buffer, offset, size)
return void
param target GLenum in value
param index UInt32 in value
param buffer UInt32 in value
param offset BufferOffset in value
param size BufferSize in value
category NV_transform_feedback
version 1.5
dlflags notlistable
glxflags ignore
glfflags ignore
glsflags ignore
extension soft WINSOFT
BindBufferOffsetNV(target, index, buffer, offset)
return void
param target GLenum in value
param index UInt32 in value
param buffer UInt32 in value
param offset BufferOffset in value
category NV_transform_feedback
version 1.5
dlflags notlistable
glxflags ignore
glfflags ignore
glsflags ignore
extension soft WINSOFT
BindBufferBaseNV(target, index, buffer)
return void
param target GLenum in value
param index UInt32 in value
param buffer UInt32 in value
category NV_transform_feedback
version 1.5
dlflags notlistable
glxflags ignore
glfflags ignore
glsflags ignore
extension soft WINSOFT
TransformFeedbackVaryingsNV(program, count, locations, bufferMode)
return void
param program UInt32 in value
param count SizeI in value
param locations Int32 in array [COMPSIZE(count)]
param bufferMode GLenum in value
category NV_transform_feedback
version 1.5
dlflags notlistable
glxflags ignore
glfflags ignore
glsflags ignore
extension soft WINSOFT
ActiveVaryingNV(program, name)
return void
param program UInt32 in value
param name Char in array [COMPSIZE(name)]
category NV_transform_feedback
version 1.5
dlflags notlistable
glxflags ignore
glfflags ignore
glsflags ignore
extension soft WINSOFT
GetVaryingLocationNV(program, name)
return Int32
param program UInt32 in value
param name Char in array [COMPSIZE(name)]
category NV_transform_feedback
dlflags notlistable
version 1.5
glfflags ignore
glsflags ignore
glxflags ignore
extension soft WINSOFT
GetActiveVaryingNV(program, index, bufSize, length, size, type, name)
return void
param program UInt32 in value
param index UInt32 in value
param bufSize SizeI in value
param length SizeI out array [1]
param size SizeI out array [1]
param type GLenum out array [1]
param name Char out array [COMPSIZE(program/index/bufSize)]
category NV_transform_feedback
dlflags notlistable
version 1.5
extension soft WINSOFT
glfflags ignore
glsflags ignore
glxflags ignore
GetTransformFeedbackVaryingNV(program, index, location)
return void
param program UInt32 in value
param index UInt32 in value
param location Int32 out array [1]
category NV_transform_feedback
dlflags notlistable
version 1.5
extension soft WINSOFT
glfflags ignore
glsflags ignore
glxflags ignore
###############################################################################
#
# Extension #342
# EXT_bindable_uniform commands
#
###############################################################################
UniformBufferEXT(program, location, buffer)
return void
param program UInt32 in value
param location Int32 in value
param buffer UInt32 in value
category EXT_bindable_uniform
version 2.0
extension soft WINSOFT
glxflags ignore
glfflags ignore
glsflags ignore
GetUniformBufferSizeEXT(program, location)
return Int32
param program UInt32 in value
param location Int32 in value
category EXT_bindable_uniform
dlflags notlistable
version 2.0
extension soft WINSOFT
glfflags ignore
glsflags ignore
glxflags ignore
GetUniformOffsetEXT(program, location)
return BufferOffset
param program UInt32 in value
param location Int32 in value
category EXT_bindable_uniform
dlflags notlistable
version 2.0
extension soft WINSOFT
glfflags ignore
glsflags ignore
glxflags ignore
###############################################################################
#
# Extension #343
# EXT_texture_integer extension commands
#
###############################################################################
TexParameterIivEXT(target, pname, params)
return void
param target TextureTarget in value
param pname TextureParameterName in value
param params Int32 in array [COMPSIZE(pname)]
category EXT_texture_integer
version 2.0
extension soft WINSOFT NV50
glfflags ignore
glsflags ignore
glxflags ignore
TexParameterIuivEXT(target, pname, params)
return void
param target TextureTarget in value
param pname TextureParameterName in value
param params UInt32 in array [COMPSIZE(pname)]
category EXT_texture_integer
version 2.0
extension soft WINSOFT NV50
glfflags ignore
glsflags ignore
glxflags ignore
GetTexParameterIivEXT(target, pname, params)
return void
param target TextureTarget in value
param pname GetTextureParameter in value
param params Int32 out array [COMPSIZE(pname)]
category EXT_texture_integer
dlflags notlistable
version 1.0
version 2.0
extension soft WINSOFT NV50
glfflags ignore
glsflags ignore
glxflags ignore
GetTexParameterIuivEXT(target, pname, params)
return void
param target TextureTarget in value
param pname GetTextureParameter in value
param params UInt32 out array [COMPSIZE(pname)]
category EXT_texture_integer
dlflags notlistable
version 1.0
version 2.0
extension soft WINSOFT NV50
glfflags ignore
glsflags ignore
glxflags ignore
ClearColorIiEXT(red, green, blue, alpha)
return void
param red Int32 in value
param green Int32 in value
param blue Int32 in value
param alpha Int32 in value
category EXT_texture_integer
version 2.0
extension soft WINSOFT NV50
glfflags ignore
glsflags ignore
glxflags ignore
ClearColorIuiEXT(red, green, blue, alpha)
return void
param red UInt32 in value
param green UInt32 in value
param blue UInt32 in value
param alpha UInt32 in value
category EXT_texture_integer
version 2.0
extension soft WINSOFT NV50
glfflags ignore
glsflags ignore
glxflags ignore
###############################################################################
#
# Extension #344 - GLX_EXT_texture_from_pixmap
#
###############################################################################
###############################################################################
#
# Extension #345
# GREMEDY_frame_terminator commands
#
###############################################################################
FrameTerminatorGREMEDY()
return void
category GREMEDY_frame_terminator
version 1.0
extension
glsflags ignore
glxflags ignore
offset ?
| 515,003 | Common Lisp | .l | 19,898 | 23.993416 | 3,125 | 0.710711 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | c1a023ad3d8d00b5fdb6065ccac3351ea39c516fa6754b7d72b95cc5e81cec51 | 21,893 | [
-1
] |
21,894 | cl-opengl.texinfo | rheaplex_minara/lib/cl-opengl/doc/cl-opengl.texinfo | \input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename cl-opengl.info
@settitle CL-OpenGL User Manual
@exampleindent 2
@c ============================= Macros =============================
@c The following macros are used throughout this manual. Taken from
@c the CFFI User Manual, most of them written by Stephen Compall.
@macro Function {args}
@defun \args\
@end defun
@end macro
@macro Macro {args}
@defmac \args\
@end defmac
@end macro
@macro Accessor {args}
@deffn {Accessor} \args\
@end deffn
@end macro
@macro GenericFunction {args}
@deffn {Generic Function} \args\
@end deffn
@end macro
@macro Type {args}
@deftp {Type} \args\
@end deftp
@end macro
@macro Variable {args}
@defvr {Special Variable} \args\
@end defvr
@end macro
@macro Condition {args}
@deftp {Condition Type} \args\
@end deftp
@end macro
@macro clopengl
@sc{cl-opengl}
@end macro
@macro impnote {text}
@quotation
@strong{Implementor's note:} @emph{\text\}
@end quotation
@end macro
@c Info "requires" that x-refs end in a period or comma, or ) in the
@c case of @pxref. So the following implements that requirement for
@c the "See also" subheadings that permeate this manual, but only in
@c Info mode.
@c
@c Most of them are also dictionary symbols, so I use this also to
@c print a pretty section name. Non-dictionary seealsos should not
@c exist; refer to them inline in the descriptive text.
@ifinfo
@macro seealso {name}
@ref{\name\}.
@end macro
@end ifinfo
@ifnotinfo
@alias seealso = ref
@end ifnotinfo
@c ============================= Macros =============================
@c Show types, functions, and concepts in the same index.
@syncodeindex tp cp
@syncodeindex fn cp
@copying
Copyright @copyright{} 2006, Oliver Markovic <entrox at entrox.org> @*
Copyright @copyright{} 2006, Lu@'{@dotless{i}}s Oliveira
<loliveira at common-lisp.net>
@quotation
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
@itemize @bullet
@item
Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
@item
Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
@item
Neither the name of the author nor the names of the contributors may
be used to endorse or promote products derived from this software
without specific prior written permission.
@end itemize
@sc{This software is provided by the copyright holders and contributors
``as is'' and any express or implied warranties, including, but not
limited to, the implied warranties of merchantability and fitness for
a particular purpose are disclaimed. In no event shall the copyright
owner or contributors be liable for any direct, indirect, incidental,
special, exemplary, or consequential damages (including, but not
limited to, procurement of substitute goods or services; loss of use,
data, or profits; or business interruption) however caused and on any
theory of liability, whether in contract, strict liability, or tort
(including negligence or otherwise) arising in any way out of the use
of this software, even if advised of the possibility of such damage.}
@end quotation
@end copying
@titlepage
@title @clopengl{} User Manual
@c @subtitle Version X.X
@c @author foobar
@page
@vskip 0pt plus 1filll
@insertcopying
@end titlepage
@contents
@ifnottex
@top cl-opengl
@insertcopying
@end ifnottex
@menu
* Introduction::
* OpenGL::
* Comprehensive Index::
@end menu
@c ===================================================================
@node Introduction
@chapter Introduction
@clopengl{} is a set of @acronym{CFFI} bindings to @sc{OpenGL}
2.0. @acronym{GLU} and Free@acronym{GLUT} bindings are also
included.
Notice that the @acronym{GLUT} bindings are mostly provided
for the purpose of supporting the examples included in the
distribution and you are free to use another windowing toolkit.
@c ===================================================================
@node OpenGL
@chapter OpenGL
@c ===================================================================
@node GLU
@chapter GLU
@c ===================================================================
@node GLUT
@chapter GLUT
@c ===================================================================
@node Comprehensive Index
@unnumbered Index
@printindex cp
@bye
| 4,568 | Common Lisp | .l | 140 | 31.028571 | 71 | 0.710448 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 68e10100fa34bc24cfc741d57a0e5703c0457780b1cad19f2cbae0d3b8428cf4 | 21,894 | [
-1
] |
21,895 | Makefile | rheaplex_minara/lib/cl-opengl/doc/Makefile | # -*- Mode: Makefile; tab-width: 3; indent-tabs-mode: t -*-
#
# Makefile --- Make targets for generating the documentation.
#
# Copyright (c) 2006, Luis Oliveira <[email protected]>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# o Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# o Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# o Neither the name of the author nor the names of the contributors may
# be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
docs:
sh gendocs.sh -o cl-opengl --html "--css-include=style.css" cl-opengl "CL-OpenGL User Manual"
clean:
find . \( -name "*.info" -o -name "*.aux" -o -name "*.cp" -o -name "*.fn" -o -name "*.fns" -o -name "*.ky" -o -name "*.log" -o -name "*.pg" -o -name "*.toc" -o -name "*.tp" -o -name "*.vr" \) -exec rm {} \;
rm -rf cl-opengl
upload-docs:
rsync -av --delete -e ssh cl-opengl common-lisp.net:/project/cl-opengl/public_html/manual/
# vim: ft=make ts=3 noet
| 2,166 | Common Lisp | .l | 39 | 54.230769 | 207 | 0.746585 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 92f9fc2ec94c55c621a0a0efddd5f1ff295e09a582eb4152b6627b68863d5ec7 | 21,895 | [
-1
] |
21,896 | style.css | rheaplex_minara/lib/cl-opengl/doc/style.css | body {font-family: century schoolbook, serif;
line-height: 1.3;
padding-left: 5em; padding-right: 1em;
padding-bottom: 1em; max-width: 60em;}
table {border-collapse: collapse}
span.roman { font-family: century schoolbook, serif; font-weight: normal; }
h1, h2, h3, h4, h5, h6 {font-family: Helvetica, sans-serif}
/*h4 {padding-top: 0.75em;}*/
dfn {font-family: inherit; font-variant: italic; font-weight: bolder }
kbd {font-family: monospace; text-decoration: underline}
var {font-family: Helvetica, sans-serif; font-variant: slanted}
td {padding-right: 1em; padding-left: 1em}
sub {font-size: smaller}
.node {padding: 0; margin: 0}
.lisp { font-family: monospace;
background-color: #F4F4F4; border: 1px solid #AAA;
padding-top: 0.5em; padding-bottom: 0.5em; }
/* coloring */
.lisp-bg { background-color: #F4F4F4 ; color: black; }
.lisp-bg:hover { background-color: #F4F4F4 ; color: black; }
.symbol { font-weight: bold; color: #770055; background-color : transparent; border: 0px; margin: 0px;}
a.symbol:link { font-weight: bold; color : #229955; background-color : transparent; text-decoration: none; border: 0px; margin: 0px; }
a.symbol:active { font-weight: bold; color : #229955; background-color : transparent; text-decoration: none; border: 0px; margin: 0px; }
a.symbol:visited { font-weight: bold; color : #229955; background-color : transparent; text-decoration: none; border: 0px; margin: 0px; }
a.symbol:hover { font-weight: bold; color : #229955; background-color : transparent; text-decoration: none; border: 0px; margin: 0px; }
.special { font-weight: bold; color: #FF5000; background-color: inherit; }
.keyword { font-weight: bold; color: #770000; background-color: inherit; }
.comment { font-weight: normal; color: #007777; background-color: inherit; }
.string { font-weight: bold; color: #777777; background-color: inherit; }
.character { font-weight: bold; color: #0055AA; background-color: inherit; }
.syntaxerror { font-weight: bold; color: #FF0000; background-color: inherit; }
span.paren1 { font-weight: bold; color: #777777; }
span.paren1:hover { color: #777777; background-color: #BAFFFF; }
span.paren2 { color: #777777; }
span.paren2:hover { color: #777777; background-color: #FFCACA; }
span.paren3 { color: #777777; }
span.paren3:hover { color: #777777; background-color: #FFFFBA; }
span.paren4 { color: #777777; }
span.paren4:hover { color: #777777; background-color: #CACAFF; }
span.paren5 { color: #777777; }
span.paren5:hover { color: #777777; background-color: #CAFFCA; }
span.paren6 { color: #777777; }
span.paren6:hover { color: #777777; background-color: #FFBAFF; }
| 2,642 | Common Lisp | .l | 43 | 59.55814 | 137 | 0.719075 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | c0d9094751860733732466e8c3253bfc3afba4774626e66fe8d7d52f0d51bbea | 21,896 | [
-1
] |
21,897 | gendocs_template | rheaplex_minara/lib/cl-opengl/doc/gendocs_template | <?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- $Id: gendocs_template,v 1.7 2005/05/15 00:00:08 karl Exp $ -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<!--
This template was adapted from Texinfo:
http://savannah.gnu.org/cgi-bin/viewcvs/texinfo/texinfo/util/gendocs_template
-->
<head>
<title>%%TITLE%%</title>
<meta http-equiv="content-type" content='text/html; charset=utf-8' />
<!-- <link rel="stylesheet" type="text/css" href="/gnu.css" /> -->
<!-- <link rev="made" href="[email protected]" /> -->
<style>
/* CSS style taken from http://gnu.org/gnu.css */
html, body {
background-color: #FFFFFF;
color: #000000;
font-family: sans-serif;
}
a:link {
color: #1f00ff;
background-color: transparent;
text-decoration: underline;
}
a:visited {
color: #9900dd;
background-color: transparent;
text-decoration: underline;
}
a:hover {
color: #9900dd;
background-color: transparent;
text-decoration: none;
}
.center {
text-align: center;
}
.italic {
font-style: italic;
}
.bold {
font-weight: bold;
}
.quote {
margin-left: 40px;
margin-right: 40px;
}
.hrsmall {
width: 80px;
height: 1px;
margin-left: 20px;
}
.td_title {
border-color: #3366cc;
border-style: solid;
border-width: thin;
color: #3366cc;
background-color : #f2f2f9;
font-weight: bold;
}
.td_con {
padding-top: 3px;
padding-left: 8px;
padding-bottom: 3px;
color : #303030;
background-color : #fefefe;
font-size: smaller;
}
.translations {
background-color: transparent;
color: black;
font-family: serif;
font-size: smaller;
}
.fsflink {
font-size: smaller;
font-family: monospace;
color : #000000;
border-left: #3366cc thin solid;
border-bottom: #3366cc thin solid;
padding-left: 5px;
padding-bottom: 5px;
}
/*
* rtl stands for right-to-left layout, as in farsi/persian,
* arabic, etc. See also trans_rtl.
*/
.fsflink_rtl {
font-size: smaller;
font-family: monospace;
color : #000000;
border-right: #3366cc thin solid;
border-bottom: #3366cc thin solid;
padding-right: 5px;
padding-bottom: 5px;
}
.trans {
font-size: smaller;
color : #000000;
border-left: #3366cc thin solid;
padding-left: 20px;
}
.trans_rtl {
font-size: smaller;
color : #000000;
border-right: #3366cc thin solid;
padding-right: 20px;
}
img {
border: none 0;
}
td.side {
color: #3366cc;
/* background: #f2f2f9;
border-color: #3366cc;
border-style: solid;
border-width: thin; */
border-color: white;
border-style: none;
vertical-align: top;
width: 150px;
}
div.copyright {
font-size: 80%;
border: 2px solid #3366cc;
padding: 4px;
background: #f2f2f9;
border-style: solid;
border-width: thin;
}
.footnoteref {
font-size: smaller;
vertical-align: text-top;
}
</style>
</head>
<!-- This document is in XML, and xhtml 1.0 -->
<!-- Please make sure to properly nest your tags -->
<!-- and ensure that your final document validates -->
<!-- consistent with W3C xhtml 1.0 and CSS standards -->
<!-- See validator.w3.org -->
<body>
<h3>%%TITLE%%</h3>
<!-- <address>Free Software Foundation</address> -->
<address>last updated %%DATE%%</address>
<!--
<p>
<a href="/graphics/gnu-head.jpg">
<img src="/graphics/gnu-head-sm.jpg"
alt=" [image of the head of a GNU] "
width="129" height="122" />
</a>
<a href="/philosophy/gif.html">(no gifs due to patent problems)</a>
</p>
-->
<hr />
<p>This document <!--(%%PACKAGE%%)--> is available in the following formats:</p>
<ul>
<li><a href="%%PACKAGE%%.html">HTML
(%%HTML_MONO_SIZE%%K characters)</a> - entirely on one web page.</li>
<li><a href="html_node/index.html">HTML</a> - with one web page per
node.</li>
<li><a href="%%PACKAGE%%.html.gz">HTML compressed
(%%HTML_MONO_GZ_SIZE%%K gzipped characters)</a> - entirely on
one web page.</li>
<li><a href="%%PACKAGE%%.html_node.tar.gz">HTML compressed
(%%HTML_NODE_TGZ_SIZE%%K gzipped tar file)</a> -
with one web page per node.</li>
<li><a href="%%PACKAGE%%.info.tar.gz">Info document
(%%INFO_TGZ_SIZE%%K characters gzipped tar file)</a>.</li>
<li><a href="%%PACKAGE%%.txt">ASCII text
(%%ASCII_SIZE%%K characters)</a>.</li>
<li><a href="%%PACKAGE%%.txt.gz">ASCII text compressed
(%%ASCII_GZ_SIZE%%K gzipped characters)</a>.</li>
<li><a href="%%PACKAGE%%.dvi.gz">TeX dvi file
(%%DVI_GZ_SIZE%%K characters gzipped)</a>.</li>
<li><a href="%%PACKAGE%%.ps.gz">PostScript file
(%%PS_GZ_SIZE%%K characters gzipped)</a>.</li>
<li><a href="%%PACKAGE%%.pdf">PDF file
(%%PDF_SIZE%%K characters)</a>.</li>
<li><a href="%%PACKAGE%%.texi.tar.gz">Texinfo source
(%%TEXI_TGZ_SIZE%%K characters gzipped tar file)</a></li>
</ul>
<p>(This page was generated by the <a href="%%SCRIPTURL%%">%%SCRIPTNAME%%
script</a>.)</p>
<div class="copyright">
<p>
Return to <a href="/project/cl-opengl/">cl-opengl's home page</a>.
</p>
<!--
<p>
Please send FSF & GNU inquiries to
<a href="mailto:[email protected]"><em>[email protected]</em></a>.
There are also <a href="/home.html#ContactInfo">other ways to contact</a>
the FSF.
<br />
Please send broken links and other corrections (or suggestions) to
<a href="mailto:[email protected]"><em>[email protected]</em></a>.
</p>
-->
<p>
Copyright (C) 2006 Oliver Markovic <entrox at entrox.org><br />
Copyright (C) 2006 Luís Oliveira <loliveira at common-lisp.net>
<!--
<br />
Verbatim copying and distribution of this entire article is
permitted in any medium, provided this notice is preserved.
-->
</p>
<p>
Updated: %%DATE%%
<!-- timestamp start -->
<!-- $Date: 2005/05/15 00:00:08 $ $Author: karl $ -->
<!-- timestamp end -->
</p>
</div>
</body>
</html>
| 5,812 | Common Lisp | .l | 220 | 24.059091 | 80 | 0.671529 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | bd4e94c3d07468b54f2517fe34e62068e235f90f709ab5f115b8d46c9b7d552a | 21,897 | [
-1
] |
21,954 | GNUmakefile | rheaplex_minara/lib/cffi/tests/GNUmakefile | # -*- Mode: Makefile; tab-width: 3; indent-tabs-mode: t -*-
#
# Makefile --- Make targets for various tasks.
#
# Copyright (C) 2005, James Bielman <[email protected]>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use, copy,
# modify, merge, publish, distribute, sublicense, and/or sell copies
# of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
OSTYPE = $(shell uname)
CC := gcc
CFLAGS := -Wall -std=c99 -pedantic
SHLIB_CFLAGS := -shared
SHLIB_EXT := .so
ifneq ($(if $(filter Linux %BSD,$(OSTYPE)),OK), OK)
ifeq ($(OSTYPE), Darwin)
SHLIB_CFLAGS := -bundle
else
ifeq ($(OSTYPE), SunOS)
CFLAGS := -c -Wall -std=c99 -pedantic
else
# Let's assume this is win32
SHLIB_EXT := .dll
endif
endif
endif
ARCH = $(shell uname -m)
ifneq ($(ARCH), x86_64)
CFLAGS += -lm
endif
ifeq ($(ARCH), x86_64)
CFLAGS += -fPIC
endif
# Are all G5s ppc970s?
ifeq ($(ARCH), ppc970)
CFLAGS += -m64
endif
SHLIBS = libtest$(SHLIB_EXT) libtest2$(SHLIB_EXT)
ifeq ($(ARCH), x86_64)
SHLIBS += libtest32$(SHLIB_EXT) libtest2_32$(SHLIB_EXT)
endif
shlibs: $(SHLIBS)
libtest$(SHLIB_EXT): libtest.c
$(CC) -o $@ $(SHLIB_CFLAGS) $(CFLAGS) $<
libtest2$(SHLIB_EXT): libtest2.c
$(CC) -o $@ $(SHLIB_CFLAGS) $(CFLAGS) $<
ifeq ($(ARCH), x86_64)
libtest32$(SHLIB_EXT): libtest.c
$(CC) -m32 -o $@ $(SHLIB_CFLAGS) $(CFLAGS) $<
libtest2_32$(SHLIB_EXT): libtest2.c
$(CC) -m32 -o $@ $(SHLIB_CFLAGS) $(CFLAGS) $<
endif
clean:
rm -f *.so *.dylib *.dll *.bundle
# vim: ft=make ts=3 noet
| 2,381 | Common Lisp | .l | 72 | 31.777778 | 68 | 0.713476 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 2d877aa70ac3cc859f42e47a49e0124950c70aed90b814acef8728ef0ca20048 | 21,954 | [
-1
] |
21,959 | cffi-manual.texinfo | rheaplex_minara/lib/cffi/doc/cffi-manual.texinfo | \input texinfo @c -*- Mode: Texinfo; Mode: auto-fill -*-
@c %**start of header
@setfilename cffi.info
@settitle CFFI User Manual
@exampleindent 2
@c @documentencoding utf-8
@c Style notes:
@c
@c * The reference section names and "See Also" list are roman, not
@c @code. This is to follow the format of CLHS.
@c
@c * How it looks in HTML is the priority.
@c ============================= Macros =============================
@c The following macros are used throughout this manual.
@macro Function {args}
@defun \args\
@end defun
@end macro
@macro Macro {args}
@defmac \args\
@end defmac
@end macro
@macro Accessor {args}
@deffn {Accessor} \args\
@end deffn
@end macro
@macro GenericFunction {args}
@deffn {Generic Function} \args\
@end deffn
@end macro
@macro ForeignType {args}
@deftp {Foreign Type} \args\
@end deftp
@end macro
@macro Variable {args}
@defvr {Special Variable} \args\
@end defvr
@end macro
@macro Condition {args}
@deftp {Condition Type} \args\
@end deftp
@end macro
@macro cffi
@acronym{CFFI}
@end macro
@macro impnote {text}
@quotation
@strong{Implementor's note:} @emph{\text\}
@end quotation
@end macro
@c Info "requires" that x-refs end in a period or comma, or ) in the
@c case of @pxref. So the following implements that requirement for
@c the "See also" subheadings that permeate this manual, but only in
@c Info mode.
@ifinfo
@macro seealso {name}
@ref{\name\}.
@end macro
@end ifinfo
@ifnotinfo
@alias seealso = ref
@end ifnotinfo
@c Set ROMANCOMMENTS to get comments in roman font.
@ifset ROMANCOMMENTS
@alias lispcmt = r
@end ifset
@ifclear ROMANCOMMENTS
@alias lispcmt = asis
@end ifclear
@c My copy of makeinfo is not generating any HTML for @result{} for
@c some odd reason. (It certainly used to...)
@ifhtml
@macro result
=>
@end macro
@end ifhtml
@c Similar macro to @result. Its purpose is to work around the fact
@c that ⇒ does not work properly inside @lisp.
@ifhtml
@macro res
@html
⇒
@end html
@end macro
@end ifhtml
@ifnothtml
@alias res = result
@end ifnothtml
@c ============================= Macros =============================
@c Show types, functions, and concepts in the same index.
@syncodeindex tp cp
@syncodeindex fn cp
@copying
Copyright @copyright{} 2005 James Bielman <jamesjb at jamesjb.com> @*
Copyright @copyright{} 2005-2008 Lu@'{@dotless{i}}s Oliveira
<loliveira at common-lisp.net> @*
Copyright @copyright{} 2006 Stephen Compall <s11 at member.fsf.org>
@quotation
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
``Software''), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
@sc{The software is provided ``as is'', without warranty of any kind,
express or implied, including but not limited to the warranties of
merchantability, fitness for a particular purpose and noninfringement.
In no event shall the authors or copyright holders be liable for any
claim, damages or other liability, whether in an action of contract,
tort or otherwise, arising from, out of or in connection with the
software or the use or other dealings in the software.}
@end quotation
@end copying
@c %**end of header
@titlepage
@title CFFI User Manual
@c @subtitle Version X.X
@c @author James Bielman
@page
@vskip 0pt plus 1filll
@insertcopying
@end titlepage
@contents
@ifnottex
@node Top
@top cffi
@insertcopying
@end ifnottex
@menu
* Introduction:: What is CFFI?
* Installation::
* Implementation Support::
* Tutorial:: Interactive intro to using CFFI.
* Wrapper generators:: CFFI forms from munging C source code.
* Foreign Types::
* Pointers::
* Strings::
* Variables::
* Functions::
* Libraries::
* Callbacks::
* The Groveller::
* Limitations::
* Platform-specific features:: Details about the underlying system.
* Glossary:: List of CFFI-specific terms and meanings.
* Comprehensive Index::
@detailmenu
--- Dictionary ---
Foreign Types
* convert-from-foreign:: Outside interface to backward type translator.
* convert-to-foreign:: Outside interface to forward type translator.
* defbitfield:: Defines a bitfield.
* defcstruct:: Defines a C structure type.
* defcunion:: Defines a C union type.
* defctype:: Defines a foreign typedef.
* defcenum:: Defines a C enumeration.
* define-foreign-type:: Defines a foreign type specifier.
* define-parse-method:: Specifies how a type should be parsed.
@c * explain-foreign-slot-value:: <unimplemented>
* foreign-bitfield-symbols:: Returns a list of symbols for a bitfield type.
* foreign-bitfield-value:: Calculates a value for a bitfield type.
* foreign-enum-keyword:: Finds a keyword in an enum type.
* foreign-enum-value:: Finds a value in an enum type.
* foreign-slot-names:: Returns a list of slot names in a foreign struct.
* foreign-slot-offset:: Returns the offset of a slot in a foreign struct.
* foreign-slot-pointer:: Returns a pointer to a slot in a foreign struct.
* foreign-slot-value:: Returns the value of a slot in a foreign struct.
* foreign-type-alignment:: Returns the alignment of a foreign type.
* foreign-type-size:: Returns the size of a foreign type.
* free-converted-object:: Outside interface to typed object deallocators.
* free-translated-object:: Defines how to free a oreign object.
* translate-from-foreign:: Defines a foreign-to-Lisp object translation.
* translate-to-foreign:: Defines a Lisp-to-foreign object translation.
* with-foreign-object:: Allocates a foreign object with dynamic extent.
@c * with-foreign-objects:: Plural form of @code{with-foreign-object}.
* with-foreign-slots:: Accesses the slots of a foreign structure.
Pointers
* foreign-free:: Deallocates memory.
* foreign-alloc:: Allocates memory.
* foreign-symbol-pointer:: Returns a pointer to a foreign symbol.
* inc-pointer:: Increments the address held by a pointer.
* incf-pointer:: Increments the pointer address in a place.
* make-pointer:: Returns a pointer to a given address.
* mem-aref:: Accesses the value of an index in an array.
* mem-ref:: Dereferences a pointer.
* null-pointer:: Returns a NULL pointer.
* null-pointer-p:: Tests a pointer for NULL value.
* pointerp:: Tests whether an object is a pointer or not.
* pointer-address:: Returns the address pointed to by a pointer.
* pointer-eq:: Tests if two pointers point to the same address.
* with-foreign-pointer:: Allocates memory with dynamic extent.
Strings
* *default-foreign-encoding*:: Default encoding for the string types.
* foreign-string-alloc:: Converts a Lisp string to a foreign string.
* foreign-string-free:: Deallocates memory used by a foreign string.
* foreign-string-to-lisp:: Converts a foreign string to a Lisp string.
* lisp-string-to-foreign:: Copies a Lisp string into a foreign string.
* with-foreign-string:: Allocates a foreign string with dynamic extent.
@c * with-foreign-strings:: Plural form of @code{with-foreign-string}.
* with-foreign-pointer-as-string:: Similar to CL's with-output-to-string.
Variables
* defcvar:: Defines a C global variable.
* get-var-pointer:: Returns a pointer to a defined global variable.
Functions
* defcfun:: Defines a foreign function.
* foreign-funcall:: Performs a call to a foreign function.
* foreign-funcall-pointer:: Performs a call through a foreign pointer.
Libraries
* close-foreign-library:: Closes a foreign library.
* *darwin-framework-directories*:: Search path for Darwin frameworks.
* define-foreign-library:: Explain how to load a foreign library.
* *foreign-library-directories*:: Search path for shared libraries.
* load-foreign-library:: Load a foreign library.
* load-foreign-library-error:: Signalled on failure of its namesake.
* use-foreign-library:: Load a foreign library when needed.
Callbacks
* callback:: Returns a pointer to a defined callback.
* defcallback:: Defines a Lisp callback.
* get-callback:: Returns a pointer to a defined callback.
@end detailmenu
@end menu
@c ===================================================================
@c CHAPTER: Introduction
@node Introduction
@chapter Introduction
@cffi{} is the Common Foreign Function Interface for @acronym{ANSI}
Common Lisp systems. By @dfn{foreign function} we mean a function
written in another programming language and having different data and
calling conventions than Common Lisp, namely, C. @cffi{} allows you
to call foreign functions and access foreign variables, all without
leaving the Lisp image.
We consider this manual ever a work in progress. If you have
difficulty with anything @cffi{}-specific presented in the manual,
please contact @email{cffi-devel@@common-lisp.net,the developers} with
details.
@heading Motivation
@xref{Tutorial-Comparison,, What makes Lisp different}, for
an argument in favor of @acronym{FFI} in general.
@cffi{}'s primary role in any image is to mediate between Lisp
developers and the widely varying @acronym{FFI}s present in the
various Lisp implementations it supports. With @cffi{}, you can
define foreign function interfaces while still maintaining portability
between implementations. It is not the first Common Lisp package with
this objective; however, it is meant to be a more malleable framework
than similar packages.
@heading Design Philosophy
@itemize
@item
Pointers do not carry around type information. Instead, type
information is supplied when pointers are dereferenced.
@item
A type safe pointer interface can be developed on top of an
untyped one. It is difficult to do the opposite.
@item
Functions are better than macros. When a macro could be used
for performance, use a compiler-macro instead.
@end itemize
@c ===================================================================
@c CHAPTER: Installation
@node Installation
@chapter Installation
@cffi{} can be obtained through one of the following means available
through its @uref{http://common-lisp.net/project/cffi/,,website}:
@itemize
@item
@uref{http://common-lisp.net/project/cffi/releases/?M=D,,official release
tarballs}
@item
@uref{http://common-lisp.net/project/cffi/darcs/cffi,,darcs
repository}
@item
@uref{http://common-lisp.net/project/cffi/tarballs/?M=D,,nightly-generated
snapshots}
@end itemize
In addition, you will need to obtain and install the following
dependencies:
@itemize
@item
@uref{http://common-lisp.net/project/babel/,,Babel}, a charset
encoding/decoding library.
@item
@uref{http://common-lisp.net/project/alexandria/,,Alexandria}, a
collection of portable public-domain utilities.
@item
@uref{http://www.cliki.net/trivial-features,,trivial-features}, a
portability layer that ensure consistent @code{*features*} across
multiple Common Lisp implementations.
@end itemize
You may find mechanisms such as
@uref{http://common-lisp.net/project/clbuild/,,clbuild} (recommended)
or @uref{http://www.cliki.net/ASDF-Install,,ASDF-Install} (not as
recommendable) helpful in getting and managing @cffi{} and its
dependencies.
@c ===================================================================
@c CHAPTER: Implementation Support
@node Implementation Support
@chapter Implementation Support
@cffi{} supports various free and commercial Lisp implementations:
Allegro CL, Corman CL, @sc{clisp}, @acronym{CMUCL}, @acronym{ECL},
LispWorks, Clozure CL, @acronym{SBCL} and the Scieneer CL.
In general, you should work with the latest versions of each
implementation since those will usually be tested against recent
versions of CFFI more often and might include necessary features or
bug fixes. Reasonable patches for compatibility with earlier versions
are welcome nevertheless.
@section Limitations
Some features are not supported in all implementations.
@c TODO: describe these features here.
@c flat-namespace too
@subheading Allegro CL
@itemize
@item
Does not support the @code{:long-long} type natively.
@item
Unicode support is limited to the Basic Multilingual Plane (16-bit
code points).
@end itemize
@subheading CMUCL
@itemize
@item
No Unicode support. (8-bit code points)
@end itemize
@subheading Corman CL
@itemize
@item
Does not support @code{foreign-funcall}.
@end itemize
@subheading @acronym{ECL}
@itemize
@item
On platforms where ECL's dynamic FFI is not supported (ie. when
@code{:dffi} is not present in @code{*features*}),
@code{cffi:load-foreign-library} does not work and you must use ECL's
own @code{ffi:load-foreign-library} with a constant string argument.
@item
Does not support the @code{:long-long} type natively.
@item
Unicode support is not enabled by default.
@end itemize
@subheading Lispworks
@itemize
@item
Does not support the @code{:long-long} type natively, except in 64-bit
platforms.
@item
Unicode support is limited to the Basic Multilingual Plane (16-bit
code points).
@end itemize
@subheading @acronym{SBCL}
@itemize
@item
Not all platforms support callbacks.
@end itemize
@c ===================================================================
@c CHAPTER: An Introduction to Foreign Interfaces and CFFI
@c This macro is merely a marker that I don't think I'll use after
@c all.
@macro tutorialsource {text}
@c \text\
@end macro
@c because I don't want to type this over and over
@macro clikicffi
http://www.cliki.net/CFFI
@end macro
@c TeX puts spurious newlines in when you use the above macro
@c in @examples &c. So it is expanded below in some places.
@node Tutorial
@chapter An Introduction to Foreign Interfaces and @acronym{CFFI}
@c Above, I don't use the cffi macro because it breaks TeX.
@cindex tutorial, @cffi{}
Users of many popular languages bearing semantic similarity to Lisp,
such as Perl and Python, are accustomed to having access to popular C
libraries, such as @acronym{GTK}, by way of ``bindings''. In Lisp, we
do something similar, but take a fundamentally different approach.
This tutorial first explains this difference, then explains how you
can use @cffi{}, a powerful system for calling out to C and C++ and
access C data from many Common Lisp implementations.
@cindex foreign functions and data
The concept can be generalized to other languages; at the time of
writing, only @cffi{}'s C support is fairly complete, but C++
support is being worked on. Therefore, we will interchangeably refer
to @dfn{foreign functions} and @dfn{foreign data}, and ``C functions''
and ``C data''. At no time will the word ``foreign'' carry its usual,
non-programming meaning.
This tutorial expects you to have a working understanding of both
Common Lisp and C, including the Common Lisp macro system.
@menu
* Tutorial-Comparison:: Why FFI?
* Tutorial-Getting a URL:: An FFI use case.
* Tutorial-Loading:: Load libcurl.so.
* Tutorial-Initializing:: Call a function in libcurl.so.
* Tutorial-easy_setopt:: An advanced libcurl function.
* Tutorial-Abstraction:: Why breaking it is necessary.
* Tutorial-Lisp easy_setopt:: Semi-Lispy option interface.
* Tutorial-Memory:: In C, you collect the garbage.
* Tutorial-Callbacks:: Make useful C function pointers.
* Tutorial-Completion:: Minimal get-url functionality.
* Tutorial-Types:: Defining new foreign types.
* Tutorial-Conclusion:: What's next?
@end menu
@node Tutorial-Comparison
@section What makes Lisp different
The following sums up how bindings to foreign libraries are usually
implemented in other languages, then in Common Lisp:
@table @asis
@item Perl, Python, Java, other one-implementation languages
@cindex @acronym{SWIG}
@cindex Perl
@cindex Python
Bindings are implemented as shared objects written in C. In some
cases, the C code is generated by a tool, such as @acronym{SWIG}, but
the result is the same: a new C library that manually translates
between the language implementation's objects, such as @code{PyObject}
in Python, and whatever C object is called for, often using C
functions provided by the implementation. It also translates between
the calling conventions of the language and C.
@item Common Lisp
@cindex @acronym{SLIME}
Bindings are written in Lisp. They can be created at-will by Lisp
programs. Lisp programmers can write new bindings and add them to the
image, using a listener such as @acronym{SLIME}, as easily as with
regular Lisp definitions. The only foreign library to load is the one
being wrapped---the one with the pure C interface; no C or other
non-Lisp compilation is required.
@end table
@cindex advantages of @acronym{FFI}
@cindex benefits of @acronym{FFI}
We believe the advantages of the Common Lisp approach far outweigh any
disadvantages. Incremental development with a listener can be as
productive for C binding development as it is with other Lisp
development. Keeping it ``in the [Lisp] family'', as it were, makes
it much easier for you and other Lisp programmers to load and use the
bindings. Common Lisp implementations such as @acronym{CMUCL}, freed
from having to provide a C interface to their own objects, are thus
freed to be implemented in another language (as @acronym{CMUCL} is)
while still allowing programmers to call foreign functions.
@cindex minimal bindings
Perhaps the greatest advantage is that using an @acronym{FFI} doesn't
obligate you to become a professional binding developer. Writers of
bindings for other languages usually end up maintaining or failing to
maintain complete bindings to the foreign library. Using an
@acronym{FFI}, however, means if you only need one or two functions,
you can write bindings for only those functions, and be assured that
you can just as easily add to the bindings if need be.
@cindex C abstractions
@cindex abstractions in C
The removal of the C compiler, or C interpretation of any kind,
creates the main disadvantage: some of C's ``abstractions'' are not
available, violating information encapsulation. For example,
@code{struct}s that must be passed on the stack, or used as return
values, without corresponding functional abstractions to create and
manage the @code{struct}s, must be declared explicitly in Lisp. This
is fine for structs whose contents are ``public'', but is not so
pleasant when a struct is supposed to be ``opaque'' by convention,
even though it is not so defined.@footnote{Admittedly, this is an
advanced issue, and we encourage you to leave this text until you are
more familiar with how @cffi{} works.}
Without an abstraction to create the struct, Lisp needs to be able to
lay out the struct in memory, so must know its internal details.
@cindex workaround for C
In these cases, you can create a minimal C library to provide the
missing abstractions, without destroying all the advantages of the
Common Lisp approach discussed above. In the case of @code{struct}s,
you can write simple, pure C functions that tell you how many bytes a
struct requires or allocate new structs, read and write fields of the
struct, or whatever operations are supposed to be
public.@footnote{This does not apply to structs whose contents are
intended to be part of the public library interface. In those cases,
a pure Lisp struct definition is always preferred. In fact, many
prefer to stay in Lisp and break the encapsulation anyway, placing the
burden of correct library interface definition on the library.}
@impnote{cffi-grovel, a project not yet part of @cffi{}, automates
this and other processes.}
Another disadvantage appears when you would rather use the foreign
language than Lisp. However, someone who prefers C to Lisp is not a
likely candidate for developing a Lisp interface to a C library.
@node Tutorial-Getting a URL
@section Getting a @acronym{URL}
@cindex c@acronym{URL}
The widely available @code{libcurl} is a library for downloading files
over protocols like @acronym{HTTP}. We will use @code{libcurl} with
@cffi{} to download a web page.
Please note that there are many other ways to download files from the
web, not least the @sc{cl-curl} project to provide bindings to
@code{libcurl} via a similar @acronym{FFI}.@footnote{Specifically,
@acronym{UFFI}, an older @acronym{FFI} that takes a somewhat different
approach compared to @cffi{}. I believe that these days (December
2005) @cffi{} is more portable and actively developed, though not as
mature yet. Consensus in the free @sc{unix} Common Lisp community
seems to be that @cffi{} is preferred for new development, though
@acronym{UFFI} will likely go on for quite some time as many projects
already use it. @cffi{} includes the @code{UFFI-COMPAT} package for
complete compatibility with @acronym{UFFI}.}
@uref{http://curl.haxx.se/libcurl/c/libcurl-tutorial.html,,libcurl-tutorial(3)}
is a tutorial for @code{libcurl} programming in C. We will follow
that to develop a binding to download a file. We will also use
@file{curl.h}, @file{easy.h}, and the @command{man} pages for the
@code{libcurl} function, all available in the @samp{curl-dev} package
or equivalent for your system, or in the c@acronym{URL} source code
package. If you have the development package, the headers should be
installed in @file{/usr/include/curl/}, and the @command{man} pages
may be accessed through your favorite @command{man} facility.
@node Tutorial-Loading
@section Loading foreign libraries
@cindex loading @cffi{}
@cindex requiring @cffi{}
First of all, we will create a package to work in. You can save these
forms in a file, or just send them to the listener as they are. If
creating bindings for an @acronym{ASDF} package of yours, you will
want to add @code{:cffi} to the @code{:depends-on} list in your
@file{.asd} file. Otherwise, just use the @code{asdf:oos} function to
load @cffi{}.
@tutorialsource{Initialization}
@lisp
(asdf:oos 'asdf:load-op :cffi)
;;; @lispcmt{Nothing special about the "CFFI-USER" package. We're just}
;;; @lispcmt{using it as a substitute for your own CL package.}
(defpackage :cffi-user
(:use :common-lisp :cffi))
(in-package :cffi-user)
(define-foreign-library libcurl
(:unix (:or "libcurl.so.3" "libcurl.so"))
(t (:default "libcurl")))
(use-foreign-library libcurl)
@end lisp
@cindex foreign library load
@cindex library, foreign
Using @code{define-foreign-library} and @code{use-foreign-library}, we
have loaded @code{libcurl} into Lisp, much as the linker does when you
start a C program, or @code{common-lisp:load} does with a Lisp source
file or @acronym{FASL} file. We special-cased for @sc{unix} machines
to always load a particular version, the one this tutorial was tested
with; for those who don't care, the @code{define-foreign-library}
clause @code{(t (:default "libcurl"))} should be satisfactory, and
will adapt to various operating systems.
@node Tutorial-Initializing
@section Initializing @code{libcurl}
@cindex function definition
After the introductory matter, the tutorial goes on to present the
first function you should use.
@example
CURLcode curl_global_init(long flags);
@end example
@noindent
Let's pick this apart into appropriate Lisp code:
@tutorialsource{First CURLcode}
@lisp
;;; @lispcmt{A CURLcode is the universal error code. curl/curl.h says}
;;; @lispcmt{no return code will ever be removed, and new ones will be}
;;; @lispcmt{added to the end.}
(defctype curl-code :int)
;;; @lispcmt{Initialize libcurl with FLAGS.}
(defcfun "curl_global_init" curl-code
(flags :long))
@end lisp
@impnote{By default, CFFI assumes the UNIX viewpoint that there is one
C symbol namespace, containing all symbols in all loaded objects.
This is not so on Windows and Darwin, but we emulate UNIX's behaviour
there. @ref{defcfun} for more details.}
Note the parallels with the original C declaration. We've defined
@code{curl-code} as a wrapping type for @code{:int}; right now, it
only marks it as special, but later we will do something more
interesting with it. The point is that we don't have to do it yet.
@cindex calling foreign functions
Looking at @file{curl.h}, @code{CURL_GLOBAL_NOTHING}, a possible value
for @code{flags} above, is defined as @samp{0}. So we can now call
the function:
@example
@sc{cffi-user>} (curl-global-init 0)
@result{} 0
@end example
@cindex looks like it worked
Looking at @file{curl.h} again, @code{0} means @code{CURLE_OK}, so it
looks like the call succeeded. Note that @cffi{} converted the
function name to a Lisp-friendly name. You can specify your own name
if you want; use @code{("curl_global_init" @var{your-name-here})} as
the @var{name} argument to @code{defcfun}.
The tutorial goes on to have us allocate a handle. For good measure,
we should also include the deallocator. Let's look at these
functions:
@example
CURL *curl_easy_init( );
void curl_easy_cleanup(CURL *handle);
@end example
Advanced users may want to define special pointer types; we will
explore this possibility later. For now, just treat every pointer as
the same:
@tutorialsource{curl_easy handles}
@lisp
(defcfun "curl_easy_init" :pointer)
(defcfun "curl_easy_cleanup" :void
(easy-handle :pointer))
@end lisp
Now we can continue with the tutorial:
@example
@sc{cffi-user>} (defparameter *easy-handle* (curl-easy-init))
@result{} *EASY-HANDLE*
@sc{cffi-user>} *easy-handle*
@result{} #<FOREIGN-ADDRESS #x09844EE0>
@end example
@cindex pointers in Lisp
Note the print representation of a pointer. It changes depending on
what Lisp you are using, but that doesn't make any difference to
@cffi{}.
@node Tutorial-easy_setopt
@section Setting download options
The @code{libcurl} tutorial says we'll want to set many options before
performing any download actions. This is done through
@code{curl_easy_setopt}:
@c That is literally ..., not an ellipsis.
@example
CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);
@end example
@cindex varargs
@cindex foreign arguments
We've introduced a new twist: variable arguments. There is no obvious
translation to the @code{defcfun} form, particularly as there are four
possible argument types. Because of the way C works, we could define
four wrappers around @code{curl_easy_setopt}, one for each type; in
this case, however, we'll use the general-purpose macro
@code{foreign-funcall} to call this function.
@cindex enumeration, C
To make things easier on ourselves, we'll create an enumeration of the
kinds of options we want to set. The @code{enum CURLoption} isn't the
most straightforward, but reading the @code{CINIT} C macro definition
should be enlightening.
@tutorialsource{CURLoption enumeration}
@lisp
(defmacro define-curl-options (name type-offsets &rest enum-args)
"As with CFFI:DEFCENUM, except each of ENUM-ARGS is as follows:
(NAME TYPE NUMBER)
Where the arguments are as they are with the CINIT macro defined
in curl.h, except NAME is a keyword.
TYPE-OFFSETS is a plist of TYPEs to their integer offsets, as
defined by the CURLOPTTYPE_LONG et al constants in curl.h."
(flet ((enumerated-value (type offset)
(+ (getf type-offsets type) offset)))
`(progn
(defcenum ,name
,@@(loop for (name type number) in enum-args
collect (list name (enumerated-value type number))))
',name))) ;@lispcmt{for REPL users' sanity}
(define-curl-options curl-option
(long 0 objectpoint 10000 functionpoint 20000 off-t 30000)
(:noprogress long 43)
(:nosignal long 99)
(:errorbuffer objectpoint 10)
(:url objectpoint 2))
@end lisp
With some well-placed Emacs @code{query-replace-regexp}s, you could
probably similarly define the entire @code{CURLoption} enumeration. I
have selected to transcribe a few that we will use in this tutorial.
If you're having trouble following the macrology, just macroexpand the
@code{curl-option} definition, or see the following macroexpansion,
conveniently downcased and reformatted:
@tutorialsource{DEFINE-CURL-OPTIONS macroexpansion}
@lisp
(progn
(defcenum curl-option
(:noprogress 43)
(:nosignal 99)
(:errorbuffer 10010)
(:url 10002))
'curl-option)
@end lisp
@noindent
That seems more than reasonable. You may notice that we only use the
@var{type} to compute the real enumeration offset; we will also need
the type information later.
First, however, let's make sure a simple call to the foreign function
works:
@example
@sc{cffi-user>} (foreign-funcall "curl_easy_setopt"
:pointer *easy-handle*
curl-option :nosignal :long 1 curl-code)
@result{} 0
@end example
@code{foreign-funcall}, despite its surface simplicity, can be used to
call any C function. Its first argument is a string, naming the
function to be called. Next, for each argument, we pass the name of
the C type, which is the same as in @code{defcfun}, followed by a Lisp
object representing the data to be passed as the argument. The final
argument is the return type, for which we use the @code{curl-code}
type defined earlier.
@code{defcfun} just puts a convenient fa@,cade on
@code{foreign-funcall}.@footnote{This isn't entirely true; some Lisps
don't support @code{foreign-funcall}, so @code{defcfun} is implemented
without it. @code{defcfun} may also perform optimizations that
@code{foreign-funcall} cannot.} Our earlier call to
@code{curl-global-init} could have been written as follows:
@example
@sc{cffi-user>} (foreign-funcall "curl_global_init" :long 0
curl-code)
@result{} 0
@end example
Before we continue, we will take a look at what @cffi{} can and can't
do, and why this is so.
@node Tutorial-Abstraction
@section Breaking the abstraction
@cindex breaking the abstraction
@cindex abstraction breaking
In @ref{Tutorial-Comparison,, What makes Lisp different}, we mentioned
that writing an @acronym{FFI} sometimes requires depending on
information not provided as part of the interface. The easy option
@code{CURLOPT_WRITEDATA}, which we will not provide as part of the
Lisp interface, illustrates this issue.
Strictly speaking, the @code{curl-option} enumeration is not
necessary; we could have used @code{:int 99} instead of
@code{curl-option :nosignal} in our call to @code{curl_easy_setopt}
above. We defined it anyway, in part to hide the fact that we are
breaking the abstraction that the C @code{enum} provides. If the
c@acronym{URL} developers decide to change those numbers later, we
must change the Lisp enumeration, because enumeration values are not
provided in the compiled C library, @code{libcurl.so.3}.
@cffi{} works because the most useful things in C libraries ---
non-static functions and non-static variables --- are included
accessibly in @code{libcurl.so.3}. A C compiler that violated this
would be considered a worthless compiler.
The other thing @code{define-curl-options} does is give the ``type''
of the third argument passed to @code{curl_easy_setopt}. Using this
information, we can tell that the @code{:nosignal} option should
accept a long integer argument. We can implicitly assume @code{t}
@equiv{} 1 and @code{nil} @equiv{} 0, as it is in C, which takes care
of the fact that @code{CURLOPT_NOSIGNAL} is really asking for a
boolean.
The ``type'' of @code{CURLOPT_WRITEDATA} is @code{objectpoint}.
However, it is really looking for a @code{FILE*}.
@code{CURLOPT_ERRORBUFFER} is looking for a @code{char*}, so there is
no obvious @cffi{} type but @code{:pointer}.
The first thing to note is that nowhere in the C interface includes
this information; it can only be found in the manual. We could
disjoin these clearly different types ourselves, by splitting
@code{objectpoint} into @code{filepoint} and @code{charpoint}, but we
are still breaking the abstraction, because we have to augment the
entire enumeration form with this additional
information.@footnote{Another possibility is to allow the caller to
specify the desired C type of the third argument. This is essentially
what happens in a call to the function written in C.}
@cindex streams and C
@cindex @sc{file}* and streams
The second is that the @code{CURLOPT_WRITEDATA} argument is completely
incompatible with the desired Lisp data, a
stream.@footnote{@xref{Other Kinds of Streams,,, libc, GNU C Library
Reference}, for a @acronym{GNU}-only way to extend the @code{FILE*}
type. You could use this to convert Lisp streams to the needed C
data. This would be quite involved and far outside the scope of this
tutorial.} It is probably acceptable if we are controlling every file
we might want to use as this argument, in which case we can just call
the foreign function @code{fopen}. Regardless, though, we can't write
to arbitrary streams, which is exactly what we want to do for this
application.
Finally, note that the @code{curl_easy_setopt} interface itself is a
hack, intended to work around some of the drawbacks of C. The
definition of @code{Curl_setopt}, while long, is far less cluttered
than the equivalent disjoint-function set would be; in addition,
setting a new option in an old @code{libcurl} can generate a run-time
error rather than breaking the compile. Lisp can just as concisely
generate functions as compare values, and the ``undefined function''
error is just as useful as any explicit error we could define here
might be.
@node Tutorial-Lisp easy_setopt
@section Option functions in Lisp
We could use @code{foreign-funcall} directly every time we wanted to
call @code{curl_easy_setopt}. However, we can encapsulate some of the
necessary information with the following.
@lisp
;;; @lispcmt{We will use this type later in a more creative way. For}
;;; @lispcmt{now, just consider it a marker that this isn't just any}
;;; @lispcmt{pointer.}
(defctype easy-handle :pointer)
(defmacro curl-easy-setopt (easy-handle enumerated-name
value-type new-value)
"Call `curl_easy_setopt' on EASY-HANDLE, using ENUMERATED-NAME
as the OPTION. VALUE-TYPE is the CFFI foreign type of the third
argument, and NEW-VALUE is the Lisp data to be translated to the
third argument. VALUE-TYPE is not evaluated."
`(foreign-funcall "curl_easy_setopt" easy-handle ,easy-handle
curl-option ,enumerated-name
,value-type ,new-value curl-code))
@end lisp
Now we define a function for each kind of argument that encodes the
correct @code{value-type} in the above. This can be done reasonably
in the @code{define-curl-options} macroexpansion; after all, that is
where the different options are listed!
@cindex Lispy C functions
We could make @code{cl:defun} forms in the expansion that simply call
@code{curl-easy-setopt}; however, it is probably easier and clearer to
use @code{defcfun}. @code{define-curl-options} was becoming unwieldy,
so I defined some helpers in this new definition.
@smalllisp
(defun curry-curl-option-setter (function-name option-keyword)
"Wrap the function named by FUNCTION-NAME with a version that
curries the second argument as OPTION-KEYWORD.
This function is intended for use in DEFINE-CURL-OPTION-SETTER."
(setf (symbol-function function-name)
(let ((c-function (symbol-function function-name)))
(lambda (easy-handle new-value)
(funcall c-function easy-handle option-keyword
new-value)))))
(defmacro define-curl-option-setter (name option-type
option-value foreign-type)
"Define (with DEFCFUN) a function NAME that calls
curl_easy_setopt. OPTION-TYPE and OPTION-VALUE are the CFFI
foreign type and value to be passed as the second argument to
easy_setopt, and FOREIGN-TYPE is the CFFI foreign type to be used
for the resultant function's third argument.
This macro is intended for use in DEFINE-CURL-OPTIONS."
`(progn
(defcfun ("curl_easy_setopt" ,name) curl-code
(easy-handle easy-handle)
(option ,option-type)
(new-value ,foreign-type))
(curry-curl-option-setter ',name ',option-value)))
(defmacro define-curl-options (type-name type-offsets &rest enum-args)
"As with CFFI:DEFCENUM, except each of ENUM-ARGS is as follows:
(NAME TYPE NUMBER)
Where the arguments are as they are with the CINIT macro defined
in curl.h, except NAME is a keyword.
TYPE-OFFSETS is a plist of TYPEs to their integer offsets, as
defined by the CURLOPTTYPE_LONG et al constants in curl.h.
Also, define functions for each option named
set-`TYPE-NAME'-`OPTION-NAME', where OPTION-NAME is the NAME from
the above destructuring."
(flet ((enumerated-value (type offset)
(+ (getf type-offsets type) offset))
;;@lispcmt{map PROCEDURE, destructuring each of ENUM-ARGS}
(map-enum-args (procedure)
(mapcar (lambda (arg) (apply procedure arg)) enum-args))
;;@lispcmt{build a name like SET-CURL-OPTION-NOSIGNAL}
(make-setter-name (option-name)
(intern (concatenate
'string "SET-" (symbol-name type-name)
"-" (symbol-name option-name)))))
`(progn
(defcenum ,type-name
,@@(map-enum-args
(lambda (name type number)
(list name (enumerated-value type number)))))
,@@(map-enum-args
(lambda (name type number)
(declare (ignore number))
`(define-curl-option-setter ,(make-setter-name name)
,type-name ,name ,(ecase type
(long :long)
(objectpoint :pointer)
(functionpoint :pointer)
(off-t :long)))))
',type-name)))
@end smalllisp
@noindent
Macroexpanding our @code{define-curl-options} form once more, we
see something different:
@lisp
(progn
(defcenum curl-option
(:noprogress 43)
(:nosignal 99)
(:errorbuffer 10010)
(:url 10002))
(define-curl-option-setter set-curl-option-noprogress
curl-option :noprogress :long)
(define-curl-option-setter set-curl-option-nosignal
curl-option :nosignal :long)
(define-curl-option-setter set-curl-option-errorbuffer
curl-option :errorbuffer :pointer)
(define-curl-option-setter set-curl-option-url
curl-option :url :pointer)
'curl-option)
@end lisp
@noindent
Macroexpanding one of the new @code{define-curl-option-setter}
forms yields the following:
@lisp
(progn
(defcfun ("curl_easy_setopt" set-curl-option-nosignal) curl-code
(easy-handle easy-handle)
(option curl-option)
(new-value :long))
(curry-curl-option-setter 'set-curl-option-nosignal ':nosignal))
@end lisp
@noindent
Finally, let's try this out:
@example
@sc{cffi-user>} (set-curl-option-nosignal *easy-handle* 1)
@result{} 0
@end example
@noindent
Looks like it works just as well. This interface is now reasonably
high-level to wash out some of the ugliness of the thinnest possible
@code{curl_easy_setopt} @acronym{FFI}, without obscuring the remaining
C bookkeeping details we will explore.
@node Tutorial-Memory
@section Memory management
According to the documentation for @code{curl_easy_setopt}, the type
of the third argument when @var{option} is @code{CURLOPT_ERRORBUFFER}
is @code{char*}. Above, we've defined
@code{set-curl-option-errorbuffer} to accept a @code{:pointer} as the
new option value. However, there is a @cffi{} type @code{:string},
which translates Lisp strings to C strings when passed as arguments to
foreign function calls. Why not, then, use @code{:string} as the
@cffi{} type of the third argument? There are two reasons, both
related to the necessity of breaking abstraction described in
@ref{Tutorial-Abstraction,, Breaking the abstraction}.
The first reason also applies to @code{CURLOPT_URL}, which we will use
to illustrate the point. Assuming we have changed the type of the
third argument underlying @code{set-curl-option-url} to
@code{:string}, look at these two equivalent forms.
@lisp
(set-curl-option-url *easy-handle* "http://www.cliki.net/CFFI")
@equiv{} (with-foreign-string (url "http://www.cliki.net/CFFI")
(foreign-funcall "curl_easy_setopt" easy-handle *easy-handle*
curl-option :url :pointer url curl-code))
@end lisp
@noindent
The latter, in fact, is mostly equivalent to what a foreign function
call's macroexpansion actually does. As you can see, the Lisp string
@code{"@clikicffi{}"} is copied into a @code{char} array and
null-terminated; the pointer to beginning of this array, now a C
string, is passed as a @cffi{} @code{:pointer} to the foreign
function.
@cindex dynamic extent
@cindex foreign values with dynamic extent
Unfortunately, the C abstraction has failed us, and we must break it.
While @code{:string} works well for many @code{char*} arguments, it
does not for cases like this. As the @code{curl_easy_setopt}
documentation explains, ``The string must remain present until curl no
longer needs it, as it doesn't copy the string.'' The C string
created by @code{with-foreign-string}, however, only has dynamic
extent: it is ``deallocated'' when the body (above containing the
@code{foreign-funcall} form) exits.
@cindex premature deallocation
If we are supposed to keep the C string around, but it goes away, what
happens when some @code{libcurl} function tries to access the
@acronym{URL} string? We have reentered the dreaded world of C
``undefined behavior''. In some Lisps, it will probably get a chunk
of the Lisp/C stack. You may segfault. You may get some random piece
of other data from the heap. Maybe, in a world where ``dynamic
extent'' is defined to be ``infinite extent'', everything will turn
out fine. Regardless, results are likely to be almost universally
unpleasant.@footnote{``@i{But I thought Lisp was supposed to protect
me from all that buggy C crap!}'' Before asking a question like that,
remember that you are a stranger in a foreign land, whose residents
have a completely different set of values.}
Returning to the current @code{set-curl-option-url} interface, here is
what we must do:
@lisp
(let (easy-handle)
(unwind-protect
(with-foreign-string (url "http://www.cliki.net/CFFI")
(setf easy-handle (curl-easy-init))
(set-curl-option-url easy-handle url)
#|@lispcmt{do more with the easy-handle, like actually get the URL}|#)
(when easy-handle
(curl-easy-cleanup easy-handle))))
@end lisp
@c old comment to luis: I go on to say that this isn't obviously
@c extensible to new option settings that require C strings to stick
@c around, as it would involve re-evaluating the unwind-protect form
@c with more dynamic memory allocation. So I plan to show how to
@c write something similar to ObjC's NSAutoreleasePool, to be managed
@c with a simple unwind-protect form.
@noindent
That is fine for the single string defined here, but for every string
option we want to pass, we have to surround the body of
@code{with-foreign-string} with another @code{with-foreign-string}
wrapper, or else do some extremely error-prone pointer manipulation
and size calculation in advance. We could alleviate some of the pain
with a recursively expanding macro, but this would not remove the need
to modify the block every time we want to add an option, anathema as
it is to a modular interface.
Before modifying the code to account for this case, consider the other
reason we can't simply use @code{:string} as the foreign type. In C,
a @code{char *} is a @code{char *}, not necessarily a string. The
option @code{CURLOPT_ERRORBUFFER} accepts a @code{char *}, but does
not expect anything about the data there. However, it does expect
that some @code{libcurl} function we call later can write a C string
of up to 255 characters there. We, the callers of the function, are
expected to read the C string at a later time, exactly the opposite of
what @code{:string} implies.
With the semantics for an input string in mind --- namely, that the
string should be kept around until we @code{curl_easy_cleanup} the
easy handle --- we are ready to extend the Lisp interface:
@lisp
(defvar *easy-handle-cstrings* (make-hash-table)
"Hashtable of easy handles to lists of C strings that may be
safely freed after the handle is freed.")
(defun make-easy-handle ()
"Answer a new CURL easy interface handle, to which the lifetime
of C strings may be tied. See `add-curl-handle-cstring'."
(let ((easy-handle (curl-easy-init)))
(setf (gethash easy-handle *easy-handle-cstrings*) '())
easy-handle))
(defun free-easy-handle (handle)
"Free CURL easy interface HANDLE and any C strings created to
be its options."
(curl-easy-cleanup handle)
(mapc #'foreign-string-free
(gethash handle *easy-handle-cstrings*))
(remhash handle *easy-handle-cstrings*))
(defun add-curl-handle-cstring (handle cstring)
"Add CSTRING to be freed when HANDLE is, answering CSTRING."
(car (push cstring (gethash handle *easy-handle-cstrings*))))
@end lisp
@noindent
Here we have redefined the interface to create and free handles, to
associate a list of allocated C strings with each handle while it
exists. The strategy of using different function names to wrap around
simple foreign functions is more common than the solution implemented
earlier with @code{curry-curl-option-setter}, which was to modify the
function name's function slot.@footnote{There are advantages and
disadvantages to each approach; I chose to @code{(setf
symbol-function)} earlier because it entailed generating fewer magic
function names.}
Incidentally, the next step is to redefine
@code{curry-curl-option-setter} to allocate C strings for the
appropriate length of time, given a Lisp string as the
@code{new-value} argument:
@lisp
(defun curry-curl-option-setter (function-name option-keyword)
"Wrap the function named by FUNCTION-NAME with a version that
curries the second argument as OPTION-KEYWORD.
This function is intended for use in DEFINE-CURL-OPTION-SETTER."
(setf (symbol-function function-name)
(let ((c-function (symbol-function function-name)))
(lambda (easy-handle new-value)
(funcall c-function easy-handle option-keyword
(if (stringp new-value)
(add-curl-handle-cstring
easy-handle
(foreign-string-alloc new-value))
new-value))))))
@end lisp
@noindent
A quick analysis of the code shows that you need only reevaluate the
@code{curl-option} enumeration definition to take advantage of these
new semantics. Now, for good measure, let's reallocate the handle
with the new functions we just defined, and set its @acronym{URL}:
@example
@sc{cffi-user>} (curl-easy-cleanup *easy-handle*)
@result{} NIL
@sc{cffi-user>} (setf *easy-handle* (make-easy-handle))
@result{} #<FOREIGN-ADDRESS #x09844EE0>
@sc{cffi-user>} (set-curl-option-nosignal *easy-handle* 1)
@result{} 0
@sc{cffi-user>} (set-curl-option-url *easy-handle*
"http://www.cliki.net/CFFI")
@result{} 0
@end example
@cindex strings
For fun, let's inspect the Lisp value of the C string that was created
to hold @code{"@clikicffi{}"}. By virtue of the implementation of
@code{add-curl-handle-cstring}, it should be accessible through the
hash table defined:
@example
@sc{cffi-user>} (foreign-string-to-lisp
(car (gethash *easy-handle* *easy-handle-cstrings*)))
@result{} "http://www.cliki.net/CFFI"
@end example
@noindent
Looks like that worked, and @code{libcurl} now knows what
@acronym{URL} we want to retrieve.
Finally, we turn back to the @code{:errorbuffer} option mentioned at
the beginning of this section. Whereas the abstraction added to
support string inputs works fine for cases like @code{CURLOPT_URL}, it
hides the detail of keeping the C string; for @code{:errorbuffer},
however, we need that C string.
In a moment, we'll define something slightly cleaner, but for now,
remember that you can always hack around anything. We're modifying
handle creation, so make sure you free the old handle before
redefining @code{free-easy-handle}.
@smalllisp
(defvar *easy-handle-errorbuffers* (make-hash-table)
"Hashtable of easy handles to C strings serving as error
writeback buffers.")
;;; @lispcmt{An extra byte is very little to pay for peace of mind.}
(defparameter *curl-error-size* 257
"Minimum char[] size used by cURL to report errors.")
(defun make-easy-handle ()
"Answer a new CURL easy interface handle, to which the lifetime
of C strings may be tied. See `add-curl-handle-cstring'."
(let ((easy-handle (curl-easy-init)))
(setf (gethash easy-handle *easy-handle-cstrings*) '())
(setf (gethash easy-handle *easy-handle-errorbuffers*)
(foreign-alloc :char :count *curl-error-size*
:initial-element 0))
easy-handle))
(defun free-easy-handle (handle)
"Free CURL easy interface HANDLE and any C strings created to
be its options."
(curl-easy-cleanup handle)
(foreign-free (gethash handle *easy-handle-errorbuffers*))
(remhash handle *easy-handle-errorbuffers*)
(mapc #'foreign-string-free
(gethash handle *easy-handle-cstrings*))
(remhash handle *easy-handle-cstrings*))
(defun get-easy-handle-error (handle)
"Answer a string containing HANDLE's current error message."
(foreign-string-to-lisp
(gethash handle *easy-handle-errorbuffers*)))
@end smalllisp
Be sure to once again set the options we've set thus far. You may
wish to define yet another wrapper function to do this.
@node Tutorial-Callbacks
@section Calling Lisp from C
If you have been reading
@uref{http://curl.haxx.se/libcurl/c/curl_easy_setopt.html,,
@code{curl_easy_setopt(3)}}, you should have noticed that some options
accept a function pointer. In particular, we need one function
pointer to set as @code{CURLOPT_WRITEFUNCTION}, to be called by
@code{libcurl} rather than the reverse, in order to receive data as it
is downloaded.
A binding writer without the aid of @acronym{FFI} usually approaches
this problem by writing a C function that accepts C data, converts to
the language's internal objects, and calls the callback provided by
the user, again in a reverse of usual practices.
The @cffi{} approach to callbacks precisely mirrors its differences
with the non-@acronym{FFI} approach on the ``calling C from Lisp''
side, which we have dealt with exclusively up to now. That is, you
define a callback function in Lisp using @code{defcallback}, and
@cffi{} effectively creates a C function to be passed as a function
pointer.
@impnote{This is much trickier than calling C functions from Lisp, as
it literally involves somehow generating a new C function that is as
good as any created by the compiler. Therefore, not all Lisps support
them. @xref{Implementation Support}, for information about @cffi{}
support issues in this and other areas. You may want to consider
changing to a Lisp that supports callbacks in order to continue with
this tutorial.}
@cindex callback definition
@cindex defining callbacks
Defining a callback is very similar to defining a callout; the main
difference is that we must provide some Lisp forms to be evaluated as
part of the callback. Here is the signature for the function the
@code{:writefunction} option takes:
@example
size_t
@var{function}(void *ptr, size_t size, size_t nmemb, void *stream);
@end example
@impnote{size_t is almost always an unsigned int. You can get this
and many other types using feature tests for your system by using
cffi-grovel.}
The above signature trivially translates into a @cffi{}
@code{defcallback} form, as follows.
@lisp
;;; @lispcmt{Alias in case size_t changes.}
(defctype size :unsigned-int)
;;; @lispcmt{To be set as the CURLOPT_WRITEFUNCTION of every easy handle.}
(defcallback easy-write size ((ptr :pointer) (size size)
(nmemb size) (stream :pointer))
(let ((data-size (* size nmemb)))
(handler-case
;; @lispcmt{We use the dynamically-bound *easy-write-procedure* to}
;; @lispcmt{call a closure with useful lexical context.}
(progn (funcall (symbol-value '*easy-write-procedure*)
(foreign-string-to-lisp ptr data-size nil))
data-size) ;@lispcmt{indicates success}
;; @lispcmt{The WRITEFUNCTION should return something other than the}
;; @lispcmt{#bytes available to signal an error.}
(error () (if (zerop data-size) 1 0)))))
@end lisp
First, note the correlation of the first few forms, used to declare
the C function's signature, with the signature in C syntax. We
provide a Lisp name for the function, its return type, and a name and
type for each argument.
In the body, we call the dynamically-bound
@code{*easy-write-procedure*} with a ``finished'' translation, of
pulling together the raw data and size into a Lisp string, rather than
deal with the data directly. As part of calling
@code{curl_easy_perform} later, we'll bind that variable to a closure
with more useful lexical bindings than the top-level
@code{defcallback} form.
Finally, we make a halfhearted effort to prevent non-local exits from
unwinding the C stack, covering the most likely case with an
@code{error} handler, which is usually triggered
unexpectedly.@footnote{Unfortunately, we can't protect against
@emph{all} non-local exits, such as @code{return}s and @code{throw}s,
because @code{unwind-protect} cannot be used to ``short-circuit'' a
non-local exit in Common Lisp, due to proposal @code{minimal} in
@uref{http://www.lisp.org/HyperSpec/Issues/iss152-writeup.html,
@acronym{ANSI} issue @sc{Exit-Extent}}. Furthermore, binding an
@code{error} handler prevents higher-up code from invoking restarts
that may be provided under the callback's dynamic context. Such is
the way of compromise.} The reason is that most C code is written to
understand its own idiosyncratic error condition, implemented above in
the case of @code{curl_easy_perform}, and more ``undefined behavior''
can result if we just wipe C stack frames without allowing them to
execute whatever cleanup actions as they like.
Using the @code{CURLoption} enumeration in @file{curl.h} once more, we
can describe the new option by modifying and reevaluating
@code{define-curl-options}.
@lisp
(define-curl-options curl-option
(long 0 objectpoint 10000 functionpoint 20000 off-t 30000)
(:noprogress long 43)
(:nosignal long 99)
(:errorbuffer objectpoint 10)
(:url objectpoint 2)
(:writefunction functionpoint 11)) ;@lispcmt{new item here}
@end lisp
Finally, we can use the defined callback and the new
@code{set-curl-option-writefunction} to finish configuring the easy
handle, using the @code{callback} macro to retrieve a @cffi{}
@code{:pointer}, which works like a function pointer in C code.
@example
@sc{cffi-user>} (set-curl-option-writefunction
*easy-handle* (callback easy-write))
@result{} 0
@end example
@node Tutorial-Completion
@section A complete @acronym{FFI}?
@c TeX goes insane on @uref{@clikicffi{}}
With all options finally set and a medium-level interface developed,
we can finish the definition and retrieve
@uref{http://www.cliki.net/CFFI}, as is done in the tutorial.
@lisp
(defcfun "curl_easy_perform" curl-code
(handle easy-handle))
@end lisp
@example
@sc{cffi-user>} (with-output-to-string (contents)
(let ((*easy-write-procedure*
(lambda (string)
(write-string string contents))))
(declare (special *easy-write-procedure*))
(curl-easy-perform *easy-handle*)))
@result{} "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"
@enddots{}
Now fear, comprehensively</P>
"
@end example
Of course, that itself is slightly unwieldy, so you may want to define
a function around it that simply retrieves a @acronym{URL}. I will
leave synthesis of all the relevant @acronym{REPL} forms presented
thus far into a single function as an exercise for the reader.
The remaining sections of this tutorial explore some advanced features
of @cffi{}; the definition of new types will receive special
attention. Some of these features are essential for particular
foreign function calls; some are very helpful when trying to develop a
Lispy interface to C.
@node Tutorial-Types
@section Defining new types
We've occasionally used the @code{defctype} macro in previous sections
as a kind of documentation, much what you'd use @code{typedef} for in
C. We also tried one special kind of type definition, the
@code{defcenum} type. @xref{defcstruct}, for a definition macro that
may come in handy if you need to use C @code{struct}s as data.
@cindex type definition
@cindex data in Lisp and C
@cindex translating types
However, all of these are mostly sugar for the powerful underlying
foreign type interface called @dfn{type translators}. You can easily
define new translators for any simple named foreign type. Since we've
defined the new type @code{curl-code} to use as the return type for
various @code{libcurl} functions, we can use that to directly convert
c@acronym{URL} errors to Lisp errors.
@code{defctype}'s purpose is to define simple @code{typedef}-like
aliases. In order to use @dfn{type translators} we must use the
@code{define-foreign-type} macro. So let's redefine @code{curl-code}
using it.
@lisp
(define-foreign-type curl-code-type ()
()
(:actual-type :int)
(:simple-parser curl-code))
@end lisp
@code{define-foreign-type} is a thin wrapper around @code{defclass}.
For now, all you need to know in the context of this example is that
it does what @code{(defctype curl-code :int)} would do and,
additionally, defines a new class @code{curl-code-type} which we will
take advantage of shortly.
The @code{CURLcode} enumeration seems to follow the typical error code
convention of @samp{0} meaning all is well, and each non-zero integer
indicating a different kind of error. We can apply that trivially to
differentiate between normal exits and error exits.
@lisp
(define-condition curl-code-error (error)
(($code :initarg :curl-code :reader curl-error-code))
(:report (lambda (c stream)
(format stream "libcurl function returned error ~A"
(curl-error-code c))))
(:documentation "Signalled when a libcurl function answers
a code other than CURLE_OK."))
(defmethod translate-from-foreign (value (type curl-code-type))
"Raise a CURL-CODE-ERROR if VALUE, a curl-code, is non-zero."
(if (zerop value)
:curle-ok
(error 'curl-code-error :curl-code value)))
@end lisp
@noindent
The heart of this translator is new method
@code{translate-from-foreign}. By specializing the @var{type}
parameter on @code{curl-code-type}, we immediately modify the behavior
of every function that returns a @code{curl-code} to pass the result
through this new method.
To see the translator in action, try invoking a function that returns
a @code{curl-code}. You need to reevaluate the respective
@code{defcfun} form so that it picks up the new @code{curl-code}
definition.
@example
@sc{cffi-user>} (set-curl-option-nosignal *easy-handle* 1)
@result{} :CURLE-OK
@end example
@noindent
As the result was @samp{0}, the new method returned @code{:curle-ok},
just as specified.@footnote{It might be better to return
@code{(values)} than @code{:curle-ok} in real code, but this is good
for illustration.} I will leave disjoining the separate
@code{CURLcode}s into condition types and improving the @code{:report}
function as an exercise for you.
The creation of @code{*easy-handle-cstrings*} and
@code{*easy-handle-errorbuffers*} as properties of @code{easy-handle}s
is a kluge. What we really want is a Lisp structure that stores these
properties along with the C pointer. Unfortunately,
@code{easy-handle} is currently just a fancy name for the foreign type
@code{:pointer}; the actual pointer object varies from Common Lisp
implementation to implementation, needing only to satisfy
@code{pointerp} and be returned from @code{make-pointer} and friends.
One solution that would allow us to define a new Lisp structure to
represent @code{easy-handle}s would be to write a wrapper around every
function that currently takes an @code{easy-handle}; the wrapper would
extract the pointer and pass it to the foreign function. However, we
can use type translators to more elegantly integrate this
``translation'' into the foreign function calling framework, using
@code{translate-to-foreign}.
@smalllisp
(defclass easy-handle ()
((pointer :initform (curl-easy-init)
:documentation "Foreign pointer from curl_easy_init")
(error-buffer
:initform (foreign-alloc :char :count *curl-error-size*
:initial-element 0)
:documentation "C string describing last error")
(c-strings :initform '()
:documentation "C strings set as options"))
(:documentation "I am a parameterization you may pass to
curl-easy-perform to perform a cURL network protocol request."))
(defmethod initialize-instance :after ((self easy-handle) &key)
(set-curl-option-errorbuffer self (slot-value self 'error-buffer)))
(defun add-curl-handle-cstring (handle cstring)
"Add CSTRING to be freed when HANDLE is, answering CSTRING."
(car (push cstring (slot-value handle 'c-strings))))
(defun get-easy-handle-error (handle)
"Answer a string containing HANDLE's current error message."
(foreign-string-to-lisp
(slot-value handle 'error-buffer)))
(defun free-easy-handle (handle)
"Free CURL easy interface HANDLE and any C strings created to
be its options."
(with-slots (pointer error-buffer c-strings) handle
(curl-easy-cleanup pointer)
(foreign-free error-buffer)
(mapc #'foreign-string-free c-strings)))
(define-foreign-type easy-handle-type ()
()
(:actual-type :pointer)
(:simple-parser easy-handle))
(defmethod translate-to-foreign (handle (type easy-handle-type))
"Extract the pointer from an easy-HANDLE."
(slot-value handle 'pointer))
@end smalllisp
While we changed some of the Lisp functions defined earlier to use
@acronym{CLOS} slots rather than hash tables, the foreign functions
work just as well as they did before.
@cindex limitations of type translators
The greatest strength, and the greatest limitation, of the type
translator comes from its generalized interface. As stated
previously, we could define all foreign function calls in terms of the
primitive foreign types provided by @cffi{}. The type translator
interface allows us to cleanly specify the relationship between Lisp
and C data, independent of where it appears in a function call. This
independence comes at a price; for example, it cannot be used to
modify translation semantics based on other arguments to a function
call. In these cases, you should rely on other features of Lisp,
rather than the powerful, yet domain-specific, type translator
interface.
@node Tutorial-Conclusion
@section What's next?
@cffi{} provides a rich and powerful foundation for communicating with
foreign libraries; as we have seen, it is up to you to make that
experience a pleasantly Lispy one. This tutorial does not cover all
the features of @cffi{}; please see the rest of the manual for
details. In particular, if something seems obviously missing, it is
likely that either code or a good reason for lack of code is already
present.
@impnote{There are some other things in @cffi{} that might deserve
tutorial sections, such as free-translated-object, or structs. Let us
know which ones you care about.}
@c ===================================================================
@c CHAPTER: Wrapper generators
@node Wrapper generators
@chapter Wrapper generators
@cffi{}'s interface is designed for human programmers, being aimed at
aesthetic as well as technical sophistication. However, there are a
few programs aimed at translating C and C++ header files, or
approximations thereof, into @cffi{} forms constituting a foreign
interface to the symbols in those files.
These wrapper generators are known to support output of @cffi{} forms.
@table @asis
@item @uref{http://www.cliki.net/Verrazano,Verrazano}
Designed specifically for Common Lisp. Uses @acronym{GCC}'s parser
output in @acronym{XML} format to discover functions, variables, and
other header file data. This means you need @acronym{GCC} to generate
forms; on the other hand, the parser employed is mostly compliant with
@acronym{ANSI} C.
@item @uref{http://www.cliki.net/SWIG,SWIG}
A foreign interface generator originally designed to generate Python
bindings, it has been ported to many other systems, including @cffi{}
in version 1.3.28. Includes its own C declaration munger, not
intended to be fully-compliant with @acronym{ANSI} C.
@end table
First, this manual does not describe use of these other programs; they
have documentation of their own. If you have problems using a
generated interface, please look at the output @cffi{} forms and
verify that they are a correct @cffi{} interface to the library in
question; if they are correct, contact @cffi{} developers with
details, keeping in mind that they communicate in terms of those forms
rather than any particular wrapper generator. Otherwise, contact the
maintainers of the wrapper generator you are using, provided you can
reasonably expect more accuracy from the generator.
When is more accuracy an unreasonable expectation? As described in
the tutorial (@pxref{Tutorial-Abstraction,, Breaking the
abstraction}), the information in C declarations is insufficient to
completely describe every interface. In fact, it is quite common to
run into an interface that cannot be handled automatically, and
generators should be excused from generating a complete interface in
these cases.
As further described in the tutorial, the thinnest Lisp interface to a
C function is not always the most pleasant one. In many cases, you
will want to manually write a Lispier interface to the C functions
that interest you.
Wrapper generators should be treated as time-savers, not complete
automation of the full foreign interface writing job. Reports of the
amount of work done by generators vary from 30% to 90%. The
incremental development style enabled by @cffi{} generally reduces
this proportion below that for languages like Python.
@c Where I got the above 30-90% figures:
@c 30%: lemonodor's post about SWIG
@c 90%: Balooga on #lisp. He said 99%, but that's probably an
@c exaggeration (leave it to me to pass judgement :)
@c -stephen
@c ===================================================================
@c CHAPTER: Foreign Types
@node Foreign Types
@chapter Foreign Types
Foreign types describe how data is translated back and forth between C
and Lisp. @cffi{} provides various built-in types and allows the user to
define new types.
@menu
* Built-In Types::
* Other Types::
* Defining Foreign Types::
* Foreign Type Translators::
* Optimizing Type Translators::
* Foreign Structure Types::
* Allocating Foreign Objects::
Dictionary
* convert-from-foreign::
* convert-to-foreign::
* defbitfield::
* defcstruct::
* defcunion::
* defctype::
* defcenum::
@c * define-type-spec-parser::
* define-foreign-type::
* define-parse-method::
@c * explain-foreign-slot-value:
* foreign-bitfield-symbols::
* foreign-bitfield-value::
* foreign-enum-keyword::
* foreign-enum-value::
* foreign-slot-names::
* foreign-slot-offset::
* foreign-slot-pointer::
* foreign-slot-value::
* foreign-type-alignment::
* foreign-type-size::
* free-converted-object::
* free-translated-object::
* translate-from-foreign::
* translate-to-foreign::
* with-foreign-slots::
@end menu
@node Built-In Types
@section Built-In Types
@ForeignType{:char}
@ForeignType{:unsigned-char}
@ForeignType{:short}
@ForeignType{:unsigned-short}
@ForeignType{:int}
@ForeignType{:unsigned-int}
@ForeignType{:long}
@ForeignType{:unsigned-long}
@ForeignType{:long-long}
@ForeignType{:unsigned-long-long}
These types correspond to the native C integer types according to the
@acronym{ABI} of the Lisp implementation's host system.
@code{:long-long} and @code{:unsigned-long-long} are not supported
natively on all implementations. However, they are emulated by
@code{mem-ref} and @code{mem-set}.
When those types are @strong{not} available, the symbol
@code{cffi-sys::no-long-long} is pushed into @code{*features*}.
@ForeignType{:uchar}
@ForeignType{:ushort}
@ForeignType{:uint}
@ForeignType{:ulong}
@ForeignType{:llong}
@ForeignType{:ullong}
For convenience, the above types are provided as shortcuts for
@code{unsigned-char}, @code{unsigned-short}, @code{unsigned-int},
@code{unsigned-long}, @code{long-long} and @code{unsigned-long-long},
respectively.
@ForeignType{:int8}
@ForeignType{:uint8}
@ForeignType{:int16}
@ForeignType{:uint16}
@ForeignType{:int32}
@ForeignType{:uint32}
@ForeignType{:int64}
@ForeignType{:uint64}
Foreign integer types of specific sizes, corresponding to the C types
defined in @code{stdint.h}.
@c @ForeignType{:size}
@c @ForeignType{:ssize}
@c @ForeignType{:ptrdiff}
@c @ForeignType{:time}
@c Foreign integer types corresponding to the standard C types (without
@c the @code{_t} suffix).
@c @impnote{These are not implemented yet. --luis}
@c @impnote{I'm sure there are more of these that could be useful, let's
@c add any types that can't be defined portably to this list as
@c necessary. --james}
@ForeignType{:float}
@ForeignType{:double}
On all systems, the @code{:float} and @code{:double} types represent a
C @code{float} and @code{double}, respectively. On most but not all
systems, @code{:float} and @code{:double} represent a Lisp
@code{single-float} and @code{double-float}, respectively. It is not
so useful to consider the relationship between Lisp types and C types
as isomorphic, as simply to recognize the relationship, and relative
precision, among each respective category.
@ForeignType{:long-double}
This type is only supported on SCL.
@ForeignType{:pointer &optional type}
A foreign pointer to an object of any type, corresponding to
@code{void *}. You can optionally specify type of pointer
(e.g. @code{(:pointer :char)}). Although @cffi{} won't do anything
with that information yet, it is useful for documentation purposes.
@ForeignType{:void}
No type at all. Only valid as the return type of a function.
@node Other Types
@section Other Types
@cffi{} also provides a few useful types that aren't built-in C
types.
@ForeignType{:string}
The @code{:string} type performs automatic conversion between Lisp and
C strings. Note that, in the case of functions the converted C string
will have dynamic extent (i.e.@: it will be automatically freed after
the foreign function returns).
In addition to Lisp strings, this type will also convert
Lisp arrays of element type @code{(unsigned-byte 8)} and will pass
foreign pointers unmodified.
A method for @ref{free-translated-object} is specialized for this
type. So, for example, foreign strings allocated by this type and
passed to a foreign function will be freed after the function
returns.
@lisp
CFFI> (foreign-funcall "getenv" :string "SHELL" :string)
@result{} "/bin/bash"
CFFI> (with-foreign-string (str "abcdef")
(foreign-funcall "strlen" :string str :int))
@result{} 6
CFFI> (let ((str (make-array 4 :element-type '(unsigned-byte 8)
:initial-element 65)))
(foreign-funcall "strlen" :string str :int))
@result{} 4
@end lisp
@ForeignType{:string+ptr}
Like @code{:string} but returns a list with two values when convert
from C to Lisp: a Lisp string and the C string's foreign pointer.
@lisp
CFFI> (foreign-funcall "getenv" :string "SHELL" :string+ptr)
@result{} ("/bin/bash" #.(SB-SYS:INT-SAP #XBFFFFC6F))
@end lisp
@ForeignType{:boolean &optional (base-type :int)}
The @code{:boolean} type converts between a Lisp boolean and a C
boolean. It canonicalizes to @var{base-type} which is @code{:int} by
default.
@lisp
(convert-to-foreign nil :boolean) @result{} 0
(convert-to-foreign t :boolean) @result{} 1
(convert-from-foreign 0 :boolean) @result{} nil
(convert-from-foreign 1 :boolean) @result{} t
@end lisp
@ForeignType{:wrapper base-type &key to-c from-c}
The @code{:wrapper} type stores two symbols passed to the @var{to-c}
and @var{from-c} arguments. When a value is being translated to or
from C, this type @code{funcall}s the respective symbol.
@code{:wrapper} types will be typedefs for @var{base-type} and will
inherit its translators, if any.
Here's an example of how the @code{:boolean} type could be defined in
terms of @code{:wrapper}.
@lisp
(defun bool-c-to-lisp (value)
(not (zerop value)))
(defun bool-lisp-to-c (value)
(if value 1 0))
(defctype my-bool (:wrapper :int :from-c bool-c-to-lisp
:to-c bool-lisp-to-c))
(convert-to-foreign nil 'my-bool) @result{} 0
(convert-from-foreign 1 'my-bool) @result{} t
@end lisp
@node Defining Foreign Types
@section Defining Foreign Types
You can define simple C-like @code{typedef}s through the
@code{defctype} macro. Defining a typedef is as simple as giving
@code{defctype} a new name and the name of the type to be wrapped.
@lisp
;;; @lispcmt{Define MY-INT as an alias for the built-in type :INT.}
(defctype my-int :int)
@end lisp
With this type definition, one can, for instance, declare arguments to
foreign functions as having the type @code{my-int}, and they will be
passed as integers.
@subheading More complex types
@cffi{} offers another way to define types through
@code{define-foreign-type}, a thin wrapper macro around
@code{defclass}. As an example, let's go through the steps needed to
define a @code{(my-string &key encoding)} type. First, we need to
define our type class:
@lisp
(define-foreign-type my-string-type ()
((encoding :reader string-type-encoding :initarg :encoding))
(:actual-type :pointer))
@end lisp
The @code{:actual-type} class option tells CFFI that this type will
ultimately be passed to and received from foreign code as a
@code{:pointer}. Now you need to tell CFFI how to parse a type
specification such as @code{(my-string :encoding :utf8)} into an
instance of @code{my-string-type}. We do that with
@code{define-parse-method}:
@lisp
(define-parse-method my-string (&key (encoding :utf-8))
(make-instance 'my-string-type :encoding encoding))
@end lisp
The next section describes how make this type actually translate
between C and Lisp strings.
@node Foreign Type Translators
@section Foreign Type Translators
Type translators are used to automatically convert Lisp values to or
from foreign values. For example, using type translators, one can
take the @code{my-string} type defined in the previous section and
specify that it should:
@itemize
@item
convert C strings to Lisp strings;
@item
convert Lisp strings to newly allocated C strings;
@item
free said C strings when they are no longer needed.
@end itemize
In order to tell @cffi{} how to automatically convert Lisp values to
foreign values, define a specialized method for the
@code{translate-to-foreign} generic function:
@lisp
;;; @lispcmt{Define a method that converts Lisp strings to C strings.}
(defmethod translate-to-foreign (string (type my-string-type))
(foreign-string-alloc string :encoding (string-type-encoding type)))
@end lisp
@noindent
From now on, whenever an object is passed as a @code{my-string} to a
foreign function, this method will be invoked to convert the Lisp
value. To perform the inverse operation, which is needed for functions
that return a @code{my-string}, specialize the
@code{translate-from-foreign} generic function in the same manner:
@lisp
;;; @lispcmt{Define a method that converts C strings to Lisp strings.}
(defmethod translate-from-foreign (pointer (type my-string-type))
(foreign-string-to-lisp pointer :encoding (string-type-encoding type)))
@end lisp
@noindent
When a @code{translate-to-foreign} method requires allocation of
foreign memory, you must also define a @code{free-translated-object}
method to free the memory once the foreign object is no longer needed,
otherwise you'll be faced with memory leaks. This generic function is
called automatically by @cffi{} when passing objects to foreign
functions. Let's do that:
@lisp
;;; @lispcmt{Free strings allocated by translate-to-foreign.}
(defmethod free-translated-object (pointer (type my-string-type) param)
(declare (ignore param))
(foreign-string-free pointer))
@end lisp
@noindent
In this specific example, we don't need the @var{param} argument, so
we ignore it. See @ref{free-translated-object}, for an explanation of
its purpose and how you can use it.
A type translator does not necessarily need to convert the value. For
example, one could define a typedef for @code{:pointer} that ensures,
in the @code{translate-to-foreign} method, that the value is not a
null pointer, signalling an error if a null pointer is passed. This
would prevent some pointer errors when calling foreign functions that
cannot handle null pointers.
@strong{Please note:} these methods are meant as extensible hooks
only, and you should not call them directly. Use
@code{convert-to-foreign}, @code{convert-from-foreign} and
@code{free-converted-object} instead.
@xref{Tutorial-Types,, Defining new types}, for another example of
type translators.
@node Optimizing Type Translators
@section Optimizing Type Translators
@cindex type translators, optimizing
@cindex compiler macros for type translation
@cindex defining type-translation compiler macros
Being based on generic functions, the type translation mechanism
described above can add a bit of overhead. This is usually not
significant, but we nevertheless provide a way of getting rid of the
overhead for the cases where it matters.
A good way to understand this issue is to look at the code generated
by @code{defcfun}. Consider the following example using the previously
defined @code{my-string} type:
@lisp
CFFI> (macroexpand-1 '(defcfun foo my-string (x my-string)))
;; (simplified, downcased, etc...)
(defun foo (x)
(multiple-value-bind (#:G2019 #:PARAM3149)
(translate-to-foreign x #<MY-STRING-TYPE @{11ED5A79@}>)
(unwind-protect
(translate-from-foreign
(foreign-funcall "foo" :pointer #:G2019 :pointer)
#<MY-STRING-TYPE @{11ED5659@}>)
(free-translated-object #:G2019 #<MY-STRING-TYPE @{11ED51A79@}>
#:PARAM3149))))
@end lisp
@noindent
In order to get rid of those generic function calls, @cffi{} has
another set of extensible generic functions that provide functionality
similar to @acronym{CL}'s compiler macros:
@code{expand-to-foreign-dyn}, @code{expand-to-foreign} and
@code{expand-from-foreign}. Here's how one could define a
@code{my-boolean} with them:
@lisp
(define-foreign-type my-boolean-type ()
()
(:actual-type :int)
(:simple-parser my-boolean))
(defmethod expand-to-foreign (value (type my-boolean-type))
`(if ,value 1 0))
(defmethod expand-from-foreign (value (type my-boolean-type))
`(not (zerop ,value)))
@end lisp
@noindent
And here's what the macroexpansion of a function using this type would
look like:
@lisp
CFFI> (macroexpand-1 '(defcfun bar my-boolean (x my-boolean)))
;; (simplified, downcased, etc...)
(defun bar (x)
(let ((#:g3182 (if x 1 0)))
(not (zerop (foreign-funcall "bar" :int #:g3182 :int)))))
@end lisp
@noindent
No generic function overhead.
Let's go back to our @code{my-string} type. The expansion interface
has no equivalent of @code{free-translated-object}; you must instead
define a method on @code{expand-to-foreign-dyn}, the third generic
function in this interface. This is especially useful when you can
allocate something much more efficiently if you know the object has
dynamic extent, as is the case with function calls that don't save the
relevant allocated arguments.
This exactly what we need for the @code{my-string} type:
@lisp
(defmethod expand-from-foreign (form (type my-string-type))
`(foreign-string-to-lisp ,form))
(defmethod expand-to-foreign-dyn (value var body (type my-string-type))
(let ((encoding (string-type-encoding type)))
`(with-foreign-string (,var ,value :encoding ',encoding)
,@@body)))
@end lisp
@noindent
So let's look at the macro expansion:
@lisp
CFFI> (macroexpand-1 '(defcfun foo my-string (x my-string)))
;; (simplified, downcased, etc...)
(defun foo (x)
(with-foreign-string (#:G2021 X :encoding ':utf-8)
(foreign-string-to-lisp
(foreign-funcall "foo" :pointer #:g2021 :pointer))))
@end lisp
@noindent
Again, no generic function overhead.
@subheading Other details
To short-circuit expansion and use the @code{translate-*} functions
instead, simply call the next method. Return its result in cases
where your method cannot generate an appropriate replacement for it.
This analogous to the @code{&whole form} mechanism compiler macros
provide.
The @code{expand-*} methods have precedence over their
@code{translate-*} counterparts and are guaranteed to be used in
@code{defcfun}, @code{foreign-funcall}, @code{defcvar} and
@code{defcallback}. If you define a method on each of the
@code{expand-*} generic functions, you are guaranteed to have full
control over the expressions generated for type translation in these
macros.
They may or may not be used in other @cffi{} operators that need to
translate between Lisp and C data; you may only assume that
@code{expand-*} methods will probably only be called during Lisp
compilation.
@code{expand-to-foreign-dyn} has precedence over
@code{expand-to-foreign} and is only used in @code{defcfun} and
@code{foreign-funcall}, only making sense in those contexts.
@strong{Important note:} this set of generic functions is called at
macroexpansion time. Methods are defined when loaded or evaluated,
not compiled. You are responsible for ensuring that your
@code{expand-*} methods are defined when the @code{foreign-funcall} or
other forms that use them are compiled. One way to do this is to put
the method definitions earlier in the file and inside an appropriate
@code{eval-when} form; another way is to always load a separate Lisp
or @acronym{FASL} file containing your @code{expand-*} definitions
before compiling files with forms that ought to use them. Otherwise,
they will not be found and the runtime translators will be used
instead.
@node Foreign Structure Types
@section Foreign Structure Types
For more involved C types than simple aliases to built-in types, such
as you can make with @code{defctype}, @cffi{} allows declaration of
structures and unions with @code{defcstruct} and @code{defcunion}.
For example, consider this fictional C structure declaration holding
some personal information:
@example
struct person @{
int number;
char* reason;
@};
@end example
@noindent
The equivalent @code{defcstruct} form follows:
@lisp
(defcstruct person
(number :int)
(reason :string))
@end lisp
Please note that this interface is only for those that must know about
the values contained in a relevant struct. If the library you are
interfacing returns an opaque pointer that needs only be passed to
other C library functions, by all means just use @code{:pointer} or a
type-safe definition munged together with @code{defctype} and type
translation.
@ref{defcstruct} for more details.
@node Allocating Foreign Objects
@section Allocating Foreign Objects
@c I moved this because I moved with-foreign-object to the Pointers
@c chapter, where foreign-alloc is.
@xref{Allocating Foreign Memory}.
@c ===================================================================
@c CONVERT-FROM-FOREIGN
@node convert-from-foreign
@unnumberedsec convert-from-foreign
@subheading Syntax
@Function{convert-from-foreign foreign-value type @res{} value}
@subheading Arguments and Values
@table @var
@item foreign-value
The primitive C value as returned from a primitive foreign function or
from @code{convert-to-foreign}.
@item type
A @cffi{} type specifier.
@item value
The Lisp value translated from @var{foreign-value}.
@end table
@subheading Description
This is an external interface to the type translation facility. In
the implementation, all foreign functions are ultimately defined as
type translation wrappers around primitive foreign function
invocations.
This function is available mostly for inspection of the type
translation process, and possibly optimization of special cases of
your foreign function calls.
Its behavior is better described under @code{translate-from-foreign}'s
documentation.
@subheading Examples
@lisp
CFFI-USER> (convert-to-foreign "a boat" :string)
@result{} #<FOREIGN-ADDRESS #x097ACDC0>
@result{} (T)
CFFI-USER> (convert-from-foreign * :string)
@result{} "a boat"
@end lisp
@subheading See Also
@seealso{convert-to-foreign} @*
@seealso{free-converted-object} @*
@seealso{translate-from-foreign}
@c ===================================================================
@c CONVERT-TO-FOREIGN
@node convert-to-foreign
@unnumberedsec convert-to-foreign
@subheading Syntax
@Function{convert-to-foreign value type @res{} foreign-value, alloc-params}
@subheading Arguments and Values
@table @var
@item value
The Lisp object to be translated to a foreign object.
@item type
A @cffi{} type specifier.
@item foreign-value
The primitive C value, ready to be passed to a primitive foreign
function.
@item alloc-params
Something of a translation state; you must pass it to
@code{free-converted-object} along with the foreign value for that to
work.
@end table
@subheading Description
This is an external interface to the type translation facility. In
the implementation, all foreign functions are ultimately defined as
type translation wrappers around primitive foreign function
invocations.
This function is available mostly for inspection of the type
translation process, and possibly optimization of special cases of
your foreign function calls.
Its behavior is better described under @code{translate-to-foreign}'s
documentation.
@subheading Examples
@lisp
CFFI-USER> (convert-to-foreign t :boolean)
@result{} 1
@result{} (NIL)
CFFI-USER> (convert-to-foreign "hello, world" :string)
@result{} #<FOREIGN-ADDRESS #x097C5F80>
@result{} (T)
CFFI-USER> (code-char (mem-aref * :char 5))
@result{} #\,
@end lisp
@subheading See Also
@seealso{convert-from-foreign} @*
@seealso{free-converted-object} @*
@seealso{translate-to-foreign}
@c ===================================================================
@c DEFBITFIELD
@node defbitfield
@unnumberedsec defbitfield
@subheading Syntax
@Macro{defbitfield name-and-options &body masks}
masks ::= [docstring] @{ (symbol value) @}* @*
name-and-options ::= name | (name &optional (base-type :int))
@subheading Arguments and Values
@table @var
@item name
The name of the new bitfield type.
@item docstring
A documentation string, ignored.
@item base-type
A symbol denoting a foreign type.
@item symbol
A Lisp symbol.
@item value
An integer representing a bitmask.
@end table
@subheading Description
The @code{defbitfield} macro is used to define foreign types that map
lists of symbols to integer values.
If @var{value} is omitted, it will be computed as follows: find the
greatest @var{value} previously used, including those so computed,
with only a single 1-bit in its binary representation (that is, powers
of two), and left-shift it by one. This rule guarantees that a
computed @var{value} cannot clash with previous values, but may clash
with future explicitly specified values.
Symbol lists will be automatically converted to values and vice versa
when being passed as arguments to or returned from foreign functions,
respectively. The same applies to any other situations where an object
of a bitfield type is expected.
Types defined with @code{defbitfield} canonicalize to @var{base-type}
which is @code{:int} by default.
@subheading Examples
@lisp
(defbitfield open-flags
(:rdonly #x0000)
:wronly ;@lispcmt{#x0001}
:rdwr ;@lispcmt{@dots{}}
:nonblock
:append
(:creat #x0200))
;; @lispcmt{etc@dots{}}
CFFI> (foreign-bitfield-symbols 'open-flags #b1101)
@result{} (:RDONLY :WRONLY :NONBLOCK :APPEND)
CFFI> (foreign-bitfield-value 'open-flags '(:rdwr :creat))
@result{} 514 ; #x0202
(defcfun ("open" unix-open) :int
(path :string)
(flags open-flags)
(mode :uint16)) ; unportable
CFFI> (unix-open "/tmp/foo" '(:wronly :creat) #o644)
@result{} #<an fd>
;;; @lispcmt{Consider also the following lispier wrapper around open()}
(defun lispier-open (path mode &rest flags)
(unix-open path flags mode))
@end lisp
@subheading See Also
@seealso{foreign-bitfield-value} @*
@seealso{foreign-bitfield-symbols}
@c ===================================================================
@c DEFCSTRUCT
@node defcstruct
@unnumberedsec defcstruct
@subheading Syntax
@Macro{defcstruct name-and-options &body doc-and-slots @res{} name}
name-and-options ::= structure-name | (structure-name &key size)
doc-and-slots ::= [docstring] @{ (slot-name slot-type &key count offset) @}*
@subheading Arguments and Values
@table @var
@item structure-name
The name of new structure type.
@item docstring
A documentation string, ignored.
@item slot-name
A symbol naming the slot. It must be unique among slot names in this
structure.
@item size
Use this option to override the size (in bytes) of the struct.
@item slot-type
The type specifier for the slot.
@item count
Used to declare an array of size @var{count} inside the
structure. Defaults to @code{1} as such an array and a single element
are semantically equivalent.
@item offset
Overrides the slot's offset. The next slot's offset is calculated
based on this one.
@end table
@subheading Description
This defines a new @cffi{} aggregate type akin to C @code{struct}s.
In other words, it specifies that foreign objects of the type
@var{structure-name} are groups of different pieces of data, or
``slots'', of the @var{slot-type}s, distinguished from each other by
the @var{slot-name}s. Each structure is located in memory at a
position, and the slots are allocated sequentially beginning at that
point in memory (with some padding allowances as defined by the C
@acronym{ABI}, unless otherwise requested by specifying an
@var{offset} from the beginning of the structure (offset 0).
In other words, it is isomorphic to the C @code{struct}, giving
several extra features.
There are two kinds of slots, for the two kinds of @cffi{} types:
@table @dfn
@item Simple
Contain a single instance of a type that canonicalizes to a built-in
type, such as @code{:long} or @code{:pointer}. Used for simple
@cffi{} types.
@item Aggregate
Contain an embedded structure or union, or an array of objects. Used
for aggregate @cffi{} types.
@end table
The use of @acronym{CLOS} terminology for the structure-related
features is intentional; structure definitions are very much like
classes with (far) fewer features.
@subheading Examples
@lisp
(defcstruct point
"Pointer structure."
(x :int)
(y :int))
CFFI> (with-foreign-object (ptr 'point)
;; @lispcmt{Initialize the slots}
(setf (foreign-slot-value ptr 'point 'x) 42
(foreign-slot-value ptr 'point 'y) 42)
;; @lispcmt{Return a list with the coordinates}
(with-foreign-slots ((x y) ptr point)
(list x y)))
@result{} (42 42)
@end lisp
@lisp
;; @lispcmt{Using the :size and :offset options to define a partial structure.}
;; @lispcmt{(this is useful when you are interested in only a few slots}
;; @lispcmt{of a big foreign structure)}
(defcstruct (foo :size 32)
"Some struct with 32 bytes."
; @lispcmt{<16 bytes we don't care about>}
(x :int :offset 16) ; @lispcmt{an int at offset 16}
(y :int) ; @lispcmt{another int at offset 16+sizeof(int)}
; @lispcmt{<a couple more bytes we don't care about>}
(z :char :offset 24)) ; @lispcmt{a char at offset 24}
; @lispcmt{<7 more bytes ignored (since size is 32)>}
CFFI> (foreign-type-size 'foo)
@result{} 32
@end lisp
@lisp
;;; @lispcmt{Using :count to define arrays inside of a struct.}
(defcstruct video_tuner
(name :char :count 32))
@end lisp
@subheading See Also
@seealso{foreign-slot-pointer} @*
@seealso{foreign-slot-value} @*
@seealso{with-foreign-slots}
@c ===================================================================
@c DEFCUNION
@node defcunion
@unnumberedsec defcunion
@subheading Syntax
@Macro{defcunion name &body doc-and-slots @res{} name}
doc-and-slots ::= [docstring] @{ (slot-name slot-type &key count) @}*
@subheading Arguments and Values
@table @var
@item name
The name of new union type.
@item docstring
A documentation string, ignored.
@item slot-name
A symbol naming the slot.
@item slot-type
The type specifier for the slot.
@item count
Used to declare an array of size @var{count} inside the
structure.
@end table
@subheading Description
A union is a structure in which all slots have an offset of zero. It
is isomorphic to the C @code{union}. Therefore, you should use the
usual foreign structure operations for accessing a union's slots.
@subheading Examples
@lisp
(defcunion uint32-bytes
(int-value :unsigned-int)
(bytes :unsigned-char :count 4))
@end lisp
@subheading See Also
@seealso{foreign-slot-pointer} @*
@seealso{foreign-slot-value}
@c ===================================================================
@c DEFCTYPE
@node defctype
@unnumberedsec defctype
@subheading Syntax
@Macro{defctype name base-type &optional documentation}
@subheading Arguments and Values
@table @var
@item name
The name of the new foreign type.
@item base-type
A symbol or a list defining the new type.
@item documentation
A documentation string, currently ignored.
@end table
@subheading Description
The @code{defctype} macro provides a mechanism similar to C's
@code{typedef} to define new types. The new type inherits
@var{base-type}'s translators, if any. There is no way to define
translations for types for types defined with @code{defctype}. For
that, you should use @ref{define-foreign-type}.
@subheading Examples
@lisp
(defctype my-string :string
"My own string type.")
(defctype long-bools (:boolean :long)
"Booleans that map to C longs.")
@end lisp
@subheading See Also
@seealso{define-foreign-type}
@c ===================================================================
@c DEFCENUM
@node defcenum
@unnumberedsec defcenum
@subheading Syntax
@Macro{defcenum name-and-options &body enum-list}
enum-list ::= [docstring] @{ keyword | (keyword value) @}*
name-and-options ::= name | (name &optional (base-type :int))
@subheading Arguments and Values
@table @var
@item name
The name of the new enum type.
@item docstring
A documentation string, ignored.
@item base-type
A symbol denoting a foreign type.
@item keyword
A keyword symbol.
@item value
An index value for a keyword.
@end table
@subheading Description
The @code{defcenum} macro is used to define foreign types that map
keyword symbols to integer values, similar to the C @code{enum} type.
If @var{value} is omitted its value will either be 0, if it's the
first entry, or it it will continue the progression from the last
specified value.
Keywords will be automatically converted to values and vice-versa when
being passed as arguments to or returned from foreign functions,
respectively. The same applies to any other situations where an object
of an @code{enum} type is expected.
Types defined with @code{defcenum} canonicalize to @var{base-type}
which is @code{:int} by default.
@subheading Examples
@lisp
(defcenum boolean
:no
:yes)
CFFI> (foreign-enum-value 'boolean :no)
@result{} 0
@end lisp
@lisp
(defcenum numbers
(:one 1)
:two
(:four 4))
CFFI> (foreign-enum-keyword 'numbers 2)
@result{} :TWO
@end lisp
@subheading See Also
@seealso{foreign-enum-value} @*
@seealso{foreign-enum-keyword}
@c ===================================================================
@c DEFINE-FOREIGN-TYPE
@node define-foreign-type
@unnumberedsec define-foreign-type
@subheading Syntax
@Macro{define-foreign-type class-name supers slots &rest options @res{} class-name}
options ::= (@code{:actual-type} @var{type}) | @
(@code{:simple-parser} @var{symbol}) | @
@emph{regular defclass option}
@subheading Arguments and Values
@table @var
@item class-name
A symbol naming the new foreign type class.
@item supers
A list of symbols naming the super classes.
@item slots
A list of slot definitions, passed to @code{defclass}.
@end table
@subheading Description
@c TODO rewrite
The macro @code{define-foreign-type} defines a new class
@var{class-name}. It is a thin wrapper around @code{defclass}. Among
other things, it ensures that @var{class-name} becomes a subclass of
@var{foreign-type}, what you need to know about that is that there's
an initarg @code{:actual-type} which serves the same purpose as
@code{defctype}'s @var{base-type} argument.
@c TODO mention the type translators here
@c FIX FIX
@subheading Examples
Taken from @cffi{}'s @code{:boolean} type definition:
@lisp
(define-foreign-type :boolean (&optional (base-type :int))
"Boolean type. Maps to an :int by default. Only accepts integer types."
(ecase base-type
((:char
:unsigned-char
:int
:unsigned-int
:long
:unsigned-long) base-type)))
CFFI> (canonicalize-foreign-type :boolean)
@result{} :INT
CFFI> (canonicalize-foreign-type '(:boolean :long))
@result{} :LONG
CFFI> (canonicalize-foreign-type '(:boolean :float))
;; @lispcmt{@error{} signalled by ECASE.}
@end lisp
@subheading See Also
@seealso{defctype} @*
@seealso{define-parse-method}
@c ===================================================================
@c DEFINE-PARSE-METHOD
@node define-parse-method
@unnumberedsec define-parse-method
@subheading Syntax
@Macro{define-parse-method name lambda-list &body body @res{} name}
@subheading Arguments and Values
@table @var
@item type-name
A symbol naming the new foreign type.
@item lambda-list
A lambda list which is the argument list of the new foreign type.
@item body
One or more forms that provide a definition of the new foreign type.
@end table
@subheading Description
@c TODO: update example. The boolean type is probably a good choice.
@subheading Examples
Taken from @cffi{}'s @code{:boolean} type definition:
@lisp
(define-foreign-type :boolean (&optional (base-type :int))
"Boolean type. Maps to an :int by default. Only accepts integer types."
(ecase base-type
((:char
:unsigned-char
:int
:unsigned-int
:long
:unsigned-long) base-type)))
CFFI> (canonicalize-foreign-type :boolean)
@result{} :INT
CFFI> (canonicalize-foreign-type '(:boolean :long))
@result{} :LONG
CFFI> (canonicalize-foreign-type '(:boolean :float))
;; @lispcmt{@error{} signalled by ECASE.}
@end lisp
@subheading See Also
@seealso{define-foreign-type}
@c ===================================================================
@c EXPLAIN-FOREIGN-SLOT-VALUE
@c @node explain-foreign-slot-value
@c @unnumberedsec explain-foreign-slot-value
@c @subheading Syntax
@c @Macro{explain-foreign-slot-value ptr type &rest slot-names}
@c @subheading Arguments and Values
@c @table @var
@c @item ptr
@c ...
@c @item type
@c ...
@c @item slot-names
@c ...
@c @end table
@c @subheading Description
@c This macro translates the slot access that would occur by calling
@c @code{foreign-slot-value} with the same arguments into an equivalent
@c expression in C and prints it to @code{*standard-output*}.
@c @emph{Note: this is not implemented yet.}
@c @subheading Examples
@c @lisp
@c CFFI> (explain-foreign-slot-value ptr 'timeval 'tv-secs)
@c @result{} ptr->tv_secs
@c CFFI> (explain-foreign-slot-value emp 'employee 'hire-date 'tv-usecs)
@c @result{} emp->hire_date.tv_usecs
@c @end lisp
@c @subheading See Also
@c ===================================================================
@c FOREIGN-BITFIELD-SYMBOLS
@node foreign-bitfield-symbols
@unnumberedsec foreign-bitfield-symbols
@subheading Syntax
@Function{foreign-bitfield-symbols type value @res{} symbols}
@subheading Arguments and Values
@table @var
@item type
A bitfield type.
@item value
An integer.
@item symbols
A potentially shared list of symbols.
@code{nil}.
@end table
@subheading Description
The function @code{foreign-bitfield-symbols} returns a possibly shared
list of symbols that correspond to @var{value} in @var{type}.
@subheading Examples
@lisp
(defbitfield flags
(flag-a 1)
(flag-b 2)
(flag-c 4))
CFFI> (foreign-bitfield-symbols 'boolean #b101)
@result{} (FLAG-A FLAG-C)
@end lisp
@subheading See Also
@seealso{defbitfield} @*
@seealso{foreign-bitfield-value}
@c ===================================================================
@c FOREIGN-BITFIELD-VALUE
@node foreign-bitfield-value
@unnumberedsec foreign-bitfield-value
@subheading Syntax
@Function{foreign-bitfield-value type symbols @res{} value}
@subheading Arguments and Values
@table @var
@item type
A @code{bitfield} type.
@item symbol
A Lisp symbol.
@item value
An integer.
@end table
@subheading Description
The function @code{foreign-bitfield-value} returns the @var{value} that
corresponds to the symbols in the @var{symbols} list.
@subheading Examples
@lisp
(defbitfield flags
(flag-a 1)
(flag-b 2)
(flag-c 4))
CFFI> (foreign-bitfield-value 'flags '(flag-a flag-c))
@result{} 5 ; #b101
@end lisp
@subheading See Also
@seealso{defbitfield} @*
@seealso{foreign-bitfield-symbols}
@c ===================================================================
@c FOREIGN-ENUM-KEYWORD
@node foreign-enum-keyword
@unnumberedsec foreign-enum-keyword
@subheading Syntax
@Function{foreign-enum-keyword type value &key errorp @res{} keyword}
@subheading Arguments and Values
@table @var
@item type
An @code{enum} type.
@item value
An integer.
@item errorp
If true (the default), signal an error if @var{value} is not defined
in @var{type}. If false, @code{foreign-enum-keyword} returns
@code{nil}.
@item keyword
A keyword symbol.
@end table
@subheading Description
The function @code{foreign-enum-keyword} returns the keyword symbol
that corresponds to @var{value} in @var{type}.
An error is signaled if @var{type} doesn't contain such @var{value}
and @var{errorp} is true.
@subheading Examples
@lisp
(defcenum boolean
:no
:yes)
CFFI> (foreign-enum-keyword 'boolean 1)
@result{} :YES
@end lisp
@subheading See Also
@seealso{defcenum} @*
@seealso{foreign-enum-value}
@c ===================================================================
@c FOREIGN-ENUM-VALUE
@node foreign-enum-value
@unnumberedsec foreign-enum-value
@subheading Syntax
@Function{foreign-enum-value type keyword &key errorp @res{} value}
@subheading Arguments and Values
@table @var
@item type
An @code{enum} type.
@item keyword
A keyword symbol.
@item errorp
If true (the default), signal an error if @var{keyword} is not
defined in @var{type}. If false, @code{foreign-enum-value} returns
@code{nil}.
@item value
An integer.
@end table
@subheading Description
The function @code{foreign-enum-value} returns the @var{value} that
corresponds to @var{keyword} in @var{type}.
An error is signaled if @var{type} doesn't contain such
@var{keyword}, and @var{errorp} is true.
@subheading Examples
@lisp
(defcenum boolean
:no
:yes)
CFFI> (foreign-enum-value 'boolean :yes)
@result{} 1
@end lisp
@subheading See Also
@seealso{defcenum} @*
@seealso{foreign-enum-keyword}
@c ===================================================================
@c FOREIGN-SLOT-NAMES
@node foreign-slot-names
@unnumberedsec foreign-slot-names
@subheading Syntax
@Function{foreign-slot-names type @res{} names}
@subheading Arguments and Values
@table @var
@item type
A foreign struct type.
@item names
A list.
@end table
@subheading Description
The function @code{foreign-slot-names} returns a potentially shared
list of slot @var{names} for the given structure @var{type}. This list
has no particular order.
@subheading Examples
@lisp
(defcstruct timeval
(tv-secs :long)
(tv-usecs :long))
CFFI> (foreign-slot-names 'timeval)
@result{} (TV-SECS TV-USECS)
@end lisp
@subheading See Also
@seealso{defcstruct} @*
@seealso{foreign-slot-offset} @*
@seealso{foreign-slot-value} @*
@seealso{foreign-slot-pointer}
@c ===================================================================
@c FOREIGN-SLOT-OFFSET
@node foreign-slot-offset
@unnumberedsec foreign-slot-offset
@subheading Syntax
@Function{foreign-slot-offset type slot-name @res{} offset}
@subheading Arguments and Values
@table @var
@item type
A foreign struct type.
@item slot-name
A symbol.
@item offset
An integer.
@end table
@subheading Description
The function @code{foreign-slot-offset} returns the @var{offset} in
bytes of a slot in a foreign struct type.
@subheading Examples
@lisp
(defcstruct timeval
(tv-secs :long)
(tv-usecs :long))
CFFI> (foreign-slot-offset 'timeval 'tv-secs)
@result{} 0
CFFI> (foreign-slot-offset 'timeval 'tv-usecs)
@result{} 4
@end lisp
@subheading See Also
@seealso{defcstruct} @*
@seealso{foreign-slot-names} @*
@seealso{foreign-slot-pointer} @*
@seealso{foreign-slot-value}
@c ===================================================================
@c FOREIGN-SLOT-POINTER
@node foreign-slot-pointer
@unnumberedsec foreign-slot-pointer
@subheading Syntax
@Function{foreign-slot-pointer ptr type slot-name @res{} pointer}
@subheading Arguments and Values
@table @var
@item ptr
A pointer to a structure.
@item type
A foreign structure type.
@item slot-names
A slot name in the @var{type}.
@item pointer
A pointer to the slot @var{slot-name}.
@end table
@subheading Description
Returns a pointer to the location of the slot @var{slot-name} in a
foreign object of type @var{type} at @var{ptr}. The returned pointer
points inside the structure. Both the pointer and the memory it points
to have the same extent as @var{ptr}.
For aggregate slots, this is the same value returned by
@code{foreign-slot-value}.
@subheading Examples
@lisp
(defcstruct point
"Pointer structure."
(x :int)
(y :int))
CFFI> (with-foreign-object (ptr 'point)
(foreign-slot-pointer ptr 'point 'x))
@result{} #<FOREIGN-ADDRESS #xBFFF6E60>
;; @lispcmt{Note: the exact pointer representation varies from lisp to lisp.}
@end lisp
@subheading See Also
@seealso{defcstruct} @*
@seealso{foreign-slot-value} @*
@seealso{foreign-slot-names} @*
@seealso{foreign-slot-offset}
@c ===================================================================
@c FOREIGN-SLOT-VALUE
@node foreign-slot-value
@unnumberedsec foreign-slot-value
@subheading Syntax
@Accessor{foreign-slot-value ptr type slot-name @res{} object}
@subheading Arguments and Values
@table @var
@item ptr
A pointer to a structure.
@item type
A foreign structure type.
@item slot-name
A symbol naming a slot in the structure type.
@item object
The object contained in the slot specified by @var{slot-name}.
@end table
@subheading Description
For simple slots, @code{foreign-slot-value} returns the value of the
object, such as a Lisp integer or pointer. In C, this would be
expressed as @code{ptr->slot}.
For aggregate slots, a pointer inside the structure to the beginning
of the slot's data is returned. In C, this would be expressed as
@code{&ptr->slot}. This pointer and the memory it points to have the
same extent as @var{ptr}.
There are compiler macros for @code{foreign-slot-value} and its
@code{setf} expansion that open code the memory access when
@var{type} and @var{slot-names} are constant at compile-time.
@subheading Examples
@lisp
(defcstruct point
"Pointer structure."
(x :int)
(y :int))
CFFI> (with-foreign-object (ptr 'point)
;; @lispcmt{Initialize the slots}
(setf (foreign-slot-value ptr 'point 'x) 42
(foreign-slot-value ptr 'point 'y) 42)
;; @lispcmt{Return a list with the coordinates}
(with-foreign-slots ((x y) ptr point)
(list x y)))
@result{} (42 42)
@end lisp
@subheading See Also
@seealso{defcstruct} @*
@seealso{foreign-slot-names} @*
@seealso{foreign-slot-offset} @*
@seealso{foreign-slot-pointer} @*
@seealso{with-foreign-slots}
@c ===================================================================
@c FOREIGN-TYPE-ALIGNMENT
@node foreign-type-alignment
@unnumberedsec foreign-type-alignment
@subheading Syntax
@c XXX: This is actually a generic function.
@Function{foreign-type-alignment type @res{} alignment}
@subheading Arguments and Values
@table @var
@item type
A foreign type.
@item alignment
An integer.
@end table
@subheading Description
The function @code{foreign-type-alignment} returns the
@var{alignment} of @var{type} in bytes.
@subheading Examples
@lisp
CFFI> (foreign-type-alignment :char)
@result{} 1
CFFI> (foreign-type-alignment :short)
@result{} 2
CFFI> (foreign-type-alignment :int)
@result{} 4
@end lisp
@lisp
(defcstruct foo
(a :char))
CFFI> (foreign-type-alignment 'foo)
@result{} 1
@end lisp
@subheading See Also
@seealso{foreign-type-size}
@c ===================================================================
@c FOREIGN-TYPE-SIZE
@node foreign-type-size
@unnumberedsec foreign-type-size
@subheading Syntax
@c XXX: this is actually a generic function.
@Function{foreign-type-size type @res{} size}
@subheading Arguments and Values
@table @var
@item type
A foreign type.
@item size
An integer.
@end table
@subheading Description
The function @code{foreign-type-size} return the @var{size} of
@var{type} in bytes. This includes any padding within and following
the in-memory representation as needed to create an array of
@var{type} objects.
@subheading Examples
@lisp
(defcstruct foo
(a :double)
(c :char))
CFFI> (foreign-type-size :double)
@result{} 8
CFFI> (foreign-type-size :char)
@result{} 1
CFFI> (foreign-type-size 'foo)
@result{} 16
@end lisp
@subheading See Also
@seealso{foreign-type-alignment}
@c ===================================================================
@c FREE-CONVERTED-OBJECT
@node free-converted-object
@unnumberedsec free-converted-object
@subheading Syntax
@Function{free-converted-object foreign-value type params}
@subheading Arguments and Values
@table @var
@item foreign-value
The C object to be freed.
@item type
A @cffi{} type specifier.
@item params
The state returned as the second value from @code{convert-to-foreign};
used to implement the third argument to @code{free-translated-object}.
@end table
@subheading Description
The return value is unspecified.
This is an external interface to the type translation facility. In
the implementation, all foreign functions are ultimately defined as
type translation wrappers around primitive foreign function
invocations.
This function is available mostly for inspection of the type
translation process, and possibly optimization of special cases of
your foreign function calls.
Its behavior is better described under @code{free-translated-object}'s
documentation.
@subheading Examples
@lisp
CFFI-USER> (convert-to-foreign "a boat" :string)
@result{} #<FOREIGN-ADDRESS #x097ACDC0>
@result{} (T)
CFFI-USER> (free-converted-object * :string '(t))
@result{} NIL
@end lisp
@subheading See Also
@seealso{convert-from-foreign} @*
@seealso{convert-to-foreign} @*
@seealso{free-translated-object}
@c ===================================================================
@c FREE-TRANSLATED-OBJECT
@c TODO: update
@node free-translated-object
@unnumberedsec free-translated-object
@subheading Syntax
@GenericFunction{free-translated-object value type-name param}
@subheading Arguments and Values
@table @var
@item pointer
The foreign value returned by @code{translate-to-foreign}.
@item type-name
A symbol naming a foreign type defined by @code{defctype}.
@item param
The second value, if any, returned by @code{translate-to-foreign}.
@end table
@subheading Description
This generic function may be specialized by user code to perform
automatic deallocation of foreign objects as they are passed to C
functions.
Any methods defined on this generic function must EQL-specialize the
@var{type-name} parameter on a symbol defined as a foreign type by
the @code{defctype} macro.
@subheading See Also
@seealso{Foreign Type Translators} @*
@seealso{translate-to-foreign}
@c ===================================================================
@c TRANSLATE-FROM-FOREIGN
@c TODO: update
@node translate-from-foreign
@unnumberedsec translate-from-foreign
@subheading Syntax
@GenericFunction{translate-from-foreign foreign-value type-name @
@res{} lisp-value}
@subheading Arguments and Values
@table @var
@item foreign-value
The foreign value to convert to a Lisp object.
@item type-name
A symbol naming a foreign type defined by @code{defctype}.
@item lisp-value
The lisp value to pass in place of @code{foreign-value} to Lisp code.
@end table
@subheading Description
This generic function is invoked by @cffi{} to convert a foreign value to
a Lisp value, such as when returning from a foreign function, passing
arguments to a callback function, or accessing a foreign variable.
To extend the @cffi{} type system by performing custom translations, this
method may be specialized by @sc{eql}-specializing @code{type-name} on a
symbol naming a foreign type defined with @code{defctype}. This
method should return the appropriate Lisp value to use in place of the
foreign value.
The results are undefined if the @code{type-name} parameter is
specialized in any way except an @sc{eql} specializer on a foreign type
defined with @code{defctype}. Specifically, translations may not be
defined for built-in types.
@subheading See Also
@seealso{Foreign Type Translators} @*
@seealso{translate-to-foreign} @*
@seealso{free-translated-object}
@c ===================================================================
@c TRANSLATE-TO-FOREIGN
@c TODO: update
@node translate-to-foreign
@unnumberedsec translate-to-foreign
@subheading Syntax
@GenericFunction{translate-to-foreign lisp-value type-name @
@res{} foreign-value, alloc-param}
@subheading Arguments and Values
@table @var
@item lisp-value
The Lisp value to convert to foreign representation.
@item type-name
A symbol naming a foreign type defined by @code{defctype}.
@item foreign-value
The foreign value to pass in place of @code{lisp-value} to foreign code.
@item alloc-param
If present, this value will be passed to
@code{free-translated-object}.
@end table
@subheading Description
This generic function is invoked by @cffi{} to convert a Lisp value to a
foreign value, such as when passing arguments to a foreign function,
returning a value from a callback, or setting a foreign variable. A
``foreign value'' is one appropriate for passing to the next-lowest
translator, including the low-level translators that are ultimately
invoked invisibly with @cffi{}.
To extend the @cffi{} type system by performing custom translations, this
method may be specialized by @sc{eql}-specializing @code{type-name} on a
symbol naming a foreign type defined with @code{defctype}. This
method should return the appropriate foreign value to use in place of
the Lisp value.
In cases where @cffi{} can determine the lifetime of the foreign object
returned by this method, it will invoke @code{free-translated-object}
on the foreign object at the appropriate time. If
@code{translate-to-foreign} returns a second value, it will be passed
as the @code{param} argument to @code{free-translated-object}. This
can be used to establish communication between the allocation and
deallocation methods.
The results are undefined if the @code{type-name} parameter is
specialized in any way except an @sc{eql} specializer on a foreign type
defined with @code{defctype}. Specifically, translations may not be
defined for built-in types.
@subheading See Also
@seealso{Foreign Type Translators} @*
@seealso{translate-from-foreign} @*
@seealso{free-translated-object}
@c ===================================================================
@c WITH-FOREIGN-SLOTS
@node with-foreign-slots
@unnumberedsec with-foreign-slots
@subheading Syntax
@Macro{with-foreign-slots (vars ptr type) &body body}
@subheading Arguments and Values
@table @var
@item vars
A list of symbols.
@item ptr
A foreign pointer to a structure.
@item type
A structure type.
@item body
A list of forms to be executed.
@end table
@subheading Description
The @code{with-foreign-slots} macro creates local symbol macros for
each var in @var{vars} to reference foreign slots in @var{ptr} of
@var{type}. It is similar to Common Lisp's @code{with-slots} macro.
@subheading Examples
@lisp
(defcstruct tm
(sec :int)
(min :int)
(hour :int)
(mday :int)
(mon :int)
(year :int)
(wday :int)
(yday :int)
(isdst :boolean)
(zone :string)
(gmtoff :long))
CFFI> (with-foreign-object (time :int)
(setf (mem-ref time :int)
(foreign-funcall "time" :pointer (null-pointer) :int))
(foreign-funcall "gmtime" :pointer time tm))
@result{} #<A Mac Pointer #x102A30>
CFFI> (with-foreign-slots ((sec min hour mday mon year) * tm)
(format nil "~A:~A:~A, ~A/~A/~A"
hour min sec (+ 1900 year) mon mday))
@result{} "7:22:47, 2005/8/2"
@end lisp
@subheading See Also
@seealso{defcstruct} @*
@seealso{defcunion} @*
@seealso{foreign-slot-value}
@c ===================================================================
@c CHAPTER: Pointers
@node Pointers
@chapter Pointers
All C data in @cffi{} is referenced through pointers. This includes
defined C variables that hold immediate values, and integers.
To see why this is, consider the case of the C integer. It is not
only an arbitrary representation for an integer, congruent to Lisp's
fixnums; the C integer has a specific bit pattern in memory defined by
the C @acronym{ABI}. Lisp has no such constraint on its fixnums;
therefore, it only makes sense to think of fixnums as C integers if
you assume that @cffi{} converts them when necessary, such as when
storing one for use in a C function call, or as the value of a C
variable. This requires defining an area of memory@footnote{The
definition of @dfn{memory} includes the @acronym{CPU} registers.},
represented through an effective address, and storing it there.
Due to this compartmentalization, it only makes sense to manipulate
raw C data in Lisp through pointers to it. For example, while there
may be a Lisp representation of a @code{struct} that is converted to C
at store time, you may only manipulate its raw data through a pointer.
The C compiler does this also, albeit informally.
@menu
* Basic Pointer Operations::
* Allocating Foreign Memory::
* Accessing Foreign Memory::
Dictionary
* foreign-free::
* foreign-alloc::
* foreign-symbol-pointer::
* inc-pointer::
* incf-pointer::
* make-pointer::
* mem-aref::
* mem-ref::
* null-pointer::
* null-pointer-p::
* pointerp::
* pointer-address::
* pointer-eq::
* with-foreign-object::
* with-foreign-pointer::
@end menu
@node Basic Pointer Operations
@section Basic Pointer Operations
Manipulating pointers proper can be accomplished through most of the
other operations defined in the Pointers dictionary, such as
@code{make-pointer}, @code{pointer-address}, and @code{pointer-eq}.
When using them, keep in mind that they merely manipulate the Lisp
representation of pointers, not the values they point to.
@deftp {Lisp Type} foreign-pointer
The pointers' representations differ from implementation to
implementation and have different types. @code{foreign-pointer}
provides a portable type alias to each of these types.
@end deftp
@node Allocating Foreign Memory
@section Allocating Foreign Memory
@cffi{} provides support for stack and heap C memory allocation.
Stack allocation, done with @code{with-foreign-object}, is sometimes
called ``dynamic'' allocation in Lisp, because memory allocated as
such has dynamic extent, much as with @code{let} bindings of special
variables.
This should not be confused with what C calls ``dynamic'' allocation,
or that done with @code{malloc} and friends. This sort of heap
allocation is done with @code{foreign-alloc}, creating objects that
exist until freed with @code{foreign-free}.
@node Accessing Foreign Memory
@section Accessing Foreign Memory
When manipulating raw C data, consider that all pointers are pointing
to an array. When you only want one C value, such as a single
@code{struct}, this array only has one such value. It is worthwhile
to remember that everything is an array, though, because this is also
the semantic that C imposes natively.
C values are accessed as the @code{setf}-able places defined by
@code{mem-aref} and @code{mem-ref}. Given a pointer and a @cffi{}
type (@pxref{Foreign Types}), either of these will dereference the
pointer, translate the C data there back to Lisp, and return the
result of said translation, performing the reverse operation when
@code{setf}-ing. To decide which one to use, consider whether you
would use the array index operator @code{[@var{n}]} or the pointer
dereference @code{*} in C; use @code{mem-aref} for array indexing and
@code{mem-ref} for pointer dereferencing.
@c ===================================================================
@c FOREIGN-FREE
@node foreign-free
@unnumberedsec foreign-free
@subheading Syntax
@Function{foreign-free ptr @res{} undefined}
@subheading Arguments and Values
@table @var
@item ptr
A foreign pointer.
@end table
@subheading Description
The @code{foreign-free} function frees a @code{ptr} previously
allocated by @code{foreign-alloc}. The consequences of freeing a given
pointer twice are undefined.
@subheading Examples
@lisp
CFFI> (foreign-alloc :int)
@result{} #<A Mac Pointer #x1022E0>
CFFI> (foreign-free *)
@result{} NIL
@end lisp
@subheading See Also
@seealso{foreign-alloc} @*
@seealso{with-foreign-pointer}
@c ===================================================================
@c FOREIGN-ALLOC
@node foreign-alloc
@unnumberedsec foreign-alloc
@subheading Syntax
@Function{foreign-alloc type &key initial-element initial-contents (count 1) @
null-terminated-p @res{} pointer}
@subheading Arguments and Values
@table @var
@item type
A foreign type.
@item initial-element
A Lisp object.
@item initial-contents
A sequence.
@item count
An integer. Defaults to 1 or the length of @var{initial-contents} if
supplied.
@item null-terminated-p
A boolean, false by default.
@item pointer
A foreign pointer to the newly allocated memory.
@end table
@subheading Description
The @code{foreign-alloc} function allocates enough memory to hold
@var{count} objects of type @var{type} and returns a
@var{pointer}. This memory must be explicitly freed using
@code{foreign-free} once it is no longer needed.
If @var{initial-element} is supplied, it is used to initialize the
@var{count} objects the newly allocated memory holds.
If an @var{initial-contents} sequence is supplied, it must have a
length less than or equal to @var{count} and each of its elements
will be used to initialize the contents of the newly allocated
memory.
If @var{count} is omitted and @var{initial-contents} is specified, it
will default to @code{(length @var{initial-contents})}.
@var{initial-element} and @var{initial-contents} are mutually
exclusive.
When @var{null-terminated-p} is true,
@code{(1+ (max @var{count} (length @var{initial-contents})))} elements
are allocated and the last one is set to @code{NULL}. Note that in
this case @var{type} must be a pointer type (ie. a type that
canonicalizes to @code{:pointer}), otherwise an error is signaled.
@subheading Examples
@lisp
CFFI> (foreign-alloc :char)
@result{} #<A Mac Pointer #x102D80> ; @lispcmt{A pointer to 1 byte of memory.}
CFFI> (foreign-alloc :char :count 20)
@result{} #<A Mac Pointer #x1024A0> ; @lispcmt{A pointer to 20 bytes of memory.}
CFFI> (foreign-alloc :int :initial-element 12)
@result{} #<A Mac Pointer #x1028B0>
CFFI> (mem-ref * :int)
@result{} 12
CFFI> (foreign-alloc :int :initial-contents '(1 2 3))
@result{} #<A Mac Pointer #x102950>
CFFI> (loop for i from 0 below 3
collect (mem-aref * :int i))
@result{} (1 2 3)
CFFI> (foreign-alloc :int :initial-contents #(1 2 3))
@result{} #<A Mac Pointer #x102960>
CFFI> (loop for i from 0 below 3
collect (mem-aref * :int i))
@result{} (1 2 3)
;;; Allocate a char** pointer that points to newly allocated memory
;;; by the :string type translator for the string "foo".
CFFI> (foreign-alloc :string :initial-element "foo")
@result{} #<A Mac Pointer #x102C40>
@end lisp
@lisp
;;; Allocate a null-terminated array of strings.
;;; (Note: FOREIGN-STRING-TO-LISP returns NIL when passed a null pointer)
CFFI> (foreign-alloc :string
:initial-contents '("foo" "bar" "baz")
:null-terminated-p t)
@result{} #<A Mac Pointer #x102D20>
CFFI> (loop for i from 0 below 4
collect (mem-aref * :string i))
@result{} ("foo" "bar" "baz" NIL)
CFFI> (progn
(dotimes (i 3)
(foreign-free (mem-aref ** :pointer i)))
(foreign-free **))
@result{} nil
@end lisp
@subheading See Also
@seealso{foreign-free} @*
@seealso{with-foreign-object} @*
@seealso{with-foreign-pointer}
@c ===================================================================
@c FOREIGN-SYMBOL-POINTER
@node foreign-symbol-pointer
@unnumberedsec foreign-symbol-pointer
@subheading Syntax
@Function{foreign-symbol-pointer foreign-name &key library @res{} pointer}
@subheading Arguments and Values
@table @var
@item foreign-name
A string.
@item pointer
A foreign pointer, or @code{nil}.
@item library
A Lisp symbol or an instance of @code{foreign-library}.
@end table
@subheading Description
The function @code{foreign-symbol-pointer} will return a foreign
pointer corresponding to the foreign symbol denoted by the string
@var{foreign-name}. If a foreign symbol named @var{foreign-name}
doesn't exist, @code{nil} is returned.
ABI name manglings will be performed on @var{foreign-name} by
@code{foreign-symbol-pointer} if necessary. (eg: adding a leading
underscore on darwin/ppc)
@var{library} should name a foreign library as defined by
@code{define-foreign-library}, @code{:default} (which is the default)
or an instance of @code{foreign-library} as returned by
@code{load-foreign-library}.
@strong{Important note:} do not keep these pointers across saved Lisp
cores as the foreign-library may move across sessions.
@subheading Examples
@lisp
CFFI> (foreign-symbol-pointer "errno")
@result{} #<A Mac Pointer #xA0008130>
CFFI> (foreign-symbol-pointer "strerror")
@result{} #<A Mac Pointer #x9002D0F8>
CFFI> (foreign-funcall-pointer * () :int (mem-ref ** :int) :string)
@result{} "No such file or directory"
CFFI> (foreign-symbol-pointer "inexistent symbol")
@result{} NIL
@end lisp
@subheading See Also
@seealso{defcvar}
@c ===================================================================
@c INC-POINTER
@node inc-pointer
@unnumberedsec inc-pointer
@subheading Syntax
@Function{inc-pointer pointer offset @res{} new-pointer}
@subheading Arguments and Values
@table @var
@item pointer
@itemx new-pointer
A foreign pointer.
@item offset
An integer.
@end table
@subheading Description
The function @code{inc-pointer} will return a @var{new-pointer} pointing
@var{offset} bytes past @var{pointer}.
@subheading Examples
@lisp
CFFI> (foreign-string-alloc "Common Lisp")
@result{} #<A Mac Pointer #x102EA0>
CFFI> (inc-pointer * 7)
@result{} #<A Mac Pointer #x102EA7>
CFFI> (foreign-string-to-lisp *)
@result{} "Lisp"
@end lisp
@subheading See Also
@seealso{incf-pointer} @*
@seealso{make-pointer} @*
@seealso{pointerp} @*
@seealso{null-pointer} @*
@seealso{null-pointer-p}
@c ===================================================================
@c INCF-POINTER
@node incf-pointer
@unnumberedsec inc-pointer
@subheading Syntax
@Macro{incf-pointer place &optional (offset 1) @res{} new-pointer}
@subheading Arguments and Values
@table @var
@item place
A @code{setf} place.
@item new-pointer
A foreign pointer.
@item offset
An integer.
@end table
@subheading Description
The @code{incf-pointer} macro takes the foreign pointer from
@var{place} and creates a @var{new-pointer} incremented by
@var{offset} bytes and which is stored in @var{place}.
@subheading Examples
@lisp
CFFI> (defparameter *two-words* (foreign-string-alloc "Common Lisp"))
@result{} *TWO-WORDS*
CFFI> (defparameter *one-word* *two-words*)
@result{} *ONE-WORD*
CFFI> (incf-pointer *one-word* 7)
@result{} #.(SB-SYS:INT-SAP #X00600457)
CFFI> (foreign-string-to-lisp *one-word*)
@result{} "Lisp"
CFFI> (foreign-string-to-lisp *two-words*)
@result{} "Common Lisp"
@end lisp
@subheading See Also
@seealso{inc-pointer} @*
@seealso{make-pointer} @*
@seealso{pointerp} @*
@seealso{null-pointer} @*
@seealso{null-pointer-p}
@c ===================================================================
@c MAKE-POINTER
@node make-pointer
@unnumberedsec make-pointer
@subheading Syntax
@Function{make-pointer address @res{} ptr}
@subheading Arguments and Values
@table @var
@item address
An integer.
@item ptr
A foreign pointer.
@end table
@subheading Description
The function @code{make-pointer} will return a foreign pointer
pointing to @var{address}.
@subheading Examples
@lisp
CFFI> (make-pointer 42)
@result{} #<FOREIGN-ADDRESS #x0000002A>
CFFI> (pointerp *)
@result{} T
CFFI> (pointer-address **)
@result{} 42
CFFI> (inc-pointer *** -42)
@result{} #<FOREIGN-ADDRESS #x00000000>
CFFI> (null-pointer-p *)
@result{} T
CFFI> (typep ** 'foreign-pointer)
@result{} T
@end lisp
@subheading See Also
@seealso{inc-pointer} @*
@seealso{null-pointer} @*
@seealso{null-pointer-p} @*
@seealso{pointerp} @*
@seealso{pointer-address} @*
@seealso{pointer-eq} @*
@seealso{mem-ref}
@c ===================================================================
@c MEM-AREF
@node mem-aref
@unnumberedsec mem-aref
@subheading Syntax
@Accessor{mem-aref ptr type &optional (index 0)}
(setf (@strong{mem-aref} @emph{ptr type &optional (index 0)) new-value})
@subheading Arguments and Values
@table @var
@item ptr
A foreign pointer.
@item type
A foreign type.
@item index
An integer.
@item new-value
A Lisp value compatible with @var{type}.
@end table
@subheading Description
The @code{mem-aref} function is similar to @code{mem-ref} but will
automatically calculate the offset from an @var{index}.
@lisp
(mem-aref ptr type n)
;; @lispcmt{is identical to:}
(mem-ref ptr type (* n (foreign-type-size type)))
@end lisp
@subheading Examples
@lisp
CFFI> (with-foreign-string (str "Hello, foreign world!")
(mem-aref str :char 6))
@result{} 32
CFFI> (code-char *)
@result{} #\Space
CFFI> (with-foreign-object (array :int 10)
(loop for i below 10
do (setf (mem-aref array :int i) (random 100)))
(loop for i below 10 collect (mem-aref array :int i)))
@result{} (22 7 22 52 69 1 46 93 90 65)
@end lisp
@subheading See Also
@seealso{mem-ref}
@c ===================================================================
@c MEM-REF
@node mem-ref
@unnumberedsec mem-ref
@subheading Syntax
@Accessor{mem-ref ptr type &optional offset @res{} object}
@subheading Arguments and Values
@table @var
@item ptr
A pointer.
@item type
A foreign type.
@item offset
An integer (in byte units).
@item object
The value @var{ptr} points to.
@end table
@subheading Description
@subheading Examples
@lisp
CFFI> (with-foreign-string (ptr "Saluton")
(setf (mem-ref ptr :char 3) (char-code #\a))
(loop for i from 0 below 8
collect (code-char (mem-ref ptr :char i))))
@result{} (#\S #\a #\l #\a #\t #\o #\n #\Null)
CFFI> (setq ptr-to-int (foreign-alloc :int))
@result{} #<A Mac Pointer #x1047D0>
CFFI> (mem-ref ptr-to-int :int)
@result{} 1054619
CFFI> (setf (mem-ref ptr-to-int :int) 1984)
@result{} 1984
CFFI> (mem-ref ptr-to-int :int)
@result{} 1984
@end lisp
@subheading See Also
@seealso{mem-aref}
@c ===================================================================
@c NULL-POINTER
@node null-pointer
@unnumberedsec null-pointer
@subheading Syntax
@Function{null-pointer @res{} pointer}
@subheading Arguments and Values
@table @var
@item pointer
A @code{NULL} pointer.
@end table
@subheading Description
The function @code{null-pointer} returns a null pointer.
@subheading Examples
@lisp
CFFI> (null-pointer)
@result{} #<A Null Mac Pointer>
CFFI> (pointerp *)
@result{} T
@end lisp
@subheading See Also
@seealso{null-pointer-p} @*
@seealso{make-pointer}
@c ===================================================================
@c NULL-POINTER-P
@node null-pointer-p
@unnumberedsec null-pointer-p
@subheading Syntax
@Function{null-pointer-p ptr @res{} boolean}
@subheading Arguments and Values
@table @var
@item ptr
A foreign pointer that may be a null pointer.
@item boolean
@code{T} or @code{NIL}.
@end table
@subheading Description
The function @code{null-pointer-p} returns true if @var{ptr} is a null
pointer and false otherwise.
@subheading Examples
@lisp
CFFI> (null-pointer-p (null-pointer))
@result{} T
@end lisp
@lisp
(defun contains-str-p (big little)
(not (null-pointer-p
(foreign-funcall "strstr" :string big :string little :pointer))))
CFFI> (contains-str-p "Popcorns" "corn")
@result{} T
CFFI> (contains-str-p "Popcorns" "salt")
@result{} NIL
@end lisp
@subheading See Also
@seealso{null-pointer} @*
@seealso{pointerp}
@c ===================================================================
@c POINTERP
@node pointerp
@unnumberedsec pointerp
@subheading Syntax
@Function{pointerp ptr @res{} boolean}
@subheading Arguments and Values
@table @var
@item ptr
An object that may be a foreign pointer.
@item boolean
@code{T} or @code{NIL}.
@end table
@subheading Description
The function @code{pointerp} returns true if @var{ptr} is a foreign
pointer and false otherwise.
@subheading Implementation-specific Notes
In Allegro CL, foreign pointers are integers thus in this
implementation @code{pointerp} will return true for any ordinary integer.
@subheading Examples
@lisp
CFFI> (foreign-alloc 32)
@result{} #<A Mac Pointer #x102D20>
CFFI> (pointerp *)
@result{} T
CFFI> (pointerp "this is not a pointer")
@result{} NIL
@end lisp
@subheading See Also
@seealso{make-pointer}
@seealso{null-pointer-p}
@c ===================================================================
@c POINTER-ADDRESS
@node pointer-address
@unnumberedsec pointer-address
@subheading Syntax
@Function{pointer-address ptr @res{} address}
@subheading Arguments and Values
@table @var
@item ptr
A foreign pointer.
@item address
An integer.
@end table
@subheading Description
The function @code{pointer-address} will return the @var{address} of
a foreign pointer @var{ptr}.
@subheading Examples
@lisp
CFFI> (pointer-address (null-pointer))
@result{} 0
CFFI> (pointer-address (make-pointer 123))
@result{} 123
@end lisp
@subheading See Also
@seealso{make-pointer} @*
@seealso{inc-pointer} @*
@seealso{null-pointer} @*
@seealso{null-pointer-p} @*
@seealso{pointerp} @*
@seealso{pointer-eq} @*
@seealso{mem-ref}
@c ===================================================================
@c POINTER-EQ
@node pointer-eq
@unnumberedsec pointer-eq
@subheading Syntax
@Function{pointer-eq ptr1 ptr2 @res{} boolean}
@subheading Arguments and Values
@table @var
@item ptr1
@itemx ptr2
A foreign pointer.
@item boolean
@code{T} or @code{NIL}.
@end table
@subheading Description
The function @code{pointer-eq} returns true if @var{ptr1} and
@var{ptr2} point to the same memory address and false otherwise.
@subheading Implementation-specific Notes
The representation of foreign pointers varies across the various Lisp
implementations as does the behaviour of the built-in Common Lisp
equality predicates. Comparing two pointers that point to the same
address with @code{EQ} Lisps will return true on some Lisps, others require
more general predicates like @code{EQL} or @code{EQUALP} and finally
some will return false using any of these predicates. Therefore, for
portability, you should use @code{POINTER-EQ}.
@subheading Examples
This is an example using @acronym{SBCL}, see the
implementation-specific notes above.
@lisp
CFFI> (eql (null-pointer) (null-pointer))
@result{} NIL
CFFI> (pointer-eq (null-pointer) (null-pointer))
@result{} T
@end lisp
@subheading See Also
@seealso{inc-pointer}
@c ===================================================================
@c WITH-FOREIGN-OBJECT
@node with-foreign-object
@unnumberedsec with-foreign-object
@subheading Syntax
@Macro{with-foreign-object (var type &optional count) &body body}
@Macro{with-foreign-objects (bindings) &body body}
bindings ::= @{(var type &optional count)@}*
@subheading Arguments and Values
@table @var
@item var
A symbol.
@item type
A foreign type, evaluated.
@item count
An integer.
@end table
@subheading Description
The macros @code{with-foreign-object} and @code{with-foreign-objects}
bind @var{var} to a pointer to @var{count} newly allocated objects
of type @var{type} during @var{body}. The buffer has dynamic extent
and may be stack allocated if supported by the host Lisp.
@subheading Examples
@lisp
CFFI> (with-foreign-object (array :int 10)
(dotimes (i 10)
(setf (mem-aref array :int i) (random 100)))
(loop for i below 10
collect (mem-aref array :int i)))
@result{} (22 7 22 52 69 1 46 93 90 65)
@end lisp
@subheading See Also
@seealso{foreign-alloc}
@c ===================================================================
@c WITH-FOREIGN-POINTER
@node with-foreign-pointer
@unnumberedsec with-foreign-pointer
@subheading Syntax
@Macro{with-foreign-pointer (var size &optional size-var) &body body}
@subheading Arguments and Values
@table @var
@item var
@itemx size-var
A symbol.
@item size
An integer.
@item body
A list of forms to be executed.
@end table
@subheading Description
The @code{with-foreign-pointer} macro, binds @var{var} to @var{size}
bytes of foreign memory during @var{body}. The pointer in @var{var}
is invalid beyond the dynamic extend of @var{body} and may be
stack-allocated if supported by the implementation.
If @var{size-var} is supplied, it will be bound to @var{size} during
@var{body}.
@subheading Examples
@lisp
CFFI> (with-foreign-pointer (string 4 size)
(setf (mem-ref string :char (1- size)) 0)
(lisp-string-to-foreign "Popcorns" string size)
(loop for i from 0 below size
collect (code-char (mem-ref string :char i))))
@result{} (#\P #\o #\p #\Null)
@end lisp
@subheading See Also
@seealso{foreign-alloc} @*
@seealso{foreign-free}
@c ===================================================================
@c CHAPTER: Strings
@node Strings
@chapter Strings
As with many languages, Lisp and C have special support for logical
arrays of characters, going so far as to give them a special name,
``strings''. In that spirit, @cffi{} provides special support for
translating between Lisp and C strings.
The @code{:string} type and the symbols related below also serve as an
example of what you can do portably with @cffi{}; were it not
included, you could write an equally functional @file{strings.lisp}
without referring to any implementation-specific symbols.
@menu
Dictionary
* *default-foreign-encoding*::
* foreign-string-alloc::
* foreign-string-free::
* foreign-string-to-lisp::
* lisp-string-to-foreign::
* with-foreign-string::
* with-foreign-pointer-as-string::
@end menu
@c ===================================================================
@c *DEFAULT-FOREIGN-ENCODING*
@node *default-foreign-encoding*
@unnumberedsec *default-foreign-encoding*
@subheading Syntax
@Variable{*default-foreign-encoding*}
@subheading Value type
A keyword.
@subheading Initial value
@code{:utf-8}
@subheading Description
This special variable holds the default foreign encoding.
@subheading Examples
@lisp
CFFI> *default-foreign-encoding*
:utf-8
CFFI> (foreign-funcall "strdup" (:string :encoding :utf-16) "foo" :string)
"f"
CFFI> (let ((*default-foreign-encoding* :utf-16))
(foreign-funcall "strdup" (:string :encoding :utf-16) "foo" :string))
"foo"
@end lisp
@subheading See also
@seealso{Other Types} (@code{:string} type) @*
@seealso{foreign-string-alloc} @*
@seealso{foreign-string-to-lisp} @*
@seealso{lisp-string-to-foreign} @*
@seealso{with-foreign-string} @*
@seealso{with-foreign-pointer-as-string}
@c ===================================================================
@c FOREIGN-STRING-ALLOC
@node foreign-string-alloc
@unnumberedsec foreign-string-alloc
@subheading Syntax
@Function{foreign-string-alloc string &key encoding null-terminated-p @
start end @res{} pointer}
@subheading Arguments and Values
@table @var
@item string
A Lisp string.
@item encoding
Foreign encoding. Defaults to @code{*default-foreign-encoding*}.
@item null-terminated-p
Boolean, defaults to true.
@item start, end
Bounding index designators of @var{string}. 0 and @code{nil}, by
default.
@item pointer
A pointer to the newly allocated foreign string.
@end table
@subheading Description
The @code{foreign-string-alloc} function allocates foreign memory
holding a copy of @var{string} converted using the specified
@var{encoding}. @var{Start} specifies an offset into @var{string} and
@var{end} marks the position following the last element of the foreign
string.
This string must be freed with @code{foreign-string-free}.
If @var{null-terminated-p} is false, the string will not be
null-terminated.
@subheading Examples
@lisp
CFFI> (defparameter *str* (foreign-string-alloc "Hello, foreign world!"))
@result{} #<FOREIGN-ADDRESS #x00400560>
CFFI> (foreign-funcall "strlen" :pointer *str* :int)
@result{} 21
@end lisp
@subheading See Also
@seealso{foreign-string-free} @*
@seealso{with-foreign-string}
@c @seealso{:string}
@c ===================================================================
@c FOREIGN-STRING-FREE
@node foreign-string-free
@unnumberedsec foreign-string-free
@subheading Syntax
@Function{foreign-string-free pointer}
@subheading Arguments and Values
@table @var
@item pointer
A pointer to a string allocated by @code{foreign-string-alloc}.
@end table
@subheading Description
The @code{foreign-string-free} function frees a foreign string
allocated by @code{foreign-string-alloc}.
@subheading Examples
@subheading See Also
@seealso{foreign-string-alloc}
@c ===================================================================
@c FOREIGN-STRING-TO-LISP
@node foreign-string-to-lisp
@unnumberedsec foreign-string-to-lisp
@subheading Syntax
@Function{foreign-string-to-lisp ptr &optional offset count max-chars @
encoding @res{} string}
@subheading Arguments and Values
@table @var
@item ptr
A pointer.
@item offset
An integer greater than or equal to 0. Defauls to 0.
@item count
Either @code{nil} (the default), or an integer greater than or equal to 0.
@item max-chars
An integer greater than or equal to 0.
@code{(1- array-total-size-limit)}, by default.
@item encoding
Foreign encoding. Defaults to @code{*default-foreign-encoding*}.
@item string
A Lisp string.
@end table
@subheading Description
The @code{foreign-string-to-lisp} function converts at most
@var{count} octets from @var{ptr} into a Lisp string, using the
defined @var{encoding}.
If @var{count} is @code{nil} (the default), characters are copied
until @var{max-chars} is reached or a @code{NULL} character is found.
If @var{ptr} is a null pointer, returns @code{nil}.
Note that the @code{:string} type will automatically convert between
Lisp strings and foreign strings.
@subheading Examples
@lisp
CFFI> (foreign-funcall "getenv" :string "HOME" :pointer)
@result{} #<FOREIGN-ADDRESS #xBFFFFFD5>
CFFI> (foreign-string-to-lisp *)
@result{} "/Users/luis"
@end lisp
@subheading See Also
@seealso{lisp-string-to-foreign} @*
@seealso{foreign-string-alloc}
@c @seealso{:string}
@c ===================================================================
@c LISP-STRING-TO-FOREIGN
@node lisp-string-to-foreign
@unnumberedsec lisp-string-to-foreign
@subheading Syntax
@Function{lisp-string-to-foreign string buffer bufsize &key start @
end offset encoding @res{} buffer}
@subheading Arguments and Values
@table @var
@item string
A Lisp string.
@item buffer
A foreign pointer.
@item bufsize
An integer.
@item start, end
Bounding index designators of @var{string}. 0 and @code{nil}, by
default.
@item offset
An integer greater than or equal to 0. Defauls to 0.
@item encoding
Foreign encoding. Defaults to @code{*default-foreign-encoding*}.
@end table
@subheading Description
The @code{lisp-string-to-foreign} function copies at most
@var{bufsize}-1 octets from a Lisp @var{string} using the specified
@var{encoding} into @var{buffer}+@var{offset}. The foreign string will
be null-terminated.
@var{Start} specifies an offset into @var{string} and
@var{end} marks the position following the last element of the foreign
string.
@subheading Examples
@lisp
CFFI> (with-foreign-pointer-as-string (str 255)
(lisp-string-to-foreign "Hello, foreign world!" str 6))
@result{} "Hello"
@end lisp
@subheading See Also
@seealso{foreign-string-alloc} @*
@seealso{foreign-string-to-lisp} @*
@seealso{with-foreign-pointer-as-string}
@c ===================================================================
@c WITH-FOREIGN-STRING
@node with-foreign-string
@unnumberedsec with-foreign-string
@subheading Syntax
@Macro{with-foreign-string (var-or-vars string &rest args) &body body}
@Macro{with-foreign-strings (bindings) &body body}
var-or-vars ::= var | (var &optional octet-size-var)
bindings ::= @{(var-or-vars string &rest args)@}*
@subheading Arguments and Values
@table @var
@item var, byte-size-var
A symbol.
@item string
A Lisp string.
@item body
A list of forms to be executed.
@end table
@subheading Description
The @code{with-foreign-string} macro will bind @var{var} to a newly
allocated foreign string containing @var{string}. @var{Args} is passed
to the underlying @code{foreign-string-alloc} call.
If @var{octet-size-var} is provided, it will be bound the length of
foreign string in octets including the null terminator.
@subheading Examples
@lisp
CFFI> (with-foreign-string (foo "12345")
(foreign-funcall "strlen" :pointer foo :int))
@result{} 5
CFFI> (let ((array (coerce #(84 117 114 97 110 103 97)
'(array (unsigned-byte 8)))))
(with-foreign-string (foreign-string array)
(foreign-string-to-lisp foreign-string)))
@result{} "Turanga"
@end lisp
@subheading See Also
@seealso{foreign-string-alloc} @*
@seealso{with-foreign-pointer-as-string}
@c ===================================================================
@c WITH-FOREIGN-POINTER-AS-STRING
@node with-foreign-pointer-as-string
@unnumberedsec with-foreign-pointer-as-string
@subheading Syntax
@Macro{with-foreign-pointer-as-string (var size &optional size-var @
&rest args) &body body @res{} string}
@subheading Arguments and Values
@table @var
@item var
A symbol.
@item string
A Lisp string.
@item body
List of forms to be executed.
@end table
@subheading Description
The @code{with-foreign-pointer-as-string} macro is similar to
@code{with-foreign-pointer} except that @var{var} is used as the
returned value of an implicit @code{progn} around @var{body}, after
being converted to a Lisp string using the provided @var{args}.
@subheading Examples
@lisp
CFFI> (with-foreign-pointer-as-string (str 6 str-size :encoding :ascii)
(lisp-string-to-foreign "Hello, foreign world!" str str-size))
@result{} "Hello"
@end lisp
@subheading See Also
@seealso{foreign-string-alloc} @*
@seealso{with-foreign-string}
@c ===================================================================
@c CHAPTER: Variables
@node Variables
@chapter Variables
@menu
Dictionary
* defcvar::
* get-var-pointer::
@end menu
@c ===================================================================
@c DEFCVAR
@node defcvar
@unnumberedsec defcvar
@subheading Syntax
@Macro{defcvar name-and-options type &optional documentation @res{} lisp-name}
@var{name-and-options} ::= name | (name &key read-only (library :default)) @*
@var{name} ::= lisp-name [foreign-name] | foreign-name [lisp-name]
@subheading Arguments and Values
@table @var
@item foreign-name
A string denoting a foreign function.
@item lisp-name
A symbol naming the Lisp function to be created.
@item type
A foreign type.
@item read-only
A boolean.
@item documentation
A Lisp string; not evaluated.
@end table
@subheading Description
The @code{defcvar} macro defines a symbol macro @var{lisp-name} that looks
up @var{foreign-name} and dereferences it acording to @var{type}. It
can also be @code{setf}ed, unless @var{read-only} is true, in which
case an error will be signaled.
When one of @var{lisp-name} or @var{foreign-name} is omitted, the
other is automatically derived using the following rules:
@itemize
@item
Foreign names are converted to Lisp names by uppercasing, replacing
underscores with hyphens, and wrapping around asterisks.
@item
Lisp names are converted to foreign names by lowercasing, replacing
hyphens with underscores, and removing asterisks, if any.
@end itemize
@subheading Examples
@lisp
CFFI> (defcvar "errno" :int)
@result{} *ERRNO*
CFFI> (foreign-funcall "strerror" :int *errno* :string)
@result{} "Inappropriate ioctl for device"
CFFI> (setf *errno* 1)
@result{} 1
CFFI> (foreign-funcall "strerror" :int *errno* :string)
@result{} "Operation not permitted"
@end lisp
Trying to modify a read-only foreign variable:
@lisp
CFFI> (defcvar ("errno" +error-number+) :int :read-only t)
@result{} +ERROR-NUMBER+
CFFI> (setf +error-number+ 12)
;; @lispcmt{@error{} Trying to modify read-only foreign var: +ERROR-NUMBER+.}
@end lisp
@emph{Note that accessing @code{errno} this way won't work with every
C standard library.}
@subheading See Also
@seealso{get-var-pointer}
@c ===================================================================
@c GET-VAR-POINTER
@node get-var-pointer
@unnumberedsec get-var-pointer
@subheading Syntax
@Function{get-var-pointer symbol @res{} pointer}
@subheading Arguments and Values
@table @var
@item symbol
A symbol denoting a foreign variable defined with @code{defcvar}.
@item pointer
A foreign pointer.
@end table
@subheading Description
The function @code{get-var-pointer} will return a @var{pointer} to the
foreign global variable @var{symbol} previously defined with
@code{defcvar}.
@subheading Examples
@lisp
CFFI> (defcvar "errno" :int :read-only t)
@result{} *ERRNO*
CFFI> *errno*
@result{} 25
CFFI> (get-var-pointer '*errno*)
@result{} #<A Mac Pointer #xA0008130>
CFFI> (mem-ref * :int)
@result{} 25
@end lisp
@subheading See Also
@seealso{defcvar}
@c ===================================================================
@c CHAPTER: Functions
@node Functions
@chapter Functions
@menu
@c * Defining Foreign Functions::
@c * Calling Foreign Functions::
Dictionary
* defcfun::
* foreign-funcall::
* foreign-funcall-pointer::
@end menu
@c @node Calling Foreign Functions
@c @section Calling Foreign Functions
@c @node Defining Foreign Functions
@c @section Defining Foreign Functions
@c ===================================================================
@c DEFCFUN
@node defcfun
@unnumberedsec defcfun
@subheading Syntax
@Macro{defcfun name-and-options return-type &body arguments [&rest] @
@res{} lisp-name}
@var{name-and-options} name | (name &key library calling-convention cconv) @*
@var{name} ::= @var{lisp-name} [@var{foreign-name}] | @var{foreign-name} [@var{lisp-name}] @*
@var{arguments} ::= @{ (arg-name arg-type) @}* @*
@subheading Arguments and Values
@table @var
@item foreign-name
A string denoting a foreign function.
@item lisp-name
A symbol naming the Lisp function to be created.
@item arg-name
A symbol.
@item return-type
@itemx arg-type
A foreign type.
@item calling-convention
@itemx cconv
One of @code{:cdecl} (default) or @code{stdcall}.
@item library
A symbol designating a foreign library.
@end table
@subheading Description
The @code{defcfun} macro provides a declarative interface for defining
Lisp functions that call foreign functions.
When one of @var{lisp-name} or @var{foreign-name} is omitted, the
other is automatically derived using the following rules:
@itemize
@item
Foreign names are converted to Lisp names by uppercasing and replacing
underscores with hyphens.
@item
Lisp names are converted to foreign names by lowercasing and replacing
hyphens with underscores.
@end itemize
If you place the symbol @code{&rest} in the end of the argument list
after the fixed arguments, @code{defcfun} will treat the foreign
function as a @strong{variadic function}. The variadic arguments
should be passed in a way similar to what @code{foreign-funcall} would
expect. Unlike @code{foreign-funcall} though, @code{defcfun} will take
care of doing argument promotion. Note that in this case
@code{defcfun} will generate a Lisp @emph{macro} instead of a
function and will only work for Lisps that support
@code{foreign-funcall.}
@subheading Examples
@lisp
(defcfun "strlen" :int (n :string))
CFFI> (strlen "123")
@result{} 3
@end lisp
@lisp
(defcfun ("abs" c-abs) :int (n :int))
CFFI> (c-abs -42)
@result{} 42
@end lisp
Variadic function example:
@lisp
(defcfun "sprintf" :int
(str :pointer)
(control :string)
&rest)
CFFI> (with-foreign-pointer-as-string (s 100)
(sprintf s "%c %d %.2f %s" :char 90 :short 42 :float pi
:string "super-locrian"))
@result{} "A 42 3.14 super-locrian"
@end lisp
@subheading See Also
@seealso{foreign-funcall} @*
@seealso{foreign-funcall-pointer}
@c ===================================================================
@c FOREIGN-FUNCALL
@node foreign-funcall
@unnumberedsec foreign-funcall
@subheading Syntax
@Macro{foreign-funcall name-and-options &rest arguments @res{} return-value}
arguments ::= @{ arg-type arg @}* [return-type]
name-and-options ::= name | ( name &key library calling-convention cconv)
@subheading Arguments and Values
@table @var
@item name
A Lisp string.
@item arg-type
A foreign type.
@item arg
An argument of type @var{arg-type}.
@item return-type
A foreign type, @code{:void} by default.
@item return-value
A lisp object.
@item library
A lisp symbol; not evaluated.
@item calling-convention
@itemx cconv
One of @code{:cdecl} (default) or @code{:stdcall}.
@end table
@subheading Description
The @code{foreign-funcall} macro is the main primitive for calling
foreign functions.
@emph{Note: The return value of foreign-funcall on functions with a
:void return type is still undefined.}
@subheading Implementation-specific Notes
@itemize
@item
Corman Lisp does not support @code{foreign-funcall}. On
implementations that @strong{don't} support @code{foreign-funcall}
@code{cffi-sys::no-foreign-funcall} will be present in
@code{*features*}. Note: in these Lisps you can still use the
@code{defcfun} interface.
@end itemize
@subheading Examples
@lisp
CFFI> (foreign-funcall "strlen" :string "foo" :int)
@result{} 3
@end lisp
Given the C code:
@example
void print_number(int n)
@{
printf("N: %d\n", n);
@}
@end example
@lisp
CFFI> (foreign-funcall "print_number" :int 123456)
@print{} N: 123456
@result{} NIL
@end lisp
@noindent
Or, equivalently:
@lisp
CFFI> (foreign-funcall "print_number" :int 123456 :void)
@print{} N: 123456
@result{} NIL
@end lisp
@lisp
CFFI> (foreign-funcall "printf" :string (format nil "%s: %d.~%")
:string "So long and thanks for all the fish"
:int 42 :int)
@print{} So long and thanks for all the fish: 42.
@result{} 41
@end lisp
@subheading See Also
@seealso{defcfun} @*
@seealso{foreign-funcall-pointer}
@c ===================================================================
@c FOREIGN-FUNCALL-POINTER
@node foreign-funcall-pointer
@unnumberedsec foreign-funcall-pointer
@subheading Syntax
@Macro{foreign-funcall pointer options &rest arguments @res{} return-value}
arguments ::= @{ arg-type arg @}* [return-type]
options ::= ( &key calling-convention cconv )
@subheading Arguments and Values
@table @var
@item pointer
A foreign pointer.
@item arg-type
A foreign type.
@item arg
An argument of type @var{arg-type}.
@item return-type
A foreign type, @code{:void} by default.
@item return-value
A lisp object.
@item calling-convention
@itemx cconv
One of @code{:cdecl} (default) or @code{:stdcall}.
@end table
@subheading Description
The @code{foreign-funcall} macro is the main primitive for calling
foreign functions.
@emph{Note: The return value of foreign-funcall on functions with a
:void return type is still undefined.}
@subheading Implementation-specific Notes
@itemize
@item
Corman Lisp does not support @code{foreign-funcall}. On
implementations that @strong{don't} support @code{foreign-funcall}
@code{cffi-sys::no-foreign-funcall} will be present in
@code{*features*}. Note: in these Lisps you can still use the
@code{defcfun} interface.
@end itemize
@subheading Examples
@lisp
CFFI> (foreign-funcall-pointer (foreign-symbol-pointer "abs")
:int -42 :int)
@result{} 42
@end lisp
@subheading See Also
@seealso{defcfun} @*
@seealso{foreign-funcall}
@c ===================================================================
@c CHAPTER: Libraries
@node Libraries
@chapter Libraries
@menu
* Defining a library::
* Library definition style::
Dictionary
* close-foreign-library:: Close a foreign library.
* *darwin-framework-directories*:: Search path for Darwin frameworks.
* define-foreign-library:: Explain how to load a foreign library.
* *foreign-library-directories*:: Search path for shared libraries.
* load-foreign-library:: Load a foreign library.
* load-foreign-library-error:: Signalled on failure of its namesake.
* use-foreign-library:: Load a foreign library when needed.
@end menu
@node Defining a library
@section Defining a library
Almost all foreign code you might want to access exists in some kind
of shared library. The meaning of @dfn{shared library} varies among
platforms, but for our purposes, we will consider it to include
@file{.so} files on @sc{unix}, frameworks on Darwin (and derivatives
like Mac @acronym{OS X}), and @file{.dll} files on Windows.
Bringing one of these libraries into the Lisp image is normally a
two-step process.
@enumerate
@item
Describe to @cffi{} how to load the library at some future point,
depending on platform and other factors, with a
@code{define-foreign-library} top-level form.
@item
Load the library so defined with either a top-level
@code{use-foreign-library} form or by calling the function
@code{load-foreign-library}.
@end enumerate
@xref{Tutorial-Loading,, Loading foreign libraries}, for a working
example of the above two steps.
@node Library definition style
@section Library definition style
Looking at the @code{libcurl} library definition presented earlier,
you may ask why we did not simply do this:
@lisp
(define-foreign-library libcurl
(t (:default "libcurl")))
@end lisp
@noindent
Indeed, this would work just as well on the computer on which I tested
the tutorial. There are a couple of good reasons to provide the
@file{.so}'s current version number, however. Namely, the versionless
@file{.so} is not packaged on most @sc{unix} systems along with the
actual, fully-versioned library; instead, it is included in the
``development'' package along with C headers and static @file{.a}
libraries.
The reason @cffi{} does not try to account for this lies in the
meaning of the version numbers. A full treatment of shared library
versions is beyond this manual's scope; see @ref{Versioning,, Library
interface versions, libtool, @acronym{GNU} Libtool}, for helpful
information for the unfamiliar. For our purposes, consider that a
mismatch between the library version with which you tested and the
installed library version may cause undefined
behavior.@footnote{Windows programmers may chafe at adding a
@sc{unix}-specific clause to @code{define-foreign-library}. Instead,
ask why the Windows solution to library incompatibility is ``include
your own version of every library you use with every program''.}
@impnote{Maybe some notes should go here about OS X, which I know
little about. --stephen}
@c ===================================================================
@c CLOSE-FOREIGN-LIBRARY
@node close-foreign-library
@unnumberedsec close-foreign-library
@subheading Syntax
@Function{close-foreign-library library @res{} success}
@subheading Arguments and Values
@table @var
@item library
A symbol or an instance of @code{foreign-library}.
@item success
A Lisp boolean.
@end table
@subheading Description
Closes @var{library} which can be a symbol designating a library
define through @code{define-foreign-library} or an instance of
@code{foreign-library} as returned by @code{load-foreign-library}.
@c @subheading Examples
@c @xref{Tutorial-Loading,, Loading foreign libraries}.
@subheading See Also
@seealso{define-foreign-library} @*
@seealso{load-foreign-library} @*
@seealso{use-foreign-library}
@c ===================================================================
@c *DARWIN-FRAMEWORK-DIRECTORIES*
@node *darwin-framework-directories*
@unnumberedsec *darwin-framework-directories*
@subheading Syntax
@Variable{*darwin-framework-directories*}
@subheading Value type
A list, in which each element is a string, a pathname, or a simple
Lisp expression.
@subheading Initial value
A list containing the following, in order: an expression corresponding
to Darwin path @file{~/Library/Frameworks/},
@code{#P"/Library/Frameworks/"}, and
@code{#P"/System/Library/Frameworks/"}.
@subheading Description
The meaning of ``simple Lisp expression'' is explained in
@ref{*foreign-library-directories*}. In contrast to that variable,
this is not a fallback search path; the default value described above
is intended to be a reasonably complete search path on Darwin systems.
@subheading Examples
@lisp
CFFI> (load-foreign-library '(:framework "OpenGL"))
@result{} #P"/System/Library/Frameworks/OpenGL.framework/OpenGL"
@end lisp
@subheading See also
@seealso{*foreign-library-directories*} @*
@seealso{define-foreign-library}
@c ===================================================================
@c DEFINE-FOREIGN-LIBRARY
@node define-foreign-library
@unnumberedsec define-foreign-library
@subheading Syntax
@Macro{define-foreign-library name-and-options @{ load-clause @}* @res{} name}
name-and-options ::= name | (name &key calling-convention cconv)
load-clause ::= (feature library &key calling-convention cconv)
@subheading Arguments and Values
@table @var
@item name
A symbol.
@item feature
A feature expression.
@item library
A library designator.
@item calling-convention
@itemx cconv
One of @code{:cdecl} (default) or @code{:stdcall}
@end table
@subheading Description
Creates a new library designator called @var{name}. The
@var{load-clause}s describe how to load that designator when passed to
@code{load-foreign-library} or @code{use-foreign-library}.
When trying to load the library @var{name}, the relevant function
searches the @var{load-clause}s in order for the first one where
@var{feature} evaluates to true. That happens for any of the
following situations:
@enumerate 1
@item
If @var{feature} is a symbol present in @code{common-lisp:*features*}.
@item
If @var{feature} is a list, depending on @code{(first @var{feature})},
a keyword:
@table @code
@item :and
All of the feature expressions in @code{(rest @var{feature})} are
true.
@item :or
At least one of the feature expressions in @code{(rest @var{feature})}
is true.
@item :not
The feature expression @code{(second @var{feature})} is not true.
@end table
@item
Finally, if @var{feature} is @code{t}, this @var{load-clause} is
picked unconditionally.
@end enumerate
Upon finding the first true @var{feature}, the library loader then
loads the @var{library}. The meaning of ``library designator'' is
described in @ref{load-foreign-library}.
Functions associated to a library defined by
@code{define-foreign-library} (e.g. through @code{defcfun}'s
@code{:library} option, will inherit the library's options. The
precedence is as follows:
@enumerate 1
@item
@code{defcfun}/@code{foreign-funcall} specific options;
@item
@var{load-clause} options;
@item
global library options (the @var{name-and-options} argument)
@end enumerate
@subheading Examples
@xref{Tutorial-Loading,, Loading foreign libraries}.
@subheading See Also
@seealso{close-foreign-library} @*
@seealso{load-foreign-library}
@c ===================================================================
@c *FOREIGN-LIBRARY-DIRECTORIES*
@node *foreign-library-directories*
@unnumberedsec *foreign-library-directories*
@subheading Syntax
@Variable{*foreign-library-directories*}
@subheading Value type
A list, in which each element is a string, a pathname, or a simple
Lisp expression.
@subheading Initial value
The empty list.
@subheading Description
You should not have to use this variable.
Most, if not all, Lisps supported by @cffi{} have a reasonable default
search algorithm for foreign libraries. For example, Lisps for
@sc{unix} usually call
@uref{http://www.opengroup.org/onlinepubs/009695399/functions/dlopen.html,,
@code{dlopen(3)}}, which in turn looks in the system library
directories. Only if that fails does @cffi{} look for the named
library file in these directories, and load it from there if found.
Thus, this is intended to be a @cffi{}-only fallback to the library
search configuration provided by your operating system. For example,
if you distribute a foreign library with your Lisp package, you can
add the library's containing directory to this list and portably
expect @cffi{} to find it.
A @dfn{simple Lisp expression} is intended to provide functionality
commonly used in search paths such as
@acronym{ASDF}'s@footnote{@xref{Using asdf to load systems,,, asdf,
asdf: another system definition facility}, for information on
@code{asdf:*central-registry*}.}, and is defined recursively as
follows:@footnote{See @code{mini-eval} in @file{libraries.lisp} for
the source of this definition. As is always the case with a Lisp
@code{eval}, it's easier to understand the Lisp definition than the
english.}
@enumerate
@item
A list, whose @samp{first} is a function designator, and whose
@samp{rest} is a list of simple Lisp expressions to be evaluated and
passed to the so-designated function. The result is the result of the
function call.
@item
A symbol, whose result is its symbol value.
@item
Anything else evaluates to itself.
@end enumerate
@subheading Examples
@example
$ ls
@print{} liblibli.so libli.lisp
@end example
@noindent
In @file{libli.lisp}:
@lisp
(pushnew #P"/home/sirian/lisp/libli/" *foreign-library-directories*
:test #'equal)
(load-foreign-library '(:default "liblibli"))
@end lisp
@noindent
The following example would achieve the same effect:
@lisp
(pushnew '(merge-pathnames #p"lisp/libli/" (user-homedir-pathname))
*foreign-library-directories*
:test #'equal)
@result{} ((MERGE-PATHNAMES #P"lisp/libli/" (USER-HOMEDIR-PATHNAME)))
(load-foreign-library '(:default "liblibli"))
@end lisp
@subheading See also
@seealso{*darwin-framework-directories*} @*
@seealso{define-foreign-library}
@c ===================================================================
@c LOAD-FOREIGN-LIBRARY
@node load-foreign-library
@unnumberedsec load-foreign-library
@subheading Syntax
@Function{load-foreign-library library @res{} handler}
@subheading Arguments and Values
@table @var
@item library
A library designator.
@item handler
An instance of @code{foreign-library}.
@end table
@subheading Description
Load the library indicated by @var{library}. A @dfn{library
designator} is defined as follows:
@enumerate
@item
If a symbol, is considered a name previously defined with
@code{define-foreign-library}.
@item
If a string or pathname, passed as a namestring directly to the
implementation's foreign library loader. If that fails, search the
directories in @code{*foreign-library-directories*} with
@code{cl:probe-file}; if found, the absolute path is passed to the
implementation's loader.
@item
If a list, the meaning depends on @code{(first @var{library})}:
@table @code
@item :framework
The second list element is taken to be a Darwin framework name, which
is then searched in @code{*darwin-framework-directories*}, and loaded
when found.
@item :or
Each remaining list element, itself a library designator, is loaded in
order, until one succeeds.
@item :default
The name is transformed according to the platform's naming convention
to shared libraries, and the resultant string is loaded as a library
designator. For example, on @sc{unix}, the name is suffixed with
@file{.so}.
@end table
@end enumerate
If the load fails, signal a @code{load-foreign-library-error}.
@strong{Please note:} For system libraries, you should not need to
specify the directory containing the library. Each operating system
has its own idea of a default search path, and you should rely on it
when it is reasonable.
@subheading Implementation-specific Notes
On ECL platforms where its dynamic FFI is not supported (ie. when
@code{:dffi} is not present in @code{*features*}),
@code{cffi:load-foreign-library} does not work and you must use ECL's
own @code{ffi:load-foreign-library} with a constant string argument.
@subheading Examples
@xref{Tutorial-Loading,, Loading foreign libraries}.
@subheading See Also
@seealso{close-foreign-library} @*
@seealso{*darwin-framework-directories*} @*
@seealso{define-foreign-library} @*
@seealso{*foreign-library-directories*} @*
@seealso{load-foreign-library-error} @*
@seealso{use-foreign-library}
@c ===================================================================
@c LOAD-FOREIGN-LIBRARY-ERROR
@node load-foreign-library-error
@unnumberedsec load-foreign-library-error
@subheading Syntax
@Condition{load-foreign-library-error}
@subheading Class precedence list
@code{load-foreign-library-error}, @code{error},
@code{serious-condition}, @code{condition}, @code{t}
@subheading Description
Signalled when a foreign library load completely fails. The exact
meaning of this varies depending on the real conditions at work, but
almost universally, the implementation's error message is useless.
However, @cffi{} does provide the useful restarts @code{retry} and
@code{use-value}; invoke the @code{retry} restart to try loading the
foreign library again, or the @code{use-value} restart to try loading
a different foreign library designator.
@subheading See also
@seealso{load-foreign-library}
@c ===================================================================
@c USE-FOREIGN-LIBRARY
@node use-foreign-library
@unnumberedsec use-foreign-library
@subheading Syntax
@Macro{use-foreign-library name}
@subheading Arguments and values
@table @var
@item name
A library designator; unevaluated.
@end table
@subheading Description
@xref{load-foreign-library}, for the meaning of ``library
designator''. This is intended to be the top-level form used
idiomatically after a @code{define-foreign-library} form to go ahead
and load the library. @c ; it also sets the ``current foreign library''.
Finally, on implementations where the regular evaluation rule is
insufficient for foreign library loading, it loads it at the required
time.@footnote{Namely, @acronym{CMUCL}. See
@code{use-foreign-library} in @file{libraries.lisp} for details.}
@c current foreign library is a concept created a few hours ago as of
@c this writing. It is not actually used yet, but probably will be.
@subheading Examples
@xref{Tutorial-Loading,, Loading foreign libraries}.
@subheading See also
@seealso{load-foreign-library}
@c ===================================================================
@c CHAPTER: Callbacks
@node Callbacks
@chapter Callbacks
@menu
Dictionary
* callback::
* defcallback::
* get-callback::
@end menu
@c ===================================================================
@c CALLBACK
@node callback
@unnumberedsec callback
@subheading Syntax
@Macro{callback symbol @res{} pointer}
@subheading Arguments and Values
@table @var
@item symbol
A symbol denoting a callback.
@item pointer
@itemx new-value
A pointer.
@end table
@subheading Description
The @code{callback} macro is analogous to the standard CL special
operator @code{function} and will return a pointer to the callback
denoted by the symbol @var{name}.
@subheading Examples
@lisp
CFFI> (defcallback sum :int ((a :int) (b :int))
(+ a b))
@result{} SUM
CFFI> (callback sum)
@result{} #<A Mac Pointer #x102350>
@end lisp
@subheading See Also
@seealso{get-callback} @*
@seealso{defcallback}
@c ===================================================================
@c DEFCALLBACK
@node defcallback
@unnumberedsec defcallback
@subheading Syntax
@Macro{defcallback name-and-options return-type arguments &body body @res{} name}
name-and-options ::= name | (name &key calling-convention cconv)
arguments ::= (@{ (arg-name arg-type) @}*)
@subheading Arguments and Values
@table @var
@item name
A symbol naming the callback created.
@item return-type
The foreign type for the callback's return value.
@item arg-name
A symbol.
@item arg-type
A foreign type.
@item calling-convention
@itemx cconv
One of @code{:cdecl} (default) or @code{:stdcall}.
@end table
@subheading Description
The macro @code{defcallback} defines a Lisp function the can be called
from C (but not from Lisp). The arguments passed to this function will
be converted to the appropriate Lisp representation and its return
value will be converted to its C representation.
This Lisp function can be accessed by the @code{callback} macro or the
@code{get-callback} function.
@strong{Portability note:} @code{defcallback} will not work correctly
on some Lisps if it's not a top-level form.
@subheading Examples
@lisp
(defcfun "qsort" :void
(base :pointer)
(nmemb :int)
(size :int)
(fun-compar :pointer))
(defcallback < :int ((a :pointer) (b :pointer))
(let ((x (mem-ref a :int))
(y (mem-ref b :int)))
(cond ((> x y) 1)
((< x y) -1)
(t 0))))
CFFI> (with-foreign-object (array :int 10)
;; @lispcmt{Initialize array.}
(loop for i from 0 and n in '(7 2 10 4 3 5 1 6 9 8)
do (setf (mem-aref array :int i) n))
;; @lispcmt{Sort it.}
(qsort array 10 (foreign-type-size :int) (callback <))
;; @lispcmt{Return it as a list.}
(loop for i from 0 below 10
collect (mem-aref array :int i)))
@result{} (1 2 3 4 5 6 7 8 9 10)
@end lisp
@subheading See Also
@seealso{callback} @*
@seealso{get-callback}
@c ===================================================================
@c GET-CALLBACK
@node get-callback
@unnumberedsec get-callback
@subheading Syntax
@Accessor{get-callback symbol @res{} pointer}
@subheading Arguments and Values
@table @var
@item symbol
A symbol denoting a callback.
@item pointer
A pointer.
@end table
@subheading Description
This is the functional version of the @code{callback} macro. It
returns a pointer to the callback named by @var{symbol} suitable, for
example, to pass as arguments to foreign functions.
@subheading Examples
@lisp
CFFI> (defcallback sum :int ((a :int) (b :int))
(+ a b))
@result{} SUM
CFFI> (get-callback 'sum)
@result{} #<A Mac Pointer #x102350>
@end lisp
@subheading See Also
@seealso{callback} @*
@seealso{defcallback}
@c ===================================================================
@c CHAPTER: The Groveller
@node The Groveller
@chapter The Groveller
@c Manual and software copyright @copyright{} 2005, 2006 Matthew Backes
@c <lucca@@accela.net> and Dan Knapp <dankna@@accela.net>.
@cffi{}-Grovel is a tool which makes it easier to write @cffi{}
declarations for libraries that are implemented in C. That is, it
grovels through the system headers, getting information about types
and structures, so you don't have to. This is especially important
for libraries which are implemented in different ways by different
vendors, such as the @sc{unix}/@sc{posix} functions. The @cffi{}
declarations are usually quite different from platform to platform,
but the information you give to @cffi{}-Grovel is the same. Hence,
much less work is required!
If you use @acronym{ASDF}, @cffi{}-Grovel is integrated, so that it
will run automatically when your system is building. This feature was
inspired by SB-Grovel, a similar @acronym{SBCL}-specific project.
@cffi{}-Grovel can also be used without @acronym{ASDF}.
@section Building FFIs with CFFI-Grovel
@cffi{}-Grovel uses a specification file (*.lisp) describing the
features that need groveling. The C compiler is used to retrieve this
data and write a Lisp file (*.cffi.lisp) which contains the necessary
@cffi{} definitions to access the variables, structures, constants, and
enums mentioned in the specification.
@c This is most similar to the SB-Grovel package, upon which it is
@c based. Unlike SB-Grovel, we do not currently support defining
@c regular foreign functions in the specification file; those are best
@c defined in normal Lisp code.
@cffi{}-Grovel provides an @acronym{ASDF} component for handling the
necessary calls to the C compiler and resulting file management.
@c See the included CFFI-Unix package for an example of how to
@c integrate a specification file with ASDF-built packages.
@menu
* Groveller Syntax:: How grovel files should look like.
* Groveller ASDF Integration:: ASDF components for grovel files.
* Groveller Implementation Notes:: Implementation notes.
@end menu
@node Groveller Syntax
@section Specification File Syntax
The specification files are read by the normal Lisp reader, so they
have syntax very similar to normal Lisp code. In particular,
semicolon-comments and reader-macros will work as expected.
There are several forms recognized by @cffi{}-Grovel:
@deffn {Grovel Form} progn &rest forms
Processes a list of forms. Useful for conditionalizing several
forms. For example:
@end deffn
@lisp
#+freebsd
(progn
(constant (ev-enable "EV_ENABLE"))
(constant (ev-disable "EV_DISABLE")))
@end lisp
@deffn {Grovel Form} include &rest files
Include the specified files (specified as strings) in the generated C
source code.
@end deffn
@deffn {Grovel Form} in-package symbol
Set the package to be used for the final Lisp output.
@end deffn
@deffn {Grovel Form} ctype lisp-name size-designator
Define a @cffi{} foreign type for the string in @var{size-designator},
e.g. @code{(ctype :pid "pid_t")}.
@end deffn
@deffn {Grovel Form} constant (lisp-name &rest c-names) &key documentation optional
Search for the constant named by the first @var{c-name} string found
to be known to the C preprocessor and define it as @var{lisp-name}.
If optional is true, no error will be raised if all the @var{c-names}
are unknown. If @var{lisp-name} is a keyword, the actual constant
will be a symbol of the same name interned in the current package.
@end deffn
@deffn {Grovel Form} define name &optional value
Defines an additional C preprocessor symbol, which is useful for
altering the behavior of included system headers.
@end deffn
@deffn {Grovel Form} flag flag-string
Adds @var{flag-string} to the flags used for the C compiler
invocation.
@end deffn
@deffn {Grovel Form} cstruct lisp-name c-name slots
Define a @cffi{} foreign struct with the slot data specfied. Slots
are of the form @code{(lisp-name c-name &key type count (signed t))}.
@end deffn
@deffn {Grovel Form} cunion lisp-name c-name slots
Identical to @code{cstruct}, but defines a @cffi{} foreign union.
@end deffn
@deffn {Grovel Form} cstruct-and-class c-name slots
Defines a @cffi{} foreign struct, as with @code{cstruct} and defines a
@acronym{CLOS} class to be used with it. This is useful for mapping
foreign structures to application-layer code that shouldn't need to
worry about memory allocation issues.
@end deffn
@deffn {Grovel Form} cvar namespec type &key read-only
Defines a foreign variable of the specified type, even if that
variable is potentially a C preprocessor pseudo-variable. e.g.
@code{(cvar ("errno" errno) errno-values)}, assuming that errno-values
is an enum or equivalent to type @code{:int}.
The @var{namespec} is similar to the one used in @ref{defcvar}.
@end deffn
@deffn {Grovel Form} cenum name-and-opts &rest elements
Defines a true C enum, with elements specified as @code{((lisp-name
&rest c-names) &key optional documentation)}.
@var{name-and-opts} can be either a symbol as name, or a list
@code{(name &key base-type define-constants)}. If @var{define-constants}
is non-null, a Lisp constant will be defined for each enum member.
@end deffn
@deffn {Grovel Form} constantenum name-and-opts &rest elements
Defines an enumeration of pre-processor constants, with elements
specified as @code{((lisp-name &rest c-names) &key optional
documentation)}.
@var{name-and-opts} can be either a symbol as name, or a list
@code{(name &key base-type define-constants)}. If @var{define-constants}
is non-null, a Lisp constant will be defined for each enum member.
This example defines @code{:af-inet} to represent the value held by
@code{AF_INET} or @code{PF_INET}, whichever the pre-processor finds
first. Similarly for @code{:af-packet}, but no error will be
signalled if the platform supports neither @code{AF_PACKET} nor
@code{PF_PACKET}.
@end deffn
@lisp
(constantenum address-family
((:af-inet "AF_INET" "PF_INET")
:documentation "IPv4 Protocol family")
((:af-local "AF_UNIX" "AF_LOCAL" "PF_UNIX" "PF_LOCAL")
:documentation "File domain sockets")
((:af-inet6 "AF_INET6" "PF_INET6")
:documentation "IPv6 Protocol family")
((:af-packet "AF_PACKET" "PF_PACKET")
:documentation "Raw packet access"
:optional t))
@end lisp
@c ===================================================================
@c SECTION: Groveller ASDF Integration
@node Groveller ASDF Integration
@section ASDF Integration
An example software project might contain four files; an
@acronym{ASDF} file, a package definition file, an implementation
file, and a @cffi{}-Grovel specification file.
The @acronym{ASDF} file defines the system and its dependencies.
Notice the use of @code{eval-when} to ensure @cffi{}-Grovel is present
and the use of @code{(cffi-grovel:grovel-file name &key cc-flags)}
instead of @code{(:file name)}.
@lisp
;;; CFFI-Grovel is needed for processing grovel-file components
(cl:eval-when (:load-toplevel :execute)
(asdf:operate 'asdf:load-op 'cffi-grovel))
(asdf:defsystem example-software
:depends-on (cffi)
:serial t
:components
((:file "package")
(cffi-grovel:grovel-file "example-grovelling")
(:file "example")))
@end lisp
The ``package.lisp'' file would contain several @code{defpackage}
forms, to remove circular dependencies and make building the project
easier. Note that you may or may not want to @code{:use} your
internal package.
@impnote{Mention that it's a not a good idea to :USE when names may
clash with, say, CL symbols.}
@lisp
(defpackage #:example-internal
(:use)
(:nicknames #:exampleint))
(defpackage #:example-software
(:export ...)
(:use #:cl #:cffi #:exampleint))
@end lisp
The internal package is created by Lisp code output from the C program
written by @cffi{}-Grovel; if your specification file is
exampleint.lisp, the exampleint.cffi.lisp file will contain the
@cffi{} definitions needed by the rest of your project.
@xref{Groveller Syntax}.
@node Groveller Implementation Notes
@section Implementation Notes
@impnote{This info might not be up-to-date.}
For @code{foo-internal.lisp}, the resulting @code{foo-internal.c},
@code{foo-internal}, and @code{foo-internal.cffi.lisp} are all
platform-specific, either because of possible reader-macros in
foo-internal.lisp, or because of varying C environments on the host
system. For this reason, it is not helpful to distribute any of those
files; end users building @cffi{}-Grovel based software will need
@code{cffi}-Grovel anyway.
If you build with multiple architectures in the same directory
(e.g. with NFS/AFS home directories), it is critical to remove these
generated files or the resulting constants will be very incorrect.
@impnote{Maybe we should tag the generated names with something host
or OS-specific?}
@impnote{For now, after some experimentation with @sc{clisp} having no
long-long, it seems appropriate to assert that the generated @code{.c}
files are architecture and operating-system dependent, but
lisp-implementation independent. This way the same @code{.c} file
(and so the same @code{.grovel-tmp.lisp} file) will be shareable
between the implementations running on a given system.}
@c TODO: document the new wrapper stuff.
@c ===================================================================
@c CHAPTER: Limitations
@node Limitations
@chapter Limitations
These are @cffi{}'s limitations across all platforms; for information
on the warts on particular Lisp implementations, see
@ref{Implementation Support}.
@itemize @bullet
@item
The tutorial includes a treatment of the primary, intractable
limitation of @cffi{}, or any @acronym{FFI}: that the abstractions
commonly used by C are insufficiently expressive.
@xref{Tutorial-Abstraction,, Breaking the abstraction}, for more
details.
@item
C @code{struct}s cannot be passed by value.
@end itemize
@node Platform-specific features
@appendix Platform-specific features
Whenever a backend doesn't support one of @cffi{}'s features, a
specific symbol is pushed onto @code{common-lisp:*features*}. The
meanings of these symbols follow.
@table @var
@item cffi-sys::flat-namespace
This Lisp has a flat namespace for foreign symbols meaning that you
won't be able to load two different libraries with homograph functions
and successfully differentiate them through the @code{:library}
option to @code{defcfun}, @code{defcvar}, etc@dots{}
@item cffi-sys::no-foreign-funcall
The macro @code{foreign-funcall} is @strong{not} available. On such
platforms, the only way to call a foreign function is through
@code{defcfun}. @xref{foreign-funcall}, and @ref{defcfun}.
@item cffi-sys::no-long-long
The C @code{long long} type is @strong{not} available as a foreign
type.
@item cffi-sys::no-stdcall
This Lisp doesn't support the @code{stdcall} calling convention. Note
that it only makes sense to support @code{stdcall} on (32-bit) x86
platforms.
@end table
@node Glossary
@appendix Glossary
@table @dfn
@item aggregate type
A @cffi{} type for C data defined as an organization of data of simple
type; in structures and unions, which are themselves aggregate types,
they are represented by value.
@item foreign value
This has two meanings; in any context, only one makes sense.
When using type translators, the foreign value is the lower-level Lisp
value derived from the object passed to @code{translate-to-foreign}
(@pxref{translate-to-foreign}). This value should be a Lisp number or
a pointer (satisfies @code{pointerp}), and it can be treated like any
general Lisp object; it only completes the transformation to a true
foreign value when passed through low-level code in the Lisp
implementation, such as the foreign function caller or indirect memory
addressing combined with a data move.
In other contexts, this refers to a value accessible by C, but which
may only be accessed through @cffi{} functions. The closest you can
get to such a foreign value is through a pointer Lisp object, which
itself counts as a foreign value in only the previous sense.
@item simple type
A @cffi{} type that is ultimately represented as a builtin type;
@cffi{} only provides extra semantics for Lisp that are invisible to C
code or data.
@end table
@node Comprehensive Index
@unnumbered Index
@printindex cp
@bye
| 189,690 | Common Lisp | .l | 4,837 | 37.068431 | 93 | 0.743949 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 44edca898aef69957a5d37876c565f0f367aee5202c50bdf80ca377e9f437bab | 21,959 | [
-1
] |
21,960 | Makefile | rheaplex_minara/lib/cffi/doc/Makefile | # -*- Mode: Makefile; tab-width: 3; indent-tabs-mode: t -*-
#
# Makefile --- Make targets for generating the documentation.
#
# Copyright (C) 2005-2007, Luis Oliveira <[email protected]>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use, copy,
# modify, merge, publish, distribute, sublicense, and/or sell copies
# of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
all: manual spec
manual: cffi-manual.texinfo style.css
sh gendocs.sh -o manual --html "--css-include=style.css" cffi-manual "CFFI User Manual"
spec: cffi-sys-spec.texinfo style.css
sh gendocs.sh -o spec --html "--css-include=style.css" cffi-sys-spec "CFFI-SYS Interface Specification"
clean:
find . \( -name "*.info" -o -name "*.aux" -o -name "*.cp" -o -name "*.fn" -o -name "*.fns" -o -name "*.ky" -o -name "*.log" -o -name "*.pg" -o -name "*.toc" -o -name "*.tp" -o -name "*.vr" -o -name "*.dvi" -o -name "*.cps" -o -name "*.vrs" \) -exec rm {} \;
rm -rf manual spec
upload-docs: manual spec
rsync -av --delete -e ssh manual spec common-lisp.net:/project/cffi/public_html/
# scp -r manual spec common-lisp.net:/project/cffi/public_html/
# vim: ft=make ts=3 noet
| 2,035 | Common Lisp | .l | 38 | 52.263158 | 258 | 0.732295 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | bb5d493c949295428c327bb40138c034d74ef167a9bab687ad53564d3b580d07 | 21,960 | [
-1
] |
21,966 | release.sh | rheaplex_minara/lib/cffi/scripts/release.sh | #!/bin/bash
### Configuration
PROJECT_NAME='cffi'
ASDF_FILE="$PROJECT_NAME.asd"
HOST="common-lisp.net"
RELEASE_DIR="/project/$PROJECT_NAME/public_html/releases"
VERSION_FILE="VERSION"
VERSION_FILE_DIR="/project/$PROJECT_NAME/public_html"
set -e
### Process options
FORCE=0
VERSION=""
while [ $# -gt 0 ]; do
case "$1" in
-h|--help)
echo "No help, sorry. Read the source."
exit 0
;;
-f|--force)
FORCE=1
shift
;;
-v|--version)
VERSION="$2"
shift 2
;;
*)
echo "Unrecognized argument '$1'"
exit 1
;;
esac
done
### Check for unrecorded changes
if darcs whatsnew; then
echo -n "Unrecorded changes. "
if [ "$FORCE" -ne 1 ]; then
echo "Aborting."
echo "Use -f or --force if you want to make a release anyway."
exit 1
else
echo "Continuing anyway."
fi
fi
### Determine new version number
if [ -z "$VERSION" ]; then
CURRENT_VERSION=$(grep :version $ASDF_FILE | cut -d\" -f2)
dots=$(echo "$CURRENT_VERSION" | tr -cd '.')
count=$(expr length "$dots" + 1)
declare -a versions
for i in $(seq $count); do
new=""
for j in $(seq $(expr $i - 1)); do
p=$(echo "$CURRENT_VERSION" | cut -d. -f$j)
new="$new$p."
done
part=$(expr 1 + $(echo "$CURRENT_VERSION" | cut -d. -f$i))
new="$new$part"
for j in $(seq $(expr $i + 1) $count); do new="$new.0"; done
versions[$i]=$new
done
while true; do
echo "Current version is $CURRENT_VERSION. Which will be next one?"
for i in $(seq $count); do echo " $i) ${versions[$i]}"; done
echo -n "? "
read choice
if ((choice > 0)) && ((choice <= ${#versions[@]})); then
VERSION=${versions[$choice]}
break
fi
done
fi
### Do it
TARBALL_NAME="${PROJECT_NAME}_${VERSION}"
TARBALL="$TARBALL_NAME.tar.gz"
SIGNATURE="$TARBALL.asc"
echo "Updating $ASDF_FILE with new version: $VERSION"
sed -e "s/:version \"$CURRENT_VERSION\"/:version \"$VERSION\"/" \
"$ASDF_FILE" > "$ASDF_FILE.tmp"
mv "$ASDF_FILE.tmp" "$ASDF_FILE"
darcs record -m "update $ASDF_FILE for version $VERSION"
echo "Tagging the tree..."
darcs tag "$VERSION"
echo "Creating distribution..."
darcs dist -d "$TARBALL_NAME"
echo "Signing tarball..."
gpg -b -a "$TARBALL"
echo "Copying tarball to web server..."
scp "$TARBALL" "$SIGNATURE" "$HOST:$RELEASE_DIR"
echo "Uploaded $TARBALL and $SIGNATURE."
echo "Updating ${PROJECT_NAME}_latest links..."
ssh $HOST ln -sf "$TARBALL" "$RELEASE_DIR/${PROJECT_NAME}_latest.tar.gz"
ssh $HOST ln -sf "$SIGNATURE" "$RELEASE_DIR/${PROJECT_NAME}_latest.tar.gz.asc"
if [ "$VERSION_FILE" ]; then
echo "Uploading $VERSION_FILE..."
echo -n "$VERSION" > "$VERSION_FILE"
scp "$VERSION_FILE" "$HOST":"$VERSION_FILE_DIR"
rm "$VERSION_FILE"
fi
while true; do
echo -n "Clean local tarball and signature? [y] "
read -n 1 response
case "$response" in
y|'')
echo
rm "$TARBALL" "$SIGNATURE"
break
;;
n)
break
;;
*)
echo "Invalid response '$response'. Try again."
;;
esac
done
echo "Building and uploading documentation..."
make -C doc upload-docs
echo "Pushing changes..."
darcs push
| 3,470 | Common Lisp | .l | 119 | 23.12605 | 78 | 0.575211 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 8590cda5a8c865df278bc127f50de38ab0554fb3b7ff694f057d152bb11af99b | 21,966 | [
-1
] |
21,980 | expt-mod.html | rheaplex_minara/lib/cl-utilities/doc/expt-mod.html | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<TITLE>Function EXPT-MOD</TITLE>
<LINK REL="stylesheet" HREF="style.css" type="text/css">
</HEAD>
<BODY>
<p><p><i>Function</i> <b>EXPT-MOD</b></a></a> <p>
<p><b>Syntax:</b><p>
<p><b>expt-mod</b> <i>n exponent divisor</i> => <i>result</i>
<p>
<p><b>Arguments and Values:</b><p>
<p>
<i>n</i>---a <i>number</i></a>. <p>
<i>exponent</i>---a <i>number</i></a>. <p>
<i>divisor</i>---a <i>number</i></a>. <p>
<i>result</i>---a <i>number</i></a>. <p>
<p>
<p><b>Description:</b><p>
<p>
<b>expt-mod</b> returns <i>n</i> raised to the <i>exponent</i> power,
modulo <i>divisor</i>. <tt>(expt-mod n exponent divisor)</tt> is
equivalent to <tt>(mod (expt n exponent) divisor)</tt>.
<p>
<p><b>Exceptional situations:</b><p>
<p>
<p>The exceptional situations are the same as those for <tt>(mod (expt
n exponent) divisor)</tt>.
<p><p><b>Notes:</b></p>
<p>One might wonder why we shouldn't simply write <tt>(mod (expt n
exponent) divisor)</tt>. This function exists because the naïve
way of evaluating <tt>(mod (expt n exponent) divisor)</tt> produces a
gigantic intermediate result, which kills performance in applications
which use this operation heavily. The operation can be done much more
efficiently. Usually the compiler does this optimization
automatically, producing very fast code. However, we can't
<i>depend</i> on this behavior if we want to produce code that is
guaranteed not to perform abysmally on some Lisp implementations.
<p>Therefore cl-utilities provides a standard interface to this
composite operation which uses mediocre code by default. Specific
implementations can usually do much better, but some do much
worse. We can get the best of both by simply using the same interface
and doing read-time conditionalization within cl-utilities to get
better performance on compilers like SBCL and Allegro CL which
optimize this operation.
<p class="footer"><hr><a href="index.html">Manual Index</a></p>
</body></html>
| 2,046 | Common Lisp | .l | 47 | 42.170213 | 90 | 0.719033 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 26d9f156e806f17e418f2b9ee7f6c7c1bc0abbae06341ba50ff217ddb2b1f026 | 21,980 | [
-1
] |
21,981 | rotate-byte.html | rheaplex_minara/lib/cl-utilities/doc/rotate-byte.html | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<TITLE>Function ROTATE-BYTE</TITLE>
<LINK REL="stylesheet" HREF="style.css" type="text/css">
</HEAD>
<BODY>
<p><p><i>Function</i> <b>ROTATE-BYTE</b></a></a> <p>
<p><b>Syntax:</b><p>
<p>
<p><b>rotate-byte</b> <i>count bytespec integer</i> => <i>result</i>
<p>
<p><b>Arguments and Values:</b><p>
<p>
<i>count</i>---an <i>integer</i></a>. <p>
<i>bytespec</i>---a <i>byte specifier</i></a>. <p>
<i>integer</i>---an <i>integer</i></a>. <p>
<i>result</i>---an <i>integer</i></a>. <p>
<p>
<p><b>Description:</b><p>
<p>Rotates a field of bits within <i>integer</i>; specifically, returns an
integer that contains the bits of <i>integer</i> rotated <i>count</i> times
leftwards within the byte specified by <i>bytespec</i>, and elsewhere
contains the bits of <i>integer</i>.</p>
<p><p><b>Examples:</b></p>
<pre>
(rotate-byte 3 (byte 32 0) 3) => 24
(rotate-byte 3 (byte 5 5) 3) => 3
(rotate-byte 6 (byte 8 0) -3) => -129
</pre>
<p><p><b>Side Effects:</b> None.</p>
<p><p><b>Affected By:</b> None.</p>
<p><p><b>Exceptional Situations:</b> None.</p>
<p><p><b>See Also:</b></p>
<p><a class="hyperspec" href ="
http://www.lispworks.com/documentation/HyperSpec/Body/fun_bytecm_by_yte-position.html"><b>byte</b></a>,
<a class="hyperspec" href ="
http://www.lispworks.com/documentation/HyperSpec/Body/fun_dpb.html"><b>dpb</b></a>, <a
class="hyperspec" href ="
http://www.lispworks.com/documentation/HyperSpec/Body/acc_ldb.html"><b>ldb</b></a>
<p><b>Implementation notes</b>
<p>SBCL provides the sb-rotate-byte extension to do this
efficiently. On SBCL, cl-utilities uses this extension
automatically. On other implementations, portable Common Lisp code is
used instead.
<p class="footer"><hr><a href="index.html">Manual Index</a></p>
</body></html>
| 1,860 | Common Lisp | .l | 47 | 38.106383 | 103 | 0.668524 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 94c345eec841417b5fb5274927e81f4c395efc0d6d744fbc5c9b15394bc5f9a1 | 21,981 | [
-1
] |
21,982 | with-unique-names.html | rheaplex_minara/lib/cl-utilities/doc/with-unique-names.html | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<TITLE>Macro WITH-UNIQUE-NAMES</TITLE>
<LINK REL="stylesheet" HREF="style.css" type="text/css">
</HEAD>
<BODY>
<p><i>Macro</i> <b>WITH-UNIQUE-NAMES</b></p><p><b>Syntax:</b></p><p>
<b>with-unique-names</b> <i>({<i>var</i> | (<i>var</i>
<i>prefix</i>)}<b>*</b>) <i>declaration</i><b>*</b>
<i>form</i><b>*</b></i> => <i><i>result</i><b>*</b></i>
</p><p><b>Arguments and Values:</b></p><p>
<p><i>var</i>---a <a
HREF="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_s.htm#symbol"><i>symbol</i></a>;
not <a
HREF="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_e.htm#evaluate"><i>evaluate</i></a>d.</p>
<p><i>prefix</i>---a <a HREF="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_s.htm#string_designator"><i>string designator</i></a>; not
<a HREF="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_e.htm#evaluate"><i>evaluate</i></a>d. The default is <i>var</i>.</p>
<p><i>declaration</i>---a <a href ="
http://www.lispworks.com/documentation/HyperSpec/Body/sym_declare.html"><b>declare</b></a>
<a
HREF="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_e.htm#expression"><i>expression</i></a>;
not <a
HREF="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_e.htm#evaluate"><i>evaluate</i></a>d.</p>
<p><i>form</i>---a <a HREF="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_f.htm#form"><i>form</i></a>.</p>
<p><i>results</i>---the <a HREF="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_v.htm#value"><i>value</i></a>s
<a HREF="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_r.htm#return"><i>return</i></a>ed by the <i>form</i>s.</p>
</p><p><b>Description:</b></p><p> <a
HREF="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_e.htm#Execute"><i>Execute</i></a>s
a series of <a
HREF="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_f.htm#form"><i>form</i></a>s
with each
<i>var</i> <a HREF="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_b.htm#bound"><i>bound</i></a> to a <a HREF="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_f.htm#fresh"><i>fresh</i></a>,
<a HREF="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_u.htm#uninterned"><i>uninterned</i></a> <a HREF="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_s.htm#symbol"><i>symbol</i></a>. The
<a HREF="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_u.htm#uninterned"><i>uninterned</i></a> <a HREF="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_s.htm#symbol"><i>symbol</i></a> is created as if by
a <a HREF="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_c.htm#call"><i>call</i></a> to <a href =" http://www.lispworks.com/documentation/HyperSpec/Body/fun_gensym.html"><b>gensym</b></a> with the
<a HREF="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_s.htm#string"><i>string</i></a> denoted by <i>prefix</i>---or, if
<i>prefix</i> is not supplied, the <a HREF="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_s.htm#string"><i>string</i></a>
denoted by <i>var</i>---as <a HREF="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_a.htm#argument"><i>argument</i></a>.
<p></p> The <a
HREF="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_v.htm#variable"><i>variable</i></a>
<a
HREF="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_b.htm#binding"><i>binding</i></a>s
created are <a
HREF="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_l.htm#lexical"><i>lexical</i></a>
unless <a
HREF="http://www.lispworks.com/documentation/HyperSpec/Body/dec_specia.htm#special"><b>special</b></a>
<a HREF="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_d.htm#declaration"><i>declaration</i></a>s are specified.
<p></p>
The <a HREF="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_f.htm#form"><i>form</i></a>s are <a HREF="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_e.htm#evaluate"><i>evaluate</i></a>d in order, and
the <a HREF="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_v.htm#value"><i>value</i></a>s of all but the last are discarded (that
is, the body is an <a HREF="http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_i.htm#implicit_progn"><i>implicit progn</i></a>).
</p><p><b>Examples:</b></p><p>
<pre>
(with-unique-names (sym1) sym1) => #:SYM13142
(with-unique-names ((sym1 "SYM1-")) sym1) => #:SYM1-3143
(find-symbol "SYM1-3143") => NIL, NIL
(with-unique-names ((sym #\Q)) sym) => #:Q3144
(with-unique-names ((sym1 :sym1-)) sym1) => #:SYM1-3145
(with-unique-names (sym1) (symbol-package sym1)) => NIL
(with-unique-names (sym8) (eq sym8 sym8)) => T
(with-unique-names (sym9) (set sym9 42) (symbol-value sym9)) => 42
</pre>
</p><p><b>Side Effects:</b></p><p>
Might increment <a href =" http://www.lispworks.com/documentation/HyperSpec/Body/var_stgensym-counterst.html"><b>*gensym-counter*</b></a> once for each
<i>var</i>.
</p><p><b>Affected by:</b></p><p> <a href ="
http://www.lispworks.com/documentation/HyperSpec/Body/var_stgensym-counterst.html"><b>*gensym-counter*</b></a>
</p><p><b>Exceptional Situations:</b></p><p>
None.
</p><p><b>See Also:</b></p><p>
<a href =" http://www.lispworks.com/documentation/HyperSpec/Body/fun_gensym.html"><b>gensym</b></a>, <a href =" http://www.lispworks.com/documentation/HyperSpec/Body/speope_letcm_letst.html"><b>let</b></a></b>
</p>
</p>
<p><b>Notes:</b>
<p>This is an extension of the classic macro <b>with-gensyms</b>. In
fact, cl-utilities also exports <b>with-gensyms</b>, and it can be
used as usual. The exported <b>with-gensyms</b> is actually just an
alias for <b>with-unique-names</b> which gives a warning at
compile-time if the extensions of <b>with-unique-names</b> are used.
<p>You are encouraged to use <b>with-unique-names</b> instead of
<b>with-gensyms</b> because it is a little more flexible and because
it tells what is going on rather than how it works. This is a somewhat
controversial point, so go ahead and use whichever you like if you
have an opinion on it. But if you're a newbie who honestly doesn't
care, please use <b>with-unique-names</b>.
<p class="footer"><hr><a href="index.html">Manual Index</a></p>
</BODY>
</HTML> | 6,708 | Common Lisp | .l | 89 | 70.168539 | 237 | 0.664796 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 79f228f685bf0e8c28d5ff8025c4166eb2272d68b51804ed522c61aeaba0d3fc | 21,982 | [
-1
] |
21,983 | read-delimited.html | rheaplex_minara/lib/cl-utilities/doc/read-delimited.html | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<TITLE>Function READ-DELIMITED</TITLE>
<LINK REL="stylesheet" HREF="style.css" type="text/css">
</HEAD>
<BODY>
<p><p><i>Function</i> <b>READ-DELIMITED</b></p>
<p><p><b>Syntax:</b></p>
<p><p><b>read-delimited</b> <i>sequence stream <tt>&key </tt> start end delimiter test key</i> => <i>position, delimited-p</i></p>
<p><p><b>Arguments and Values:</b></p>
<p><p><i>sequence</i>---a <i>sequence</i>.</p>
<p><i>stream</i>---an <i>input stream</i>.</p>
<p><i>start, end</i>---<i>bounding index designators</i> of
<i>sequence</i>. The defaults for <i>start</i> and <i>end</i> are 0
and <b>nil</b>, respectively.
<p><i>delimiter</i>---a <i>character</i>. It defaults to #\newline.</p>
<p><i>test</i>---a <i>designator</i> for a <i>function</i> of two
<i>arguments</i> that returns a <i>generalized boolean</i>.</p>
<p><i>key</i>---a <i>designator</i> for a <i>function</i> of one
argument, or <b>nil</b>.</p>
<p><i>position</i>---an <i>integer</i> greater than or equal to zero,
and less than or equal to the <i>length</i> of the sequence.</p>
<p><i>delimited-p</i>---the result of the last invokation of <i>test</i></p>
<p><p><b>Description:</b></p>
<p><p>Destructively modifies <i>sequence</i> by replacing
<i>elements</i> of <i>sequence</i> <i>bounded</i> by <i>start</i> and
<i>end</i> with <i>elements</i> read from <i>stream</i>.</p>
<p><p><i>Test</i> is called with the actual read character, converted
by applying <i>key</i> to it, as the first and <i>delimiter</i> as the
second argument.</p>
<p><p>If a character is read for which (funcall <i>test</i> (funcall
<i>key</i> <b>char</b>) <i>delimiter</i>) is non-nil,
<b>read-delimited</b> terminates the copying even before reaching
<i>end of file</i> or the <i>end</i> of the <i>bounding
designator</i>.</p>
<p><p><b>read-delimited</b> returns the index of the first
<i>element</i> of <i>sequence</i> that was not updated as the first
and the result of the last invokation of <i>test</i> as the second
value.</p>
<p><p><i>Sequence</i> is destructively modified by copying successive
<i>elements</i> into it from <i>stream</i>. If the <i>end of file</i>
for <i>stream</i> is reached before copying all <i>elements</i> of the
subsequence, then the extra <i>elements</i> near the end of
<i>sequence</i> are not updated.</p>
<p><b>Exceptional situations:</b>
<p>If <i>start</i> and/or <i>end</i> are out of bounds, or if
<i>start</i> > <i>end</i>, then a
<b>read-delimited-bounds-error</b> error is signalled. This error is
passed the values of <i>start</i>, <i>end</i>, and <i>sequence</i>,
which can be read with <b>read-delimited-bounds-error-start</b>,
<b>read-delimited-bounds-error-end</b>, and
<b>read-delimited-bounds-error-sequence</b>,
respectively.
<p><p><b>Implementation notes:</b></p>
<p>This is one of the more complex utilities, and the amount of
argument checking needed to do it properly is daunting. An amazing 76%
of the code is spent on making sure that the bounds are valid and in
order, and on what to do if they aren't. Once you remove all that, the
actual function which does all the work is quite simple, and unlikely
to contain bugs.</p>
<p>The design of this function makes it a little annoying to use, but
it is more efficient. If you need something more high-level, this
could be built on top of <b>read-delimited</b> fairly easily.</p>
<p class="footer"><hr><a href="index.html">Manual Index</a></p>
</body></html>
| 3,529 | Common Lisp | .l | 66 | 52.075758 | 130 | 0.689916 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 70f5d30fb6a41484ef4e4d0b352c1859f49ee8c5090ad85482443fbd9f7731f1 | 21,983 | [
-1
] |
21,984 | collecting.html | rheaplex_minara/lib/cl-utilities/doc/collecting.html | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<TITLE>Macro COLLECTING, WITH-COLLECTORS</TITLE>
<LINK REL="stylesheet" HREF="style.css" type="text/css">
</HEAD>
<BODY>
<p><p><i>Macro</i> <b>COLLECTING</b></a></a> <p>
<p><b>Syntax:</b><p>
<p>
<p><b>collecting</b> <i>form*</i> => <i>result</i><p>
<p><b>with-collectors</b> <i>(collector*) form*</i> => <i>result</i>*<p>
<p>
<p><b>Arguments and Values:</b><p>
<p>
<i>forms</i>---an <a
href="http://www.lispworks.com/documentation/HyperSpec/Body/glo_i.html#implicit_progn">implicit
progn</a>.
<p><i>collector</i>---a symbol which will have a collection function bound to it.
<p><i>result</i>---a collected list.
<p>
<p><b>Description:</b><p>
<p>
<b>collecting</b> collects things into a list. Within the
body of this macro, the <b>collect</b> function will collect its
argument into <i>result</i>.
<p><b>with-collectors</b> collects some things into lists. The
<i>collector</i> names are defined as local functions which each
collect into a separate list. Returns as many values as there are
collectors, in the order they were given.
<p><b>Exceptional situations:</b><p>
<p>
<p>If the <i>collector</i> names are not all symbols, a
<b>type-error</b> will be signalled.
<p><b>Examples:</b>
<pre>
(collecting (dotimes (x 10) (collect x))) => (0 1 2 3 4 5 6 7 8 9)
(multiple-value-bind (a b)
(with-collectors (x y)
(x 1)
(y 2)
(x 3))
(append a b)) => (1 2 3)
</pre>
<p><p><b>Implementation notes:</b></p>
<p>Opinions differ on how a collection macro should work. There are
two major points for discussion: multiple collection variables and
implementation method.</b>
<p>There are two main ways of implementing collection: sticking
successive elements onto the end of the list with tail-collection, or
using the PUSH/NREVERSE idiom. Tail-collection is usually faster,
except on CLISP, where PUSH/NREVERSE is a little faster because it's
implemented in C which is always faster than Lisp bytecode.</p>
<p>The <b>collecting</b> macro only allows collection into one list,
and you can't nest them to get the same effect as multiple collection
since it always uses the <b>collect</b> function. If you want to
collect into multiple lists, use the <b>with-collect</b> macro.</p>
<p class="footer"><hr><a href="index.html">Manual Index</a></p>
</body></html> | 2,405 | Common Lisp | .l | 59 | 38.881356 | 95 | 0.710288 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 61bd0e8c96cbdb17feb310c9eaf38abb0c099e45b9a4b861a3012694ce79dfc3 | 21,984 | [
-1
] |
21,985 | style.css | rheaplex_minara/lib/cl-utilities/doc/style.css | pre {
margin-right: 0.5cm;
border: thin black solid;
background: #F3EEEE;
padding: 0.5em;
}
h1 {
font-family: sans-serif;
font-variant: small-caps;
}
h2 {
font-family: sans-serif;
font-size: medium;
} | 210 | Common Lisp | .l | 14 | 13.357143 | 26 | 0.723077 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | d49a2ec0a6fb8f623e3d6f5a64df5857c4f91d3556621beb7de9478ede27674b | 21,985 | [
-1
] |
21,986 | split-sequence.html | rheaplex_minara/lib/cl-utilities/doc/split-sequence.html | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<TITLE>Function SPLIT-SEQUENCE, SPLIT-SEQUENCE-IF, SPLIT-SEQUENCE-IF-NOT</TITLE>
<LINK REL="stylesheet" HREF="style.css" type="text/css">
</HEAD>
<BODY>
<p><p><i>Function</i> <b>SPLIT-SEQUENCE, SPLIT-SEQUENCE-IF, SPLIT-SEQUENCE-IF-NOT</b></p>
<p><p><b>Syntax:</b></p>
<p><p><b>split-sequence</b> <i>delimiter sequence <tt>&key</tt> count remove-empty-subseqs from-end start end test test-not key</i> => <i>list, index</i></p>
<p><p><b>split-sequence-if</b> <i>predicate sequence <tt>&key</tt> count remove-empty-subseqs from-end start end key</i> => <i>list, index</i></p>
<p><p><b>split-sequence-if-not</b> <i>predicate sequence <tt>&key</tt> count remove-empty-subseqs from-end start end key</i> => <i>list, index</i></p>
<p><p><b>Arguments and Values:</b></p>
<p><p><i>delimiter</i>---an <i>object</i>.</p>
<p><i>predicate</i>---a <i>designator</i> for a <i>function</i> of one <i>argument</i> that returns a <i>generalized boolean</i>.</p>
<p><i>sequence</i>---a <i>proper sequence</i>.</p>
<p><i>count</i>---an <i>integer</i> or <b>nil</b>. The default is <b>nil</b>.</p>
<p><i>remove-empty-subseqs</i>---a <i>generalized boolean</i>. The default is <i>false</i>.</p>
<p><i>from-end</i>---a <i>generalized boolean</i>. The default is <i>false</i>.</p>
<p><i>start, end</i>---<i>bounding index designators</i> of <i>sequence</i>. The defaults for </i>start</i> and <i>end</i> are <tt>0</tt> and <b>nil</b>, respectively.</p>
<p><i>test</i>---a <i>designator</i> for a <i>function</i> of two <i>arguments</i> that returns a <i>generalized boolean</i>.</p>
<p><i>test-not</i>---a <i>designator</i> for a <i>function</i> of two <i>arguments</i> that returns a <i>generalized boolean</i>.</p>
<p><i>key</i>---a <i>designator</i> for a <i>function</i> of one <i>argument</i>, or <b>nil</b>.</p>
<p><i>list</i>---a <i>proper sequence</i>.</p>
<p><i>index</i>---an <i>integer</i> greater than or equal to zero, and less than or equal to the <i>length</i> of the <i>sequence</i>.</p>
<p><p><b>Description:</b></p>
<p><p>Splits <i>sequence</i> into a list of subsequences delimited by objects <i>satisfying the test</i>.
<p><i>List</i> is a list of sequences of the same kind as <i>sequence</i> that has elements consisting of subsequences of <i>sequence</i> that were delimited in the argument by elements <i>satisfying the test</i>. <i>Index</i> is an index into <i>sequence</i> indicating the unprocessed region, suitable as an argument to <a class="hyperspec" href =" http://www.lispworks.com/documentation/HyperSpec/Body/acc_subseq.html"><b>subseq</b></a> to continue processing in the same manner if desired.
<p>The <i>count</i> argument, if supplied, limits the number of subsequences in the first return value; if more than <i>count</i> delimited subsequences exist in <i>sequence</i>, the <i>count</i> leftmost delimited subsequences will be in order in the first return value, and the second return value will be the index into <i>sequence</i> at which processing stopped.
<p>If <i>from-end</i> is non-null, <i>sequence</i> is conceptually processed from right to left, accumulating the subsequences in reverse order; <i>from-end</i> only makes a difference in the case of a non-null <i>count</i> argument. In the presence of <i>from-end</i>, the <i>count</i> rightmost delimited subsequences will be in the order that they are in <i>sequence</i> in the first return value, and the second is the index indicating the end of the unprocessed region.
<p>The <i>start</i> and <i>end</i> keyword arguments permit a certain subsequence of the <i>sequence</i> to be processed without the need for a copying stage; their use is conceptually equivalent to partitioning the subsequence delimited by <i>start</i> and <i>end</i>, only without the need for copying.
<p>If <i>remove-empty-subseqs</i> is null (the default), then empty subsequences will be included in the result.
<p>In all cases, the subsequences in the first return value will be in the order that they appeared in <i>sequence</i>.
<p><p><b>Examples:</b></p>
<p><pre>
(split-sequence:SPLIT-SEQUENCE #\Space "A stitch in time saves nine.")
=> ("A" "stitch" "in" "time" "saves" "nine.")
28
(split-sequence:SPLIT-SEQUENCE #\, "foo,bar ,baz, foobar , barbaz,")
=> ("foo" "bar " "baz" " foobar " " barbaz" "")
30
</pre>
<p><p><b>Implementation notes:</b></p>
<p>This code was written various people, and the license is
unknown. Since multiple people worked on it collaboratively and none
of them seem interested in keeping their intellectual property rights
to it, I'll assume that it is in the public domain (since the process
that produced it seems like the very essence of public domain). If
this is incorrect, please <a href="mailto:[email protected]">contact
me</a> so we can get it straightened out.</p>
<p>The implementation itself is mature and well tested, and it is
widely used. The code should be fast enough for most people, but be
warned: it was written with vectors in mind, with list manipulation as
an afterthought. It does a lot of things that are quick on vectors but
slow on lists, and this can result in many orders of magnitude
slowdown in list benchmarks versus code written for lists. If this is
a problem for you, it should be straightforward to write your own,
such as the (more limited, not API compatible) example function given
by Szymon in <a
href="http://common-lisp.net/pipermail/cl-utilities-devel/2006-May/000011.html">this
mailing list post</a>:</p>
<p><pre>
(defun split-list-if (test list &aux (start list) (end list))
(loop while (and end (setq start (member-if-not test end)))
collect (ldiff start (setq end (member-if test start)))))
</pre></p>
<p>If this is an issue for enough people, I could optimize the code
and fix this problem. I'm reluctant to do that, however, since the
code works and is tested. It's usually more important to be correct
and non-buggy than to be fast, and I have been known to introduce
bugs.</p>
<p class="footer"><hr><a href="index.html">Manual Index</a></p>
</body></html>
| 6,227 | Common Lisp | .l | 73 | 83.60274 | 499 | 0.70495 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 4ff39bd45ae6a95504cd8a4c5ef8933a5d846eac3aaf4cf3622d3db784839547 | 21,986 | [
-1
] |
21,987 | copy-array.html | rheaplex_minara/lib/cl-utilities/doc/copy-array.html | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<TITLE>Function COPY-ARRAY</TITLE>
<LINK REL="stylesheet" HREF="style.css" type="text/css">
</HEAD>
<BODY>
<p><p><i>Function</i> <b>COPY-ARRAY</b></a></a> <p>
<p><b>Syntax:</b><p>
<p>
<p><b>copy-array</b> <i>array <tt>&key</tt> undisplace</i> => <i>new-array</i>
<p>
<p><b>Arguments and Values:</b><p>
<p>
<i>array</i>---an <i>array</i>. <p>
<i>undisplace</i>---a <i>generalized boolean</i>. The default is <i>false</i>.<p>
<i>new-array</i>---an <i>array</i></a>. <p>
<p>
<p><b>Description:</b><p>
<p>Shallow copies the contents of <i>array</i> into another array with
equivalent properties. If <i>array</i> is displaced, then this
function will normally create another displaced array with similar
properties, unless <i>undisplace</i> is <i>true</i>, in which case the
contents of <i>array</i> will be copied into a completely new, not
displaced, array.</p>
<p><p><b>Examples:</b></p>
<pre>
(copy-array #(1 2 3)) => #(1 2 3)
(let ((array #(1 2 3)))
(eq (copy-array array) array)) => NIL
</pre>
<p><p><b>Side Effects:</b> None.</p>
<p><p><b>Affected By:</b> None.</p>
<p class="footer"><hr><a href="index.html">Manual Index</a></p>
</body></html>
| 1,273 | Common Lisp | .l | 35 | 34.828571 | 90 | 0.644082 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 5a560126c3bfde6a44f78ed0348fa46098ead9b321decb07ba8deec8539746a8 | 21,987 | [
-1
] |
21,988 | extremum.html | rheaplex_minara/lib/cl-utilities/doc/extremum.html | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<TITLE>Function EXTREMUM, EXTREMA, N-MOST-EXTREME</TITLE>
<LINK REL="stylesheet" HREF="style.css" type="text/css">
</HEAD>
<BODY>
<p><p><i>Function</i> <b>EXTREMUM, EXTREMA, N-MOST-EXTREME</b></a></a> <p>
<p><b>Syntax:</b><p>
<p>
<p><b>extremum</b> <i>sequence predicate <tt>&key</tt> key (start 0) end</i> => <i>morally-smallest-element</i><p>
<p><b>extrema</b> <i>sequence predicate <tt>&key</tt> key (start 0) end</i> => <i>morally-smallest-elements</i><p>
<p><b>n-most-extreme</b> <i>n sequence predicate <tt>&key</tt> key (start 0) end</i> => <i>n-smallest-elements</i><p>
<p>
<p><b>Arguments and Values:</b><p>
<p>
<i>sequence</i>---a <i>proper sequence</i></a>. <p>
<i>predicate</i>---a <i>designator</i> for a <i>function</i> of two
arguments that returns a <i>generalized boolean</i>. <p>
<i>key</i>---a <i>designator</i> for a <i>function</i> of one
argument, or <b>nil</b>. <p>
<i>start, end</i>---bounding index designators of <i>sequence</i>. The
defaults for start and end are 0 and <b>nil</b>, respectively.<p>
<i>morally-smallest-element</i>---the element of <i>sequence</i> that
would appear first if the sequence were ordered according to <a
class="hyperspec" href ="
http://www.lispworks.com/documentation/HyperSpec/Body/fun_sortcm_stable-sort.html"><b>sort</b></a>
using <i>predicate</i> and <i>key</i>
<p><i>morally-smallest-elements</i>---the identical elements of
<i>sequence</i> that would appear first if the sequence were ordered
according to <a class="hyperspec" href ="
http://www.lispworks.com/documentation/HyperSpec/Body/fun_sortcm_stable-sort.html"><b>sort</b></a>
using <i>predicate</i> and <i>key</i>. If <i>predicate</i> states that
neither of two objects is before the other, they are considered
identical.
<i>n</i>---a positive integer<p>
<i>n-smallest-elements</i>---the <i>n</i> elements of <i>sequence</i> that
would appear first if the sequence were ordered according to <a
class="hyperspec" href ="
http://www.lispworks.com/documentation/HyperSpec/Body/fun_sortcm_stable-sort.html"><b>sort</b></a>
using <i>predicate</i> and <i>key</i>
<p>
<p><b>Description:</b><p>
<p>
<b>extremum</b> returns the element of <i>sequence</i> that would
appear first if the subsequence of <i>sequence</i> specified by
<i>start</i> and <i>end</i> were ordered according to <a
class="hyperspec" href ="
http://www.lispworks.com/documentation/HyperSpec/Body/fun_sortcm_stable-sort.html"><b>sort</b></a>
using <i>predicate</i> and <i>key</i>.
<p><p><b>extremum</b> determines the relationship between two elements
by giving keys extracted from the elements to the
<i>predicate</i>. The first argument to the <i>predicate</i> function
is the part of one element of <i>sequence</i> extracted by the
<i>key</i> function (if supplied); the second argument is the part of
another element of <i>sequence</i> extracted by the <i>key</i>
function (if supplied). <i>Predicate</i> should return <i>true</i> if
and only if the first argument is strictly less than the second (in
some appropriate sense). If the first argument is greater than or
equal to the second (in the appropriate sense), then the
<i>predicate</i> should return <i>false</i>. <p>
<p>The argument to the <i>key</i> function is the <i>sequence</i>
element. The return value of the <i>key</i> function becomes an
argument to <i>predicate</i>. If <i>key</i> is not supplied or
<b>nil</b>, the <i>sequence</i> element itself is used. There is no
guarantee on the number of times the <i>key</i> will be called. <p>
<p>If the <i>key</i> and <i>predicate</i> always return, then the
operation will always terminate. This is guaranteed even if the
<i>predicate</i> does not really consistently represent a total order
(in which case the answer may be wrong). If the <i>key</i>
consistently returns meaningful keys, and the <i>predicate</i> does
reflect some total ordering criterion on those keys, then the answer
will be right <p>
<p>The <i>predicate</i> is assumed to consider two elements <tt>x</tt>
and <tt>y</tt> to be equal if <tt>(funcall </tt><i>predicate</i><tt>
</tt><i>x</i><tt> </tt><i>y</i><tt>)</tt> and <tt>(funcall
</tt><i>predicate</i><tt> </tt><i>y</i><tt> </tt><i>x</i><tt>)</tt>
are both <i>false</i>.
<p>The return value of <tt>(extremum predicate sequence :key key)</tt>
can be defined as <tt>(elt (<a class="hyperspec" href ="
http://www.lispworks.com/documentation/HyperSpec/Body/fun_sortcm_stable-sort.html"><b>sort</b></a>
predicate (subseq sequence start end) :key key) 0)</tt> except when
<i>sequence</i> is empty (see Exceptional Situations), but may use
faster (less asymptotically complex) algorithms to find this answer.
<p><b>extrema</b> is similar to <b>extremum</b>, but it returns a list
of values. There can be more than one extremum, as determined by
<i>predicate</i>, and with <b>extremum</b> the choice of which
extremum to return is arbitrary. <b>extrema</b> returns all the
possible values which <i>predicate</i> determines to be equal.
<p><b>n-most-extreme</b> returns a list of <i>n</i> values without
testing for equality. It orders <i>sequence</i> in the same way as
<b>extremum</b> and <b>extrema</b>, then returns the first <i>n</i>
elements of the sorted sequence.
<p>
<p><b>Exceptional situations:</b><p>
<p>
<p>If <i>sequence</i> is empty, then the error <i>no-extremum</i> is
signalled. Invoking the <b>continue</b> restart will cause
<b>extremum</b> to return <b>nil</b>.
<p>Should be prepared to signal an error of type <b>type-error</b> if
<i>sequence</i> is not a proper sequence.
<p>If there are fewer than <i>n</i> values in the part of
<i>sequence</i> that <b>n-most-extreme</b> may operate on, it returns
all the values it can in sorted order and signals the warning
<b>n-most-extreme-not-enough-elements</b>. This warning stores the
given values for <i>n</i> and the relevant subsequence, and they may
be accessed with <b>n-most-extreme-not-enough-elements-n</b> and
<b>n-most-extreme-not-enough-elements-subsequence</b>, respectively.
<p><p><b>Implementation notes:</b></p>
<p>There are two implementations of this function included in
cl-utilities, which should only concern you if you want to squeeze out
more efficiency, since the versions perform differently on different
inputs.
<p>The function <b>extremum-fastkey</b> is used exactly like
<b>extremum</b>, but it calls <i>key</i> fewer times. If <i>key</i> is
fast, <b>extremum-fastkey</b> is slower than regular <b>extremum</b>,
but if <i>key</i> is hard to compute you can get significant gains in
speed. The <b>extremum-fastkey</b> function is more complicated than
<b>extremum</b>, and therefore may be more likely to contain
bugs. That said, it doesn't seem buggy.</p>
<p>Don't worry about the performance of passing <tt>#'identity</tt> as
<i>key</i>. This is optimized by a compiler macro.</p>
<p class="footer"><hr><a href="index.html">Manual Index</a></p>
</body></html>
| 7,010 | Common Lisp | .l | 124 | 55.25 | 117 | 0.722684 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 5947746de838c9773dd8747102b5833580d35b364d1d34bc19a4a83bb6b8370c | 21,988 | [
-1
] |
21,989 | once-only.html | rheaplex_minara/lib/cl-utilities/doc/once-only.html | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/transitional.dtd">
<HTML>
<HEAD>
<TITLE>Macro ONCE-ONLY</TITLE>
<LINK REL="stylesheet" HREF="style.css" type="text/css">
</HEAD>
<BODY>
<p><p><i>Macro</i> <b>ONCE-ONLY</b></a></a> <p>
<p><b>Syntax:</b><p>
<p>
<p><b>once-only</b> <i>(name*) form*</i>
<p>
<p><b>Arguments and Values:</b><p>
<p>
<i>name</i>---a <a href="http://www.lispworks.com/documentation/HyperSpec/Body/glo_s.html#symbol"><i>symbol</i></a></a>. <p>
<i>form</i>---a <a href="http://www.lispworks.com/documentation/HyperSpec/Body/glo_f.html#form"><i>form</i></a></a>. <p>
<p>
<p><b>Description:</b><p>
<p>Meant to be used in macro code, <b>once-only</b> guards against
multiple evaluation of its arguments in macroexpansion code. Any
concise description would be far too vague to grasp, but <a
href="http://groups.google.com/group/comp.lang.lisp/browse_frm/thread/1783554653afad7f/f6357129c8c1c002?rnum=1&_done=%2Fgroup%2Fcomp.lang.lisp%2Fbrowse_frm%2Fthread%2F1783554653afad7f%2F940b6ebd2d1757f4%3F#doc_f6357129c8c1c002">this
thread on comp.lang.lisp</a> does a decent job of explaining what
<b>once-only</b> does.
<p><p><b>Notes:</b></p>
<p>The description here is frustratingly non-descriptive, and I
apologize for that. If you understand <b>once-only</b> and can give a
better explanation, I would be very grateful—not to mention
completely awed.
<p class="footer"><hr><a href="index.html">Manual Index</a></p>
</body></html>
| 1,495 | Common Lisp | .l | 31 | 46.806452 | 232 | 0.716151 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | 91f5f056846450d12761956b702e10a2ddd65474d4eea671145c5e60828ebb06 | 21,989 | [
-1
] |
21,990 | compose.html | rheaplex_minara/lib/cl-utilities/doc/compose.html | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<TITLE>Function COMPOSE</TITLE>
<LINK REL="stylesheet" HREF="style.css" type="text/css">
</HEAD>
<BODY>
<p><p><i>Function</i> <b>COMPOSE</b></p>
<p><p><b>Syntax:</b></p>
<p><p><b>compose</b> <i>function* <tt>=></tt> composite-function</i></p>
<p><p><b>Arguments and Values:</b></p>
<p><p><i>function</i>---a <i><a href="http://www.lispworks.com/documentation/HyperSpec/Body/glo_f.html#function_designator">function designator</a></i>.</p>
<p><i>composite-function</i>---a <i>function</i>.
<p><p><b>Description:</b></p>
<p>Composes its arguments into a single composite function. All its
arguments are assumed to designate functions which take one argument
and return one argument.
<p><tt>(funcall (compose f g) 42)</tt> is equivalent to <tt>(f (g
42))</tt>. Composition is right-associative.
<p><b>Examples:</b>
<pre>
;; Just to illustrate order of operations
(defun 2* (x) (* 2 x))
(funcall (compose #'1+ #'1+) 1) => 3
(funcall (compose '1+ '2*) 5) => 11
(funcall (compose #'1+ '2* '1+) 6) => 15
</pre>
<p><b>Notes:</b>
<p>If you're dealing with multiple arguments and return values, the
same concept can be used. Here is some code that could be useful:
<pre>
(defun mv-compose2 (f1 f2)
(lambda (&rest args)
(multiple-value-call f1 (apply f2 args))))
(defun mv-compose (&rest functions)
(if functions
(reduce #'mv-compose2 functions)
#'values))
</pre>
<p class="footer"><hr><a href="index.html">Manual Index</a></p>
</body></html>
| 1,581 | Common Lisp | .l | 41 | 36.512195 | 156 | 0.673254 | rheaplex/minara | 2 | 0 | 0 | GPL-3.0 | 9/19/2024, 11:28:00 AM (Europe/Amsterdam) | f28d612a777b3f62c42d23a2e162893b61feaf156b23cbef4fbfcf80cf6f19b6 | 21,990 | [
-1
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.