static void d3d8_capture(IDirect3DDevice8 *device, IDirect3DSurface8 *backbuffer) { if (capture_should_stop()) { d3d8_free(); } if (capture_should_init()) { d3d8_init(device); } if (capture_ready()) { d3d8_shmem_capture(device, backbuffer); } }
static void gl_capture(HDC hdc) { static bool functions_initialized = false; static bool critical_failure = false; if (critical_failure) { return; } if (!functions_initialized) { functions_initialized = init_gl_functions(); if (!functions_initialized) { critical_failure = true; return; } } /* reset error flag */ glGetError(); if (capture_should_stop()) { gl_free(); } if (capture_should_init()) { if (gl_init(hdc) == INIT_SHTEX_FAILED) { data.shmem_fallback = true; gl_init(hdc); } } if (capture_ready() && hdc == data.hdc) { uint32_t new_cx; uint32_t new_cy; /* reset capture if resized */ get_window_size(hdc, &new_cx, &new_cy); if (new_cx != data.base_cx || new_cy != data.base_cy) { if (new_cx != 0 && new_cy != 0) gl_free(); return; } if (data.using_shtex) gl_shtex_capture(); else gl_shmem_capture(); } }
static void d3d9_capture(IDirect3DDevice9 *device, IDirect3DSurface9 *backbuffer) { if (capture_should_stop()) { d3d9_free(); } if (capture_should_init()) { d3d9_init(device); } if (capture_ready()) { if (data.device != device) { d3d9_free(); return; } if (data.using_shtex) d3d9_shtex_capture(backbuffer); else d3d9_shmem_capture(backbuffer); } }