- DXContextCreate
- DXContextSetSize
- DXContextGetSize
- DXContextClearColors
- DXContextClearDepth
- DXContextGetColors
- DXContextGetDepth
- DXBufferCreate
- DXTextureCreate
- DXInputCreate
- DXInputSet
- DXShaderCreate
- DXShaderSetLayout
- DXShaderInputsSet
- DXShaderTexturesSet
- DXDraw
- DXDrawIndexed
- DXPrimiveTopologySet
- DXBufferSet
- DXShaderSet
- DXHandleType
- DXRelease
Working with DirectX
DirectX 11 functions and shaders are designed for 3D visualization directly on a price chart.
Creating 3D graphics requires a graphic context (DXContextCreate) with the necessary image size. Besides, it is necessary to prepare vertex and index buffers (DXBufferCreate), as well as create vertex and pixel shaders (DXShaderCreate). This is enough to display graphics in color.
The next level of graphics requires the inputs (DXInputSet) for passing additional rendering parameters to shaders. This allows setting the camera and 3D object positions, describe light sources and implement mouse and keyboard control.
Thus, the built-in MQL5 functions enable you to create animated 3D charts directly in MetaTrader 5 with no need for third-party tools. A video card should support DX 11 and Shader Model 5.0 for the functions to work.
To start working with the library, simply read the article How to create 3D graphics using DirectX in MetaTrader 5.
Function |
Action |
---|---|
Creates a graphic context for rendering frames of a specified size |
|
Changes a frame size of a graphic context created in DXContextCreate() |
|
Gets a frame size of a graphic context created in DXContextCreate() |
|
Sets a specified color to all pixels for the rendering buffer |
|
Clears the depth buffer |
|
Gets an image of a specified size and offset from a graphic context |
|
Gets the depth buffer of a rendered frame |
|
Creates a buffer of a specified type based on a data array |
|
Creates a 2D texture out of a rectangle of a specified size cut from a passed image |
|
Creates shader inputs |
|
Sets shader inputs |
|
Creates a shader of a specified type |
|
Sets vertex layout for the vertex shader |
|
Sets shader inputs |
|
Sets shader textures |
|
Renders the vertices of the vertex buffer set in DXBufferSet() |
|
Renders graphic primitives described by the index buffer from DXBufferSet() |
|
Sets the type of primitives for rendering using DXDrawIndexed() |
|
Sets a buffer for the current rendering |
|
Sets a shader for rendering |
|
Returns a handle type |
|
Releases a handle |