c9df41c1e2
Typedef pointers are unsafe. If you do: typedef struct bla *bla_t; then you cannot use it as a constant, such as: const bla_t, because that constant will be to the pointer itself rather than to the underlying data. I admit this was a fundamental mistake that must be corrected. All typedefs that were pointer types will now have their pointers removed from the type itself, and the pointers will be used when they are actually used as variables/parameters/returns instead. This does not break ABI though, which is pretty nice.
40 lines
937 B
C
40 lines
937 B
C
#pragma once
|
|
|
|
#define WIN32_LEAN_AND_MEAN
|
|
#include <windows.h>
|
|
|
|
#include <obs-module.h>
|
|
|
|
#define NUM_TEXTURES 2
|
|
|
|
struct dc_capture {
|
|
int cur_tex;
|
|
gs_texture_t *textures[NUM_TEXTURES];
|
|
bool textures_written[NUM_TEXTURES];
|
|
int x, y;
|
|
uint32_t width;
|
|
uint32_t height;
|
|
int num_textures;
|
|
|
|
bool compatibility;
|
|
HDC hdc;
|
|
HBITMAP bmp, old_bmp;
|
|
BYTE *bits;
|
|
|
|
bool capture_cursor;
|
|
bool cursor_captured;
|
|
CURSORINFO ci;
|
|
|
|
bool valid;
|
|
};
|
|
|
|
extern void dc_capture_init(struct dc_capture *capture, int x, int y,
|
|
uint32_t width, uint32_t height, bool cursor,
|
|
bool compatibility);
|
|
extern void dc_capture_free(struct dc_capture *capture);
|
|
|
|
extern void dc_capture_capture(struct dc_capture *capture, HWND window);
|
|
extern void dc_capture_render(struct dc_capture *capture, gs_effect_t *effect);
|
|
|
|
extern gs_effect_t *create_opaque_effect(void);
|