~alcinnz/Mondrian

595c10c349e1810e1deb4ed192b7f6a54d554d70 — Adrian Cochrane 1 year, 6 months ago 049383f
Fix transformation matrix (should be fixed upstream, but that'd be breaking).
2 files changed, 5 insertions(+), 2 deletions(-)

M lib/Graphics/Rendering/Rect/Backgrounds.hs
M lib/Graphics/Rendering/Rect/Types.hs
M lib/Graphics/Rendering/Rect/Backgrounds.hs => lib/Graphics/Rendering/Rect/Backgrounds.hs +1 -1
@@ 17,4 17,4 @@ renderBackgrounds :: (MonadIO m, MonadIO n) =>
    n (Backgrounds -> Rects -> M44 Float -> m ())
renderBackgrounds = do
    base <- renderRectWith baseFragmentShader ["colour"]
    return $ \self -> base [c $ background self] borderBox
    return $ \self -> base [c $ background self] paddingBox

M lib/Graphics/Rendering/Rect/Types.hs => lib/Graphics/Rendering/Rect/Types.hs +4 -1
@@ 71,7 71,7 @@ renderRectWith fragmentShader uniformNames = do
        bufferGeometry 0 pbuf $ rect2geom $ getter rects

        glUseProgram prog
        liftIO $ updateUniform prog matID mat
        liftIO $ updateUniform prog matID $ mflip mat
        forM (zip uniformIDs uniforms) $ \(slot, cb) -> cb prog slot

        glBindVertexArray vao


@@ 87,3 87,6 @@ liftGL n = do
    case ret of
        Left err -> liftIO $ die err
        Right x -> return x

mflip (V4 (V4 a b c d) (V4 e f g h) (V4 i j k l) (V4 m n o p)) =
    V4 (V4 a e i m) (V4 b f j n) (V4 c g k o) (V4 d h l p)