summaryrefslogtreecommitdiff
path: root/Runtime/GfxDevice/GfxDeviceWindow.cpp
blob: c6e49338ca9e2132aaee8d7c1178f1009d07978f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include "UnityPrefix.h"
#include "GfxDeviceWindow.h"


GfxDeviceWindow::GfxDeviceWindow (NativeWindow window, int width, int height, DepthBufferFormat depthFormat, int antiAlias)
	: m_Window (window)
	, m_Width (0)
	, m_Height (0)
	, m_InvalidState (true)
	, m_CanUseBlitOptimization (false)
{
	//Reshape (width, height, depthFormat, antiAlias);
}

GfxDeviceWindow::~GfxDeviceWindow ()
{
}

bool GfxDeviceWindow::Reshape (int width, int height, DepthBufferFormat depthFormat, int antiAlias)
{
	m_InvalidState = false;

	AssertIf (!m_Window);

	m_Width = width;
	m_Height = height;

	if (m_Width <= 0 || m_Height <= 0)
	{
		m_InvalidState = true;
	}

	return !m_InvalidState;
}


bool GfxDeviceWindow::BeginRendering ()
{
	if (m_InvalidState)
	{
		return false;
	}

	return true;
}

bool GfxDeviceWindow::EndRendering (bool presentContent)
{
	if (m_InvalidState)
	{
		return false;
	}

	return true;
}