Add support for shared textures to graphics API

This commit is contained in:
jp9000
2014-10-13 21:41:09 -07:00
parent dc82e8d788
commit caa32cb6d1
8 changed files with 125 additions and 3 deletions

View File

@@ -1805,6 +1805,11 @@ extern "C" EXPORT bool device_gdi_texture_available(void)
return true;
}
extern "C" EXPORT bool device_shared_texture_available(void)
{
return true;
}
extern "C" EXPORT gs_texture_t *device_texture_create_gdi(gs_device_t *device,
uint32_t width, uint32_t height)
{
@@ -1860,3 +1865,19 @@ extern "C" EXPORT void gs_texture_release_dc(gs_texture_t *tex)
tex2d->gdiSurface->ReleaseDC(nullptr);
}
extern "C" EXPORT gs_texture_t *device_texture_open_shared(gs_device_t *device,
uint32_t handle)
{
gs_texture *texture = nullptr;
try {
texture = new gs_texture_2d(device, handle);
} catch (HRError error) {
blog(LOG_ERROR, "gs_texture_open_shared (D3D11): %s (%08lX)",
error.str, error.hr);
} catch (const char *error) {
blog(LOG_ERROR, "gs_texture_open_shared (D3D11): %s", error);
}
return texture;
}