     dup color-index-length read swap set-bitmap-color-index ;
 
 : load-bitmap ( path -- bitmap )
-    binary [
+    normalize-path binary [
         T{ bitmap } clone
         dup parse-file-header
         dup parse-bitmap-header

! Copyright (C) 2007 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.

USING: alien arrays byte-arrays combinators
graphics.viewer io io.binary io.files kernel libc math
math.functions namespaces opengl opengl.gl prettyprint
sequences strings ui ui.gadgets.panes io.encodings.binary ;
IN: graphics.bitmap


    load-bitmap [ <graphics-gadget> "bitmap" open-window ] keep ;

: test-bitmap24 ( -- )
    "resource:extra/graphics/bitmap/test-images/thiswayup24.bmp" bitmap. ;

: test-bitmap8 ( -- )
    "resource:extra/graphics/bitmap/test-images/rgb8bit.bmp" bitmap. ;

: test-bitmap4 ( -- )
    "resource:extra/graphics/bitmap/test-images/rgb4bit.bmp" bitmap. ;

: test-bitmap1 ( -- )
    "resource:extra/graphics/bitmap/test-images/1bit.bmp" bitmap. ;

