Merge branch 'master' of git://factorcode.org/git/factor
commit
4f64ea414b
|
@ -165,7 +165,7 @@ ERROR: download-failed response ;
|
|||
present file-name "?" split1 drop "/" ?tail drop ;
|
||||
|
||||
: download-to ( url file -- )
|
||||
binary [ [ write ] with-http-get drop ] with-file-writer ;
|
||||
binary [ [ write ] with-http-get check-response drop ] with-file-writer ;
|
||||
|
||||
: download ( url -- )
|
||||
dup download-name download-to ;
|
||||
|
|
|
@ -392,4 +392,7 @@ SYMBOL: a
|
|||
|
||||
[ "OK" ] [ "data" "http://localhost/a" add-port http-post nip ] unit-test
|
||||
|
||||
[ ] [ "http://localhost/quit" add-port http-get 2drop ] unit-test
|
||||
! Check that download throws errors (reported by Chris Double)
|
||||
[ "http://localhost/tweet_my_twat" add-port download ] must-fail
|
||||
|
||||
[ ] [ "http://localhost/quit" add-port http-get 2drop ] unit-test
|
||||
|
|
|
@ -38,10 +38,12 @@ TUPLE: single-texture image dim loc texture-coords texture display-list disposed
|
|||
[ next-power-of-2 ] map
|
||||
] unless ;
|
||||
|
||||
: (tex-image) ( image -- )
|
||||
[ GL_TEXTURE_2D 0 GL_RGBA ] dip
|
||||
[ dim>> adjust-texture-dim first2 0 ]
|
||||
[ component-order>> component-order>format f ] bi
|
||||
: (tex-image) ( image bitmap -- )
|
||||
[
|
||||
[ GL_TEXTURE_2D 0 GL_RGBA ] dip
|
||||
[ dim>> adjust-texture-dim first2 0 ]
|
||||
[ component-order>> component-order>format ] bi
|
||||
] dip
|
||||
glTexImage2D ;
|
||||
|
||||
: (tex-sub-image) ( image -- )
|
||||
|
@ -55,7 +57,9 @@ TUPLE: single-texture image dim loc texture-coords texture display-list disposed
|
|||
gen-texture [
|
||||
GL_TEXTURE_BIT [
|
||||
GL_TEXTURE_2D swap glBindTexture
|
||||
[ (tex-image) ] [ (tex-sub-image) ] bi
|
||||
non-power-of-2-textures? get
|
||||
[ dup bitmap>> (tex-image) ]
|
||||
[ [ f (tex-image) ] [ (tex-sub-image) ] bi ] if
|
||||
] do-attribs
|
||||
] keep ;
|
||||
|
||||
|
|
Loading…
Reference in New Issue