jp9000 4f7ab552df Reimplement monitor capture
- Implement windows monitor capture (code is so much cleaner than in
   OBS1).  Will implement duplication capture later

 - Add GDI texture support to d3d11 graphics library

 - Fix precision issue with sleep timing, you have to call
   timeBeginPeriod otherwise windows sleep will be totally erratic.
2014-03-05 10:43:14 -07:00

40 lines
891 B
C

#pragma once
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <obs.h>
#define NUM_TEXTURES 2
struct dc_capture {
int cur_tex;
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, effect_t effect);
extern effect_t create_opaque_effect(void);