: image-internal-format ( component-order component-type -- internal-format )
2dup
[ fix-internal-component-order ] dip 2array image-internal-formats at
- [ 2nip ] [ unsupported-component-order ] if* ;
+ [ 2nip ] [ throw-unsupported-component-order ] if* ;
: reversed-type? ( component-type -- ? )
{ u-9-9-9-e5-components float-11-11-10-components } member? ;
{ RGBA [ drop GL_RGBA_INTEGER ] }
{ BGRX [ drop GL_BGRA_INTEGER ] }
{ RGBX [ drop GL_RGBA_INTEGER ] }
- [ swap unsupported-component-order ]
+ [ swap throw-unsupported-component-order ]
} case
] [
swap {
{ INTENSITY [ drop GL_INTENSITY ] }
{ DEPTH [ drop GL_DEPTH_COMPONENT ] }
{ DEPTH-STENCIL [ drop GL_DEPTH_STENCIL ] }
- [ swap unsupported-component-order ]
+ [ swap throw-unsupported-component-order ]
} case
] if ;
GENERIC: (component-type>type) ( component-order component-type -- gl-type )
-M: object (component-type>type) unsupported-component-order ;
+M: object (component-type>type) throw-unsupported-component-order ;
: four-channel-alpha-first? ( component-order component-type -- ? )
over component-count 4 =
[ drop alpha-channel-precedes-colors? ]
- [ unsupported-component-order ] if ;
+ [ throw-unsupported-component-order ] if ;
: not-alpha-first ( component-order component-type -- )
over alpha-channel-precedes-colors?
- [ unsupported-component-order ]
+ [ throw-unsupported-component-order ]
[ 2drop ] if ;
M: ubyte-components (component-type>type)
M: u-24-components (component-type>type)
over DEPTH =
- [ 2drop GL_UNSIGNED_INT ] [ unsupported-component-order ] if ;
+ [ 2drop GL_UNSIGNED_INT ]
+ [ throw-unsupported-component-order ] if ;
M: u-24-8-components (component-type>type)
over DEPTH-STENCIL =
- [ 2drop GL_UNSIGNED_INT_24_8 ] [ unsupported-component-order ] if ;
+ [ 2drop GL_UNSIGNED_INT_24_8 ]
+ [ throw-unsupported-component-order ] if ;
M: u-9-9-9-e5-components (component-type>type)
over BGR =
- [ 2drop GL_UNSIGNED_INT_5_9_9_9_REV ] [ unsupported-component-order ] if ;
+ [ 2drop GL_UNSIGNED_INT_5_9_9_9_REV ]
+ [ throw-unsupported-component-order ] if ;
M: float-11-11-10-components (component-type>type)
over BGR =
- [ 2drop GL_UNSIGNED_INT_10F_11F_11F_REV ] [ unsupported-component-order ] if ;
+ [ 2drop GL_UNSIGNED_INT_10F_11F_11F_REV ]
+ [ throw-unsupported-component-order ] if ;
: image-data-format ( component-order component-type -- gl-format gl-type )
[ (component-order>format) ] [ (component-type>type) ] 2bi ;