-
Notifications
You must be signed in to change notification settings - Fork 0
/
spout_output.h
39 lines (30 loc) · 1.04 KB
/
spout_output.h
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
//
// Created by reito on 2023/6/26.
//
#ifndef ELECTRON_SPOUT_SPOUT_OUTPUT_H
#define ELECTRON_SPOUT_SPOUT_OUTPUT_H
#include "SpoutDX/SpoutDX.h"
#include <d3d11_1.h>
#include <napi.h>
class SpoutOutput : public Napi::ObjectWrap<SpoutOutput> {
public:
static void Init(Napi::Env env, Napi::Object exports);
static Napi::Object NewInstance(Napi::Env env, Napi::Value arg);
SpoutOutput(const Napi::CallbackInfo &info);
~SpoutOutput();
Napi::Value NameGetter(const Napi::CallbackInfo &info);
void NameSetter(const Napi::CallbackInfo &info, const Napi::Value &value);
void UpdateFrame(const Napi::CallbackInfo &info);
void UpdateTexture(const Napi::CallbackInfo &info);
private:
spoutDX output = {};
ID3D11Device* device = nullptr;
ID3D11Device1* device1 = nullptr;
ID3D11DeviceContext* context = nullptr;
ID3D11Texture2D* texture = nullptr;
int texWidth = 0;
int texHeight = 0;
void InitializeDevice();
void EnsureStagingTexture(int width, int height);
};
#endif//ELECTRON_SPOUT_SPOUT_OUTPUT_H