#include "main.h"

int iLetterBoxSize = 160;
uint l_uiLBoxImage = 0;

void InitLetterBox(void)
{
    l_uiLBoxImage = LoadTGAFile("media/letterbox.tga");
}

void DrawLetterBox(void)
{         
    glEnable(GL_BLEND);
    glBindTexture(GL_TEXTURE_2D, l_uiLBoxImage);
    glLoadIdentity();
    glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
    glBegin(GL_QUADS);
        glTexCoord2f(0.0f, 1.0f);
        glVertex2d(0, 0);
        glTexCoord2f(1.0f, 1.0f);
        glVertex2d(g_iWinWidth, 0);
        glTexCoord2f(1.0f, 0.0f);
        glVertex2d(g_iWinWidth, iLetterBoxSize);
        glTexCoord2f(0.0f, 0.0f);
        glVertex2d(0, iLetterBoxSize);

        glTexCoord2f(0.0f, 0.0f);
        glVertex2d(0, g_iWinHeight - iLetterBoxSize);
        glTexCoord2f(1.0f, 0.0f);
        glVertex2d(g_iWinWidth, g_iWinHeight - iLetterBoxSize);
        glTexCoord2f(1.0f, 1.0f);
        glVertex2d(g_iWinWidth, g_iWinHeight);
        glTexCoord2f(0.0f, 1.0f);
        glVertex2d(0, g_iWinHeight);
    glEnd();    
    glBindTexture(GL_TEXTURE_2D, 0);
}
