#ifndef __Wumbo_Renderer_h__
#define __Wumbo_Renderer_h__

#include "Wumbo-Types.h"
#include "Wumbo-VirtualRenderTarget.h"
#include "Wumbo-RenderTarget.h"
#include <string>
#if PLATFORM_WINDOWS
#include <windows.h>
#include <gl/gl.h>
#else
#endif

namespace Wumbo
{
	typedef enum {
	WumboVertexAttribPosition,
	WumboVertexAttribNormal,
	WumboVertexAttribColor,
	WumboVertexAttribTexCoord0,
	WumboVertexAttribTexCoord1,
	} WumboVertexAttrib;

	typedef enum {ScreenRotation_DOWN, ScreenRotation_RIGHT, ScreenRotation_UP, ScreenRotation_LEFT} ScreenRotation;
//#endif
	
	class Program;

	class Renderer
	{
	private:
		Program *program;
		vec2di displaySize;
		vec2di renderSize;
		std::string title;
		ScreenRotation rotation;
		VirtualRenderTarget virtualRenderTarget;
		RenderTarget *renderTarget;
#if PLATFORM_IOS
		GLint iOSRenderBufferZero;
#endif
	public:
		static const int FULLSCREEN = -1;
		void iOSFix();
		
		Renderer(Program* prog);
		Program *getProgram();
		
		void setDisplaySize(int width, int height = -1);
		vec2di getDisplaySize();

		void resetVirtualRenderTarget();
		void setVirtualRenderTarget(VirtualRenderTarget targ);
		void setVirtualRenderTargetForced(VirtualRenderTarget targ);
		VirtualRenderTarget getVirtualRenderTarget();

		void resetRenderTarget();
		void setRenderTarget(RenderTarget *targ);
		RenderTarget *getRenderTarget();

		void setTitle(std::string);
		void setRotation(ScreenRotation rot);
		ScreenRotation getRotation();
	};
};

#endif