Files
mql5-skills/skills/mql5/references/docs/31-directx/1067-directx-dxcontextcreate.md
T
2026-06-23 21:47:51 +08:00

34 lines
1.1 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# DXContextCreate
Creates a graphic context for rendering frames of a specified size.
```
int  DXContextCreate(
   uint  width,      // width in pixels
   uint  height      // height in pixels
   );
```
Parameters
width
[in]  Frame width in pixels.
height
[in]  Frame height in pixels.
Return Value
A handle for a created context or INVALID_HANDLE in case of an error. To receive an [error](/en/docs/constants/errorswarnings/errorcodes) code, the [GetLastError()](/en/docs/check/getlasterror) function should be called.
Note
All graphical objects created using the [DXBufferCreate](/en/docs/directx/dxbuffercreate), [DXInputCreate](/en/docs/directx/dxinputcreate), [DXShaderCreate](/en/docs/directx/dxshadercreate) and [DXTextureCreate](/en/docs/directx/dxtexturecreate) functions can be used only in a graphic context they were created in.
A frame size can subsequently be changed to [DXContextSetSize()](/en/docs/directx/dxcontextsetsize).
A created handle that is no longer in use should be explicitly released by the [DXRelease()](/en/docs/directx/dxrelease) function.