#include "WMR_Wrapper.h"
#include "WMRimpl.hpp"

WMR_Wrapper::~WMR_Wrapper()
{ 
	if (_impl) delete _impl;
}

bool WMR_Wrapper::init(HWND hwnd)
{
	_impl = new WMRimpl();

	return _impl->init(hwnd);
}

void WMR_Wrapper::getPerEyeResolution(uint32_t& width, uint32_t& height) const
{
	_impl->getPerEyeResolution(width, height);
}

void WMR_Wrapper::submitFrameToHmd()
{
	_impl->submitFrame();
}

void WMR_Wrapper::frameStartGetTracking(float(&viewL)[16], float(&viewR)[16], float(&projL)[16], float(&projR)[16])
{
	_impl->frameStart();
	_impl->getTrackingData(viewL, viewR, projL, projR);
}

void WMR_Wrapper::getTextures(GLuint& left, GLuint& right) const
{
	_impl->getLeftRightTextures(left, right);
}

void WMR_Wrapper::setNearFarDistance(float nearZ, float farZ)
{
	_impl->setNearFarDistance(nearZ, farZ);
}
