{"size": 969, "ext": "scrbl", "max_stars_repo_path": "scribblings/bitmap.scrbl", "max_stars_repo_name": "LiberalArtist/sgl", "max_stars_repo_stars_event_min_datetime": "2018-07-29T04:13:52.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-14T16:11:17.000Z", "max_issues_repo_path": "scribblings/bitmap.scrbl", "max_issues_repo_name": "LiberalArtist/sgl", "max_issues_repo_issues_event_min_datetime": "2017-08-25T20:26:37.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T17:48:40.000Z", "max_forks_repo_path": "scribblings/bitmap.scrbl", "max_forks_repo_name": "LiberalArtist/sgl", "max_forks_repo_forks_event_min_datetime": "2021-06-23T03:01:13.000Z", "max_forks_repo_forks_event_max_datetime": "2022-01-01T03:01:16.000Z"}
{"max_stars_count": 10, "max_issues_count": 15, "max_forks_count": 4, "avg_line_length": 34.6071428571, "max_line_length": 71, "alphanum_fraction": 0.6068111455}
#lang scribble/doc
@(require "common.rkt" (for-label racket/class))

@title[#:tag "bitmaps"]{Bitmaps}

@defmodule[sgl/bitmap]


@defproc[(bitmap->gl-list [bitmap (is-a?/c bitmap%)]
                          [#:with-gl with-gl-proc ((-> any) . -> . any)
                                     (lambda (f) (f))]
                          [#:mask mask (or/c (is-a?/c bitmap%) false/c)
                                       (send bitmap get-loaded-mask)])
         exact-integer?]{

Converts the given bitmap into an OpenGL list that can be rendered
with @racket[gl-call-list] or @racket[glCallList]. The rendered object
is a square on the @math{z=0} plane with corners at @math{(0,0)} and
@math{(1,1)}.

The @racket[with-gl-proc] must accept a thunk and call it while the
relevant OpenGL context is selected. Otherwise, the relevant OpenGL
context must be selected already.

If @racket[mask] is not @racket[#f], it is used as the mask bitmap for
extracting alpha values.}

