gl:set-cull-mode
List of: Scheme Extensions
Subjects: OpenGL, Rendering Control
Contents: OpenGL

Action: Sets the backface culling mode used when rendering entities.

Filename: gl/gl_scm/gl_scm.cxx

APIs: api_gl_get_cull_mode, api_gl_set_cull_mode

Syntax: (gl:set-cull-mode mode)

Arg Types: mode string

Returns: string

Description: This extension sets the backface culling mode Microsoft OpenGL uses when rendering entities. When backface culling is active, polygons whose normals point away from the eyepoint are not rendered. This is most obvious when the fill style is set to "edge" or "point". Normally you should use "auto" as GL renders faster if it can cull polys that face the wrong way. The previous mode is returned. Returns the string identifying the previous mode.


Culling modes are:


auto backface culling depends on the sidedness of entities and faces. Double-sided faces are not culled, single sided are.

always cull back facing faces regardless of sidedness.

never cull back facing faces regardless of sidedness.

Limitations: Supported on NT platforms only.

Example: ; gl:set-cull-mode

; Set the backface culling mode and fill style

; to display edges hidden by forward faces.

(view:gl)

;; #[view 41943049]

(define sphere1 (solid:sphere (position 0 0 0) 40))

;; sphere1

(gl:set-fill-style "edge")

;; "edge"

(view:refresh)

;; #[view 115869988]

(gl:set-cull-mode "never")

;; "never"

(entity:display sphere1)

;; #[entity 2 1]
PDF/GL/01SC.PDF
HTM/DATA/GL/GL/01SC/0007.HTM