#!/usr/bin/python

import pygame
from pygame.locals import *

import constants
from constants import *
import util
from util import *
from OpenGL.GL import *
from OpenGL.GLU import *

pygame.init()
initializeDisplay(SWIDTH, SHEIGHT)

texture = loadTexture('data/testbg.png')
print texture
#glTranslate(400,400,0)
#drawTile(width=SWIDTH, height=SHEIGHT, texture=texture)

(x1, y1),(x2,y2),(x3,y3),(x4,y4) = (10, 10),(15,10),(300,400),(0,400)

glBegin(GL_QUADS)
glColor4f(1,1,1,1);
glTexCoord2f(x1/256, y1/256); glVertex2f(x1, y1)    # Bottom Left Of The Texture and Quad
glColor4f(1,1,1,1);
glTexCoord2f(x2/256, y2/256); glVertex2f(x2, y2)    # Bottom Right Of The Texture and Quad
glColor4f(1,1,1,0);
glTexCoord2f(x3/256, y3/256); glVertex2f( x3, y3)    # Top Right Of The Texture and Quad
glColor4f(1,1,1,0);
glTexCoord2f(x4/256, y4/256); glVertex2f(x4, y4)    # Top Left Of The Texture and Quad
glEnd()

pygame.display.flip()

import time
time.sleep(10)
