Pixel format attributes
Pixel formats

Next:pixel-format


The following pixel format attributes can be requested and queried of pixel-formats. Binary attributes are represented by the presence of a symbol in an attribute sequence:
double-buffered

stereo

offscreen

fullscreen

windowed

accelerated

software-rendered

backing-store

multisampled

supersampled

sample-alpha

color-float


Integer attributes are represented by a tuple with a single value slot:
color-bits

red-bits

green-bits

blue-bits

alpha-bits

accum-bits

accum-red-bits

accum-green-bits

accum-blue-bits

accum-alpha-bits

depth-bits

stencil-bits

aux-buffers

sample-buffers

samples


Examples
The following world subclass will request a double-buffered window with minimum 24-bit color and depth buffers, and will throw an error if the requirements aren't met:
USING: kernel ui.gadgets.worlds ui.pixel-formats ; IN: ui.pixel-formats.examples TUPLE: picky-depth-buffered-world < world ; M: picky-depth-buffered-world world-pixel-format-attributes drop { double-buffered T{ color-bits { value 24 } } T{ depth-bits { value 24 } } } ; M: picky-depth-buffered-world check-world-pixel-format nip [ double-buffered pixel-format-attribute 0 = [ "Not double buffered!" throw ] when ] [ color-bits pixel-format-attribute 24 < [ "Not enough color bits!" throw ] when ] [ depth-bits pixel-format-attribute 24 < [ "Not enough depth bits!" throw ] when ] tri ;