13 gl-config%

▼ |  | The Racket Drawing Toolkit

1 | Overview
2 | bitmap%
3 | bitmap-dc%
4 | brush%
5 | brush-list%
6 | color%
7 | color-database<%>
8 | dc<%>
9 | dc-path%
10 | font%
11 | font-list%
12 | font-name-directory<%>
13 | gl-config%
14 | gl-context<%>
15 | linear-gradient%
16 | pdf-dc%
17 | pen%
18 | pen-list%
19 | point%
20 | post-script-dc%
21 | ps-setup%
22 | radial-gradient%
23 | record-dc%
24 | region%
25 | svg-dc%
26 | Drawing Functions
27 | Drawing Contracts
28 | Signature and Unit
29 | Unsafe Libraries
30 | Drawing Conveniences
31 | Platform Dependencies
| Bibliography
| Index

On this page:

new
get-accum-size
get-depth-size
get-double-buffered
get-hires-mode
get-legacy?
get-multisample-size
get-share-context
get-stencil-size
get-stereo
get-sync-swap
set-accum-size
set-depth-size
set-double-buffered
set-hires-mode
set-legacy?
set-multisample-size
set-share-context
set-stencil-size
set-stereo
set-sync-swap

Racket
top contents ← prev up next →

class gl-config% : class?
superclass: object%

A gl-config% object encapsulates configuration information for an OpenGL drawing context. Use a gl-config% object as an initialization argument for canvas% or provide it to make-gl-bitmap.

> constructor (new gl-config%) → (is-a?/c gl-config%)

Creates a GL configuration that indicates legacy OpenGL, double buffering, a depth buffer of size one, no stencil buffer, no accumulation buffer, no multisampling, and not stereo.

> method (send a-gl-config get-accum-size) → (integer-in 0 256)

Reports the accumulation-buffer size (for each of red, green, blue, and alpha) that the configuration requests, where zero means no accumulation buffer is requested.

> method (send a-gl-config get-depth-size) → (integer-in 0 256)

Reports the depth-buffer size that the configuration requests, where zero means no depth buffer is requested.

> method (send a-gl-config get-double-buffered) → boolean?

Reports whether the configuration requests double buffering or not.

> method (send a-gl-config get-hires-mode) → boolean?

Determines whether to use hires mode. On Mac OS, hires mode means that the created OpenGL contexts will have access to the full Retina resolution and will not be scaled by the drawing system. On other platforms, hires mode has no effect.

Added in version 1.5 of package draw-lib.

> method (send a-gl-config get-legacy?) → boolean?

Determines whether to use legacy “Compatibility” OpenGL or “Core” OpenGL. Core OpenGL profiles are currently supported on Mac OS (version 10.7 and up) and Linux (if the graphics drivers support them).

Added in version 1.2 of package draw-lib.

> method (send a-gl-config get-multisample-size) → (integer-in 0 256)

Reports the multisampling size that the configuration requests, where zero means no multisampling is requested.

> method (send a-gl-config get-share-context)
> → (or/c #f (is-a?/c gl-context<%>))

Returns a gl-context<%> object that shares certain objects (textures, display lists, etc.) with newly created OpenGL drawing contexts, or #f is none is set.

See also set-share-context.

> method (send a-gl-config get-stencil-size) → (integer-in 0 256)

Reports the stencil-buffer size that the configuration requests, where zero means no stencil buffer is requested.

> method (send a-gl-config get-stereo) → boolean?

Reports whether the configuration requests stereo or not.

> method (send a-gl-config get-sync-swap) → boolean?

Reports whether the configuration requests buffer-swapping synchronization with the screen refresh.

Added in version 1.10 of package draw-lib.

> method (send a-gl-config set-accum-size on?) → void?
> on? : (integer-in 0 256)

Adjusts the configuration to request a particular accumulation-buffer size for every channel (red, green, blue, and alpha), where zero means no accumulation buffer is requested.

> method (send a-gl-config set-depth-size on?) → void?
> on? : (integer-in 0 256)

Adjusts the configuration to request a particular depth-buffer size, where zero means no depth buffer is requested.

> method (send a-gl-config set-double-buffered on?) → void?
> on? : any/c

Adjusts the configuration to request double buffering or not.

> method (send a-gl-config set-hires-mode hires-mode) → void?
> hires-mode : any/c

Adjusts the configuration to request hires mode or not; see get-hires-mode.

Added in version 1.5 of package draw-lib.

> method (send a-gl-config set-legacy? legacy?) → void?
> legacy? : any/c

Adjusts the configuration to request legacy mode or not; see get-legacy?.

Added in version 1.2 of package draw-lib.

> method (send a-gl-config set-multisample-size on?) → void?
> on? : (integer-in 0 256)

Adjusts the configuration to request a particular multisample size, where zero means no multisampling is requested. If a multisampling context is not available, this request will be ignored.

> method (send a-gl-config set-share-context context) → void?
> context : (or/c #f (is-a?/c gl-context<%>))

Determines a gl-context<%> object that shares certain objects (textures, display lists, etc.) with newly created OpenGL drawing contexts, where #f indicates that no sharing should occur.

When a context B shares objects with context A, it is also shares objects with every other context sharing with A, and vice versa.

If an OpenGL implementation does not support sharing, context is effectively ignored when a new context is created. Sharing should be supported in all versions of Mac OS. On Windows and Linux, sharing is provided by the presence of the WGL_ARB_create_context and GLX_ARB_create_context extensions, respectively (and OpenGL 3.2 requires both).

> method (send a-gl-config set-stencil-size on?) → void?
> on? : (integer-in 0 256)

Adjusts the configuration to request a particular stencil-buffer size, where zero means no stencil buffer is requested.

> method (send a-gl-config set-stereo on?) → void?
> on? : any/c

Adjusts the configuration to request stereo or not.

> method (send a-gl-config set-sync-swap on?) → void?
> on? : any/c

Adjusts the configuration to request buffer-swapping synchronization with the screen refresh or not.

Added in version 1.10 of package draw-lib.

top contents ← prev up next →