public final D3D11_MAPPED_SUBRESOURCE Map(ID3D11Resource resource, int subResource, ValuedEnum<D3D11_MAP> MapType, int MapFlags) {
D3D11_MAPPED_SUBRESOURCE mappedData = new D3D11_MAPPED_SUBRESOURCE();
// try {
int result = Map(pointerTo(resource), subResource, MapType, MapFlags, pointerTo(mappedData));
if(result != 0) {
throw new D3D11Exception("Could not map resource", result);
}
return mappedData;
// } finally {
// pp.release();