Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hrydgard
GitHub Repository: hrydgard/ppsspp
Path: blob/master/libretro/LibretroD3D11Context.h
3185 views
1
#pragma once
2
3
#define HAVE_D3D11
4
#include "libretro/libretro_d3d.h"
5
#include "libretro/LibretroGraphicsContext.h"
6
7
class LibretroD3D11Context : public LibretroHWRenderContext {
8
public:
9
LibretroD3D11Context() : LibretroHWRenderContext(RETRO_HW_CONTEXT_DIRECT3D, 11) {}
10
bool Init() override;
11
12
void SwapBuffers() override;
13
void GotBackbuffer() override;
14
void LostBackbuffer() override;
15
void CreateDrawContext() override;
16
void DestroyDrawContext() override;
17
18
GPUCore GetGPUCore() override { return GPUCORE_DIRECTX11; }
19
const char *Ident() override { return "DirectX 11"; }
20
21
private:
22
retro_hw_render_interface_d3d11 hwInterface_ = {};
23
ID3D11Device1 *device1_ = nullptr;
24
ID3D11DeviceContext1 *context1_ = nullptr;
25
ID3D11Texture2D *texture_ = nullptr;
26
ID3D11RenderTargetView *texture_rt_view_ = nullptr;
27
ID3D11ShaderResourceView *texture_sr_view_ = nullptr;
28
DXGI_FORMAT format_ = DXGI_FORMAT_R8G8B8A8_UNORM;
29
};
30
31