check-world-pixel-format word that world subclasses can override to verify that the chosen pixel format meets their needs
parent
623b16d048
commit
a7e2632faf
|
|
@ -152,10 +152,15 @@ M: world handle-gesture ( gesture gadget -- ? )
|
||||||
|
|
||||||
GENERIC: world-pixel-format-attributes ( world -- attributes )
|
GENERIC: world-pixel-format-attributes ( world -- attributes )
|
||||||
|
|
||||||
|
GENERIC# check-world-pixel-format 1 ( world pixel-format -- )
|
||||||
|
|
||||||
M: world world-pixel-format-attributes
|
M: world world-pixel-format-attributes
|
||||||
drop
|
drop
|
||||||
{ windowed double-buffered T{ depth-bits { value 16 } } } ;
|
{ windowed double-buffered T{ depth-bits { value 16 } } } ;
|
||||||
|
|
||||||
|
M: world check-world-pixel-format
|
||||||
|
2drop ;
|
||||||
|
|
||||||
: with-world-pixel-format ( world quot -- )
|
: with-world-pixel-format ( world quot -- )
|
||||||
[ dup dup world-pixel-format-attributes <pixel-format> ]
|
[ dup dup world-pixel-format-attributes <pixel-format> ]
|
||||||
dip with-disposal ; inline
|
dip [ 2dup check-world-pixel-format ] prepose with-disposal ; inline
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue