#include "Wumbo-Texture.h"
#include "Wumbo-Functions.h"
#include "Wumbo-Sprite.h"
#include "Wumbo-Renderer.h"
#include "Wumbo-Types.h"
#include "scTitle.h"
#include "scYouWin.h"
#include "Wumbo-InputManager.h"
#include "Wumbo-KeyboardInput.h"

Wumbo::Texture *texDisplay4;
Wumbo::Sprite *sprDisplay4;

scYouWin::scYouWin()
{
	program = NULL;
}
scYouWin::scYouWin(Wumbo::Program *prog)
{
	program = prog;
}
void scYouWin::begin()
{
	texDisplay4 = new Wumbo::Texture();
	texDisplay4->load(Wumbo::BundleResource("youwin.png"));

	Wumbo::Renderer *rend = program->getRenderer();
	
	sprDisplay4 = new Wumbo::Sprite(rend);
	sprDisplay4->setTexture(texDisplay4);
	sprDisplay4->setSubrect(0,0,0,1,1);
	sprDisplay4->setSize(1024,768);

}
void scYouWin::update()
{
}
void scYouWin::render()
{
	glClearColor(0.6f,0.6f,0.6f,1.f);
	glClear(GL_COLOR_BUFFER_BIT);
	texDisplay4->bind();
	sprDisplay4->setPosition(0,0);
	sprDisplay4->draw();
	if (program->getInputManager()->getKeyboardState()->isKeyPressed(sf::Keyboard::Return))
		program->setScene(new scTitle(program));
}
void scYouWin::end()
{
	delete sprDisplay4;
	delete texDisplay4;
}
void scYouWin::onClose()
{
}
