#pragma once
#include "Surface.h"
#include "DeviceCairoGL.h"

#ifdef GUI_ENABLE_CAIRO_GL

namespace gui {

	/**
	 * Cairo GL surface.
	 */
	class CairoGLSurface : public CairoSurface {
	public:
		// Create.
		CairoGLSurface(Size size, Float scale, CairoGLContext *context);

		// Destroy.
		~CairoGLSurface();

		// Present.
		virtual PresentStatus present(bool waitForVSync);

		// Create a Graphics object with flipped Y coordinates.
		virtual WindowGraphics *createGraphics(Engine &e);

		// Paint.
		virtual void repaint(RepaintParams *params);

		// Resize the surface.
		virtual void resize(Size size, Float scale);

		// Grab an image.
		virtual Image *grabImage(Engine &e);

	private:
		// GL context.
		CairoGLContext *context;

		// Main texture.
		GLuint texture;
	};

}

#endif
