> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XGEnableExclusiveLocking (XBOX One 系列)

> 啟用或停用紋理位址計算 API 的獨佔鎖定。

啟用或停用紋理位址計算 API 的獨佔鎖定。

<a id="syntaxSection" />

## 語法

```cpp theme={null}
void XGEnableExclusiveLocking(
         BOOL LocksEnabled
)  
```

<a id="ID4EG" />

### 參數

*LocksEnabled*\
類型：BOOL

\[in] **true** 表示在 **XGCreateTexture\*Computer** 和 **XGComputeTexture\*Layout** API 內啟用獨佔鎖定；**false** 表示停用這些 API 的獨佔鎖定。

<a id="ID4EG" />

### 傳回值

無。

<a id="remarks" />

## 備註

如果您需要在執行階段呼叫 [XGSSetHardwareVersion](/zh-TW/reference/graphics/xg__NR/functions/xgsethardwareversion) 函式以在硬體版本之間切換，請啟用獨佔鎖定，並使用 [XGEnterExclusiveLock](/zh-TW/reference/graphics/xg__NR/functions/xgenterexclusivelock) 和 [XGLeaveExclusiveLock](/zh-TW/reference/graphics/xg__NR/functions/xgleaveexclusivelock) 函式來同步處理 XG 紋理計算器物件的建立。

若要啟用獨佔鎖定，請在建立 D3D 裝置之前及建立任何紋理計算器之前呼叫 **XGEnableExclusiveLocking**。獨佔鎖定預設為停用。啟用時，XG 會在所有 **XGCreateTexture*Computer*** 和 **XGComputeTexture\*Layout** API 內取得關鍵區段。

<a id="requirements" />

## 需求

**標頭：** xg.h

**程式庫：** xg\_x.lib

**支援的平台：** XBOX One 系列

## 另請參閱

[XG 參考](/zh-TW/reference/graphics/xg__NR/xg_members)


## Related topics

- [NDA 主題目錄 - Microsoft Learn 線上連結](/zh-TW/nda/nda-topic-directory.md)
- [XInputEnable](/zh-TW/reference/input/xinputongameinput/functions/xinputenable.md)
- [XAppCaptureEnableRecord](/zh-TW/reference/system/xappcapture/functions/xappcaptureenablerecord.md)
- [XDisplayTryEnableHdrMode](/zh-TW/reference/system/xdisplay/functions/xdisplaytryenablehdrmode.md)
- [ACP_COMMAND_ENABLE_OR_DISABLE_XMA_CONTEXT](/zh-TW/reference/audio/acphal/structs/acp_command_enable_or_disable_xma_context.md)
