dc-capture.h 891 B

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