This repository has been archived by the owner on Feb 11, 2021. It is now read-only.
/
SDL_winrtrenderer.h
47 lines (38 loc) · 1.48 KB
1
2
#pragma once
3
4
#include "DirectXHelper.h"
#include "SDL.h"
5
#include "../../render/direct3d11/SDL_render_d3d11_cpp.h"
6
7
8
// Helper class that initializes DirectX APIs for 3D rendering.
ref class SDL_winrtrenderer
9
{
10
internal:
11
SDL_winrtrenderer();
12
13
public:
14
virtual ~SDL_winrtrenderer();
15
16
17
18
19
20
21
virtual void Initialize(Windows::UI::Core::CoreWindow^ window);
virtual void HandleDeviceLost();
virtual void CreateDeviceResources();
virtual void CreateWindowSizeDependentResources();
virtual void UpdateForWindowSizeChange();
virtual void Present();
virtual float ConvertDipsToPixels(float dips);
22
23
internal:
24
virtual void Render(SDL_Surface * surface, SDL_Rect * rects, int numrects);
25
void ResizeMainTexture(int w, int h);
26
27
internal:
28
29
// Internal SDL renderer (likely a temporary addition, for refactoring purposes):
SDL_Renderer * m_sdlRenderer;
30
D3D11_RenderData * m_sdlRendererData;
31
32
protected private:
33
34
35
// UpdateWindowSurface helper objects
SDL_Surface * m_mainTextureHelperSurface;
36
37
38
39
40
// Cached renderer properties.
Windows::Foundation::Size m_renderTargetSize;
Windows::Foundation::Rect m_windowBounds;
Platform::Agile<Windows::UI::Core::CoreWindow> m_window;
Windows::Graphics::Display::DisplayOrientations m_orientation;
41
42
43
// Transform used for display orientation.
DirectX::XMFLOAT4X4 m_orientationTransform3D;
44
45
46
// Has the renderer finished loading?
bool m_loadingComplete;
47
};