IUP

Documentation
Login

glcanvas Module

Synopsis

Racket

(require iup/glcanvas)
CHICKEN (require-extension iup-glcanvas)
CHICKEN 5 (require-library iup)
(import iup-glcanvas)

OpenGL graphics support. Initializes the IUP GLCanvas library when loaded.

OpenGL Canvas Control

(glcanvas [action (or/c symbol? string? #f) #f] #:<name> <value> ...) → ihandle?

Creates a new OpenGL canvas with an action callback name. The action is triggered when the canvas needs to be redrawn.

OpenGL Context Functions

(call-with-glcanvas [handle ihandle?] [proc (-> ihandle? any)] #:swap? [swap? any/c #f] #:sync? [sync? any/c #f]) → any

Calls the given procedure with the given OpenGL canvas handle and ensures that the OpenGL context of the canvas is active during the call. Returns whatever the given procedure returns.

If swap? is true, the double buffers of the OpenGL context are swapped before the call returns.

If sync? is true, the state of the windowing system and OpenGL is synchronized before entry into and after exit from the given procedure.

(glcanvas-is-current? [handle ihandle?]) → boolean?

Checks whether the OpenGL context of the given canvas is the current one.

(glcanvas-palette-set! [handle ihandle?] [index integer?] [red real?] [green real?] [blue real?]) → void?

Defines a palette color for the OpenGL context of the given canvas.

(glcanvas-font-set! [handle ihandle?] [first integer?] [count integer?] [list-base integer?]) → void?

Creates a bitmap display list from the current FONT attribute.