 
 : gl-program-shaders ( program -- shaders )
     dup gl-program-shaders-length [
-        dup "GLuint" <c-array> 0 <int> over glGetAttachedShaders
+        dup "GLuint" <c-array>
+        [ 0 <int> swap glGetAttachedShaders ] keep
     ] keep c-uint-array> ;
 
 : delete-gl-program-only ( program -- )

    GL_INFO_LOG_LENGTH gl-shader-get-int ; inline

: gl-shader-info-log ( shader -- log )
    dup gl-shader-info-log-length
    dup [
        0 <int> over glGetShaderInfoLog
        alien>char-string
    ] with-malloc ;


    GL_INFO_LOG_LENGTH gl-program-get-int ; inline

: gl-program-info-log ( program -- log )
    dup gl-program-info-log-length dup [
        [ 0 <int> swap glGetProgramInfoLog ] keep
        alien>char-string
    ] with-malloc ;

: check-gl-program ( program -- program* )
    dup gl-program-ok? [ dup gl-program-info-log throw ] unless ;
