#include <lowlevellib.h>

int os_main(int argc, char **argv, char **envp )
{
    llgfx_SetDisplayMode(320,240,16,0);

    // load resources
    llgfx_id background = llgfx_LoadGfx("background.png");
    // overlay
    llgfx_id backgroundtile = llgfx_LoadGfx("gras.png");
    
    //blitfx for FX 
    llgfx_sBLITFX blitfx;
    blitfx.fixalpha = 0.4f;

    // font resources
    s_font borderfont;
    s_font menufont;

    llgfx_LoadFont("borderfont.png", &borderfont);
    llgfx_LoadFont("menufont.png", &menufont );

    int run_x = 0;
    while(osmain_endgame==false){
        // draw Background
        llgfx_BLIT(0,background);
        llgfx_TILE_BLIT(0,backgroundtile,run_x,0,0,BLIT_FXSUB,&blitfx);
        // run x
        run_x++;

        // now the border
        llgfx_SelectFont(&borderfont);
        llgfx_SetTextPos(40,40);
        llgfx_DrawText("[--------]\n"  // only 3 chars in font
                       "-       -\n"  // [ left corner 
                       "-       -\n"  // ] right corner
                       "-       -\n"  // - filler
                       "-       -\n"  // - filler
                       "[--------]\n"
                       );

        // some text
        llgfx_SelectFont(&menufont);
        llgfx_SetTextPos(80,80);
        llgfx_DrawText("WELCOME\n"
                        "TO THE\n"
                        "LEVEL ONE\n"
                        "ENGINE");

        llgfx_FlipScreen(true);
        llinput_Update();
        llirq_Sleep(15);
    }
    return 0;
}