Skip to content

Commit

Permalink
[host] dxgi: move and document dxgi_* exposed functions for backends
Browse files Browse the repository at this point in the history
  • Loading branch information
gnif committed Nov 7, 2023
1 parent 7f9f40e commit dffc034
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
19 changes: 16 additions & 3 deletions host/platform/Windows/capture/DXGI/src/backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
#ifndef _H_DXGI_BACKEND_
#define _H_DXGI_BACKEND_

#include "dxgi_capture.h"
#include "common/types.h"
#include "interface/capture.h"

struct DXGIInterface;
struct Texture;
#include <stdbool.h>
#include <d3d11.h>

struct DXGICopyBackend
{
Expand Down Expand Up @@ -71,4 +72,16 @@ struct DXGICopyBackend
void (*preRelease)(void);
};

// these are functions exported by dxgi.c for use by the backends
IDXGIAdapter1 * dxgi_getAdapter(void);
ID3D11Device * dxgi_getDevice(void);
ID3D11DeviceContext * dxgi_getContext(void);

// lock and unlock the context lock
void dxgi_contextLock(void);
void dxgi_contextUnlock(void);

/* returns true if dxgi:debug is enabled */
bool dxgi_debug(void);

#endif
1 change: 1 addition & 0 deletions host/platform/Windows/capture/DXGI/src/d3d12.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "com_ref.h"

#include <assert.h>
#include <dxgi1_2.h>
#include <d3d12.h>
#include <d3d12sdklayers.h>
#include "common/time.h"
Expand Down
7 changes: 0 additions & 7 deletions host/platform/Windows/capture/DXGI/src/dxgi_capture.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,4 @@ struct DXGIInterface
struct FrameDamage frameDamage[LGMP_Q_FRAME_LEN];
};

IDXGIAdapter1 * dxgi_getAdapter(void);
ID3D11Device * dxgi_getDevice(void);
ID3D11DeviceContext * dxgi_getContext(void);
void dxgi_contextLock(void);
void dxgi_contextUnlock(void);
bool dxgi_debug(void);

#endif

0 comments on commit dffc034

Please sign in to comment.