/*
	ZWindowRenderTarget.hpp
	Author: James Russell <jcrussell@762studios.com>
	Created: 04/01/2011

	Purpose:	
	
	Interface class for a window render target.  This interface requires that windows
	be created and manipulated using libsst-wm.

	License:

	TODO
*/

#pragma once

#ifndef _ZWINDOWRENDERTARGET_HPP
#define _ZWINDOWRENDERTARGET_HPP

#include <ZRenderer/ZRendererBuild.hpp>

#include <SST/SST_WM.h>

#include <ZUtil/ZUtil.hpp>

#include <ZRenderer/ZRenderTarget.hpp>

class ZWindowRenderTarget : public ZRenderTarget
{
public:	
	//Virtual destructor
	virtual ~ZWindowRenderTarget() { }

	/*
	virtual public ZWindowRenderTarget::GetAutoSwapBuffers
	
	Gets the flag indicating whether or not this target will auto-swap buffers by the
	renderer when used as a render target.
	
	@return (bool)
	@context (all)
	*/
	virtual bool GetAutoSwapBuffers() = 0;

	/*
	virtual public ZWindowRenderTarget::GetScreenIndex

	Gets the screen index held by this window render target.  Used to interface with libsst-wm
	functionality.

	@return (size_t) - the screen index
	@context (all)
	*/
	virtual size_t GetScreenIndex() = 0;

	/*
	virtual public ZWindowRenderTarget::GetWindowHandle
	
	Gets the window handle held by this window render target.  Used to interface with
	libsst-wm functionality.
	
	@return (SST_Window) - the window handle
	*/
	virtual SST_Window GetWindowHandle() = 0;

	/*
	virtual public ZWindowRenderTarget::SetAutoSwapBuffers
	
	Indicates that the renderer should automatically swap buffers after a render is
	complete with this render target.

	@param _value - true if we can, false if not
	@return (bool) - true if able to set flag, false if resource contended
	@context (all)
	*/
	virtual bool SetAutoSwapBuffers(bool _value) = 0;

	/*
	virtual public ZWindowRenderTarget::SwapBuffers
	
	Swaps the buffers on the screen, bringing the back buffer to the front buffer.  This should be called
	every frame, and signals the end of the frame.  This is only safe to call from within the render thread.
	
	@return (bool) - true if able to swapbuffers, false if resource contended
	@context (renderer)
	*/
	virtual bool SwapBuffers() = 0;

	//Not Implemented
	virtual const ZRenderTargetClearFlags& GetClearFlags() = 0;

	//Not Implemented
	virtual size_t GetHeight() = 0;

	//Not Implemented
	virtual ZRenderTargetType GetType() = 0;

	//Not Implemented
	virtual size_t GetWidth() = 0;
	
	//Not Implemented
	virtual bool SetClearFlags(const ZRenderTargetClearFlags& _flags) = 0;
};

#endif