dc-capture.h 888 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #define WIN32_LEAN_AND_MEAN
  3. #include <windows.h>
  4. #include <obs-module.h>
  5. #define NUM_TEXTURES 2
  6. struct dc_capture {
  7. int cur_tex;
  8. gs_texture_t *textures[NUM_TEXTURES];
  9. bool textures_written[NUM_TEXTURES];
  10. int x, y;
  11. uint32_t width;
  12. uint32_t height;
  13. int num_textures;
  14. bool compatibility;
  15. HDC hdc;
  16. HBITMAP bmp, old_bmp;
  17. BYTE *bits;
  18. bool capture_cursor;
  19. bool cursor_captured;
  20. CURSORINFO ci;
  21. bool valid;
  22. };
  23. extern void dc_capture_init(struct dc_capture *capture, int x, int y,
  24. uint32_t width, uint32_t height, bool cursor,
  25. bool compatibility);
  26. extern void dc_capture_free(struct dc_capture *capture);
  27. extern void dc_capture_capture(struct dc_capture *capture, HWND window);
  28. extern void dc_capture_render(struct dc_capture *capture, gs_effect_t *effect);