1 Using Open GL
2 C-Style Open GL
3 Scheme-Style Open GL
4 Open GL Vectors
5 Bitmaps
Index
On this page:
selection-record
gl-accum
gl-active-texture
gl-alpha-func
gl-begin
gl-begin-query
gl-blend-color
gl-blend-equation
gl-blend-func
gl-blend-func-separate
gl-call-list
gl-check-extension
gl-clear
gl-clear-accum
gl-clear-color
gl-clear-depth
gl-clear-index
gl-clear-stencil
gl-clip-plane
gl-color
gl-color-mask
gl-color-material
gl-color-v
gl-copy-pixels
gl-cull-face
gl-cylinder
gl-delete-lists
gl-delete-queries
gl-depth-func
gl-depth-mask
gl-depth-range
gl-disable
gl-disk
gl-edge-flag
gl-enable
gl-end
gl-end-list
gl-end-query
gl-eval-coord
gl-eval-coord-v
gl-eval-mesh
gl-eval-point
gl-feedback-buffer->gl-float-vector
gl-finish
gl-flush
gl-front-face
gl-frustum
gl-gen-lists
gl-gen-queries
gl-get-error
gl-get-string
gl-hint
gl-index
gl-index-mask
gl-index-v
gl-init-names
gl-is-buffer
gl-is-enabled
gl-is-list
gl-is-query
gl-light
gl-light-model
gl-light-model-v
gl-light-v
gl-line-stipple
gl-line-width
gl-list-base
gl-load-identity
gl-load-matrix
gl-load-name
gl-load-transpose-matrix
gl-look-at
gl-map-grid
gl-material
gl-material-v
gl-matrix-mode
gl-mult-matrix
gl-mult-transpose-matrix
gl-multi-tex-coord
gl-multi-tex-coord-v
gl-new-list
gl-new-quadric
gl-normal
gl-normal-v
gl-ortho
gl-ortho-2d
gl-partial-disk
gl-pass-through
gl-perspective
gl-pick-matrix
gl-pixel-store
gl-point-parameter
gl-point-parameter-v
gl-point-size
gl-polygon-mode
gl-polygon-offset
gl-pop-attrib
gl-pop-client-attrib
gl-pop-matrix
gl-pop-name
gl-process-selection
gl-project
gl-push-matrix
gl-push-name
gl-quadric-draw-style
gl-quadric-normals
gl-quadric-orientation
gl-quadric-texture
gl-raster-pos
gl-raster-pos-v
gl-rect
gl-rect-v
gl-render-mode
gl-rotate
gl-sample-coverage
gl-scale
gl-scissor
gl-secondary-color
gl-secondary-color-v
gl-select-buffer->gl-uint-vector
gl-shade-model
gl-sphere
gl-stencil-func
gl-stencil-mask
gl-stencil-op
gl-tex-coord
gl-tex-coord-v
gl-tex-gen
gl-tex-gen-v
gl-translate
gl-u-get-string
gl-un-project
gl-un-project4
gl-vertex
gl-vertex-v
gl-viewport
gl-window-pos
gl-window-pos-v
process-selection
get-gl-version-number
get-glu-version-number
Version: 4.0.2

 

3 Scheme-Style OpenGL

 (require sgl)

The functions in sgl use Scheme style names instead of C style names. To convert a C OpenGL name to a Scheme OpenGL name, change the gl prefix to gl-, separate adjacent words with hyphens, and convert to all lower case. Functions that have several variants to accommodate different numbers and types of arguments are collapsed into one or two functions in sgl. For example, sgl provides two vertex functions: vertex and vertex-v. The vertex function accepts 2, 3 or 4 numerical arguments, and the vertex-v function accepts gl-vectors of length 2, 3 or 4. The C language OpenGL interface, in contrast, has 24 vertex functions: glVertex3i, glVertex4fv, etc.

Functions in sgl take symbols instead of integers for GLenum arguments. Each function checks that the given symbol is an acceptable argument and raises an exception if it is not. Given the name of a C-language #define constant, determine the corresponding symbolic argument by removing the leading GL_, converting the letters to lower-case and replacing each _ with -. For example, GL_TRIANGLES becomes 'triangles, and GL_TRIANGLE_STRIP becomes 'triangle-strip. Additionally, the functions check the length of any array arguments to ensure that OpenGL does not attempt to write or read after the array.

The sgl module is not as complete as the sgl/gl module.

Examples:

  (require sgl sgl/gl-vectors)

  (gl-begin 'triangles)

  (gl-vertex 1 2 3)

  (gl-vertex-v (gl-float-vector 1 2 3 4))

  (gl-end)

(struct

 

selection-record

 

(min-z max-z stack))

  min-z : real?

  max-z : real?

  stack : ....

Represents a selection.

gl-accum : procedure?

gl-active-texture : procedure?

gl-alpha-func : procedure?

gl-begin : procedure?

gl-begin-query : procedure?

gl-blend-color : procedure?

gl-blend-equation : procedure?

gl-blend-func : procedure?

gl-blend-func-separate : procedure?

gl-call-list : procedure?

gl-check-extension : procedure?

gl-clear : procedure?

gl-clear-accum : procedure?

gl-clear-color : procedure?

gl-clear-depth : procedure?

gl-clear-index : procedure?

gl-clear-stencil : procedure?

gl-clip-plane : procedure?

gl-color : procedure?

gl-color-mask : procedure?

gl-color-material : procedure?

gl-color-v : procedure?

gl-copy-pixels : procedure?

gl-cull-face : procedure?

gl-cylinder : procedure?

gl-delete-lists : procedure?

gl-delete-queries : procedure?

gl-depth-func : procedure?

gl-depth-mask : procedure?

gl-depth-range : procedure?

gl-disable : procedure?

gl-disk : procedure?

gl-edge-flag : procedure?

gl-enable : procedure?

gl-end : procedure?

gl-end-list : procedure?

gl-end-query : procedure?

gl-eval-coord : procedure?

gl-eval-coord-v : procedure?

gl-eval-mesh : procedure?

gl-eval-point : procedure?

gl-feedback-buffer->gl-float-vector : procedure?

gl-finish : procedure?

gl-flush : procedure?

gl-front-face : procedure?

gl-frustum : procedure?

gl-gen-lists : procedure?

gl-gen-queries : procedure?

gl-get-error : procedure?

gl-get-string : procedure?

gl-hint : procedure?

gl-index : procedure?

gl-index-mask : procedure?

gl-index-v : procedure?

gl-init-names : procedure?

gl-is-buffer : procedure?

gl-is-enabled : procedure?

gl-is-list : procedure?

gl-is-query : procedure?

gl-light : procedure?

gl-light-model : procedure?

gl-light-model-v : procedure?

gl-light-v : procedure?

gl-line-stipple : procedure?

gl-line-width : procedure?

gl-list-base : procedure?

gl-load-identity : procedure?

gl-load-matrix : procedure?

gl-load-name : procedure?

gl-load-transpose-matrix : procedure?

gl-look-at : procedure?

gl-map-grid : procedure?

gl-material : procedure?

gl-material-v : procedure?

gl-matrix-mode : procedure?

gl-mult-matrix : procedure?

gl-mult-transpose-matrix : procedure?

gl-multi-tex-coord : procedure?

gl-multi-tex-coord-v : procedure?

gl-new-list : procedure?

gl-new-quadric : procedure?

gl-normal : procedure?

gl-normal-v : procedure?

gl-ortho : procedure?

gl-ortho-2d : procedure?

gl-partial-disk : procedure?

gl-pass-through : procedure?

gl-perspective : procedure?

gl-pick-matrix : procedure?

gl-pixel-store : procedure?

gl-point-parameter : procedure?

gl-point-parameter-v : procedure?

gl-point-size : procedure?

gl-polygon-mode : procedure?

gl-polygon-offset : procedure?

gl-pop-attrib : procedure?

gl-pop-client-attrib : procedure?

gl-pop-matrix : procedure?

gl-pop-name : procedure?

gl-process-selection : procedure?

gl-project : procedure?

gl-push-matrix : procedure?

gl-push-name : procedure?

gl-quadric-draw-style : procedure?

gl-quadric-normals : procedure?

gl-quadric-orientation : procedure?

gl-quadric-texture : procedure?

gl-raster-pos : procedure?

gl-raster-pos-v : procedure?

gl-rect : procedure?

gl-rect-v : procedure?

gl-render-mode : procedure?

gl-rotate : procedure?

gl-sample-coverage : procedure?

gl-scale : procedure?

gl-scissor : procedure?

gl-secondary-color : procedure?

gl-secondary-color-v : procedure?

gl-select-buffer->gl-uint-vector : procedure?

gl-shade-model : procedure?

gl-sphere : procedure?

gl-stencil-func : procedure?

gl-stencil-mask : procedure?

gl-stencil-op : procedure?

gl-tex-coord : procedure?

gl-tex-coord-v : procedure?

gl-tex-gen : procedure?

gl-tex-gen-v : procedure?

gl-translate : procedure?

gl-u-get-string : procedure?

gl-un-project : procedure?

gl-un-project4 : procedure?

gl-vertex : procedure?

gl-vertex-v : procedure?

gl-viewport : procedure?

gl-window-pos : procedure?

gl-window-pos-v : procedure?

Scheme-style variants of the OpenGL functions.

(process-selection vec hits)  (listof selection-record?)

  vec : gl-uint-vector?

  hits : exact-nonnegative-integer?

Parses the contents of vec from the format used by glSelectBuffer. The second argument should be the number of hits as returned by glRenderMode.

(get-gl-version-number)  exact-nonnegative-integer?

Returns the run-time OpenGL version number as an integer: 10, 11, 12, 13, 14, 15, or 20.

(get-glu-version-number)  exact-nonnegative-integer?

Returns the run-time GLU version number as an integer: 10, 11, 12, or 13.