summaryrefslogtreecommitdiff
path: root/Runtime/GfxDevice/d3d/D3D9Window.h
blob: 038b59f54b26984809827802b2a297d672c910df (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
#ifndef D3D9WINDOW_H
#define D3D9WINDOW_H

#include "D3D9Includes.h"
#include "Runtime/GfxDevice/GfxDeviceWindow.h"
#include "Runtime/GfxDevice/GfxDeviceObjects.h"
#include "D3D9Utils.h"
#include "TexturesD3D9.h"

class D3D9Window : public GfxDeviceWindow
{
private:
	IDirect3DDevice9*		m_Device;
	IDirect3DSwapChain9*	m_SwapChain;
	RenderColorSurfaceD3D9	m_BackBuffer;
	RenderDepthSurfaceD3D9	m_DepthStencil;
	D3DFORMAT				m_DepthStencilFormat;
	int						m_FSAALevel;
public:
	D3D9Window( IDirect3DDevice9* device, HWND window, int width, int height, DepthBufferFormat depthFormat, int antiAlias );
	~D3D9Window();

	bool				Reshape( int width, int height, DepthBufferFormat depthFormat, int antiAlias );

	bool				BeginRendering();
	bool				EndRendering( bool presentContent );
	void				SetAsActiveWindow ();

	D3DFORMAT			GetDepthStencilFormat() const { return m_DepthStencilFormat; }

	RenderSurfaceHandle GetBackBuffer();
	RenderSurfaceHandle GetDepthStencil();
};

#if UNITY_EDITOR
int GetCurrentD3DFSAALevel();
#endif

#endif