Discussion of article "DirectX Tutorial (Part I): Drawing the first triangle"

 

New article DirectX Tutorial (Part I): Drawing the first triangle has been published:

It is an introductory article on DirectX, which describes specifics of operation with the API. It should help to understand the order in which its components are initialized. The article contains an example of how to write an MQL5 script which renders a triangle using DirectX.

Rendering primitives is the primary purpose of the graphics API. Modern video cards are adapted for quick rendering of a large number of triangles. Actually, at the current computer graphics development stage, the most effective way to draw 3D objects is to create a surface from polygons. A surface can be described by specifying only three points. 3D modeling software often use rectangles, but the graphics card will still force the polygons into triangles.

Mesh

Mesh of triangles

Author: Rorschach

 
MetaQuotes:

A new article DirectX Tutorial (Part 1): Drawing the First Triangle has been released:

Author: Rorschach

 
MetaQuotes:

New article DirectX Tutorial (Part I): Drawing the first triangle has been published:

Author: Rorschach

Good article
 
The article is very good and very well written. However, as a tip for future articles, I would like you to attach the source code used in the explanation, so that those who want to see it actually working will be even more interested in the article ... REMEMBER: Many people are just starting to learn MQL5, and won't be able to follow the explanation to the point of making a working code, which will end up discouraging them from learning to programme in MQL5 ... especially those with very little programming experience. Here's the tip ... 😁👍
 
Daniel Jose learn MQL5, and won't be able to follow the explanation to the point of making a working code, which will end up discouraging them from learning to programme in MQL5 ... especially those with very little programming experience. Here's the tip ... 😁👍
Thanks for the feedback. All code is presented in the article, nothing has been cut.
 

not run ?

2023.05.05 15:03:12.927 DXTutorial ( EURUSD,M1) Error: failed to create graphics context: 5151


 
okwh #:

not run ?

2023.05.05 15:03:12.927 DXTutorial (EURUSD,M1) Error: failed to create graphics context: 5151


.

Files:
DX.mq5  21 kb
 
Rorschach #:

.

Sir:

Your this DX.mq5 issame as DXTutorial.mq5, and received the same error : Ошибка, не удалось создать графический контекст: 5151


I checked code and fond that DXContextCreate function fail ! all samples at https://www.mql5.com/en/articles/7708  gave same error.

When I change code as

   Print("Before DXContextCreate");
   m_dx_context = DXContextCreate(m_width, m_height);
   if(m_dx_context == INVALID_HANDLE)
     {
      Print("Ошибка, не удалось создать графический контекст: ", GetLastError());
      return(false);
     }
   Print("After DXContextCreate");

received that

2023.05.09 18:32:21.723 DX (EURUSD,H1) Before DXContextCreate

2023.05.09 18:32:21.727 DX (EURUSD,H1) Ошибка, не удалось создать графический контекст: 5151


I can not debug it , my OS is windows server 2019 and display adapter is Nivida Quadro FX 1700, and DXdiag told that it support DirectX12



Please use your mobile phone to "swipe" x
How to create 3D graphics using DirectX in MetaTrader 5
How to create 3D graphics using DirectX in MetaTrader 5
  • www.mql5.com
3D graphics provide excellent means for analyzing huge amounts of data as they enable the visualization of hidden patterns. These tasks can be solved directly in MQL5, while DireсtX functions allow creating three-dimensional object. Thus, it is even possible to create programs of any complexity, even 3D games for MetaTrader 5. Start learning 3D graphics by drawing simple three-dimensional shapes.
 
okwh #:
Quadro FX 1700

The Quadro FX 1700 was an enthusiast-class professional graphics card by NVIDIA, launched on September 12th, 2007. Built on the 80 nm process, and based on the G84 graphics processor, in its G84-875-A2 variant, the card supports DirectX 11.1. Built on the 80 nm process, and based on the G84 graphics processor, in its G84-875-A2 variant, the card supports DirectX 11.1. Even though it supports DirectX 11, the feature level is only 10_0%. Even though it supports DirectX 11, the feature level is only 10_0 Even though it supports DirectX 11, the feature level is only 10_0 , which can be problematic with many DirectX 11 & DirectX 12 titles.

Try this.


DirectX
DirectX
  • 2020.04.22
  • www.mql5.com
Привет, кто-нибудь уже разобрался с directx, там есть DirectCompute...
 
Rorschach #:
problematic

Thanks!

yes, I find it, FX 1700's DirectX-feature-level only support to 10.0, it is an old diaplay adapter .

DXDiag: DirectX Version: DirectX 12, Chip type: Quadro FX 1700 Driver Date/Size: 2016-10-18 8:00:00, 17559200 bytes

DDI Version: 11.1 Feature Levels: 10_0,9_3,9_2,9_1 & nbsp; Driver Model: WDDM 1.2

I will try it, otherwise I maybe change my diaplay adapter at this server PC.


I test the code at my notepad PC with windows 11 OS, all run OK.

 
Rorschach #:

The Quadro FX 1700 was an enthusiast-class professional graphics card by NVIDIA, launched on September 12th, 2007. Built on the 80 nm process, and based on the G84 graphics processor, in its G84-875-A2 variant, the card supports DirectX 11.1. Built on the 80 nm process, and based on the G84 graphics processor, in its G84-875-A2 variant, the card supports DirectX 11.1. Even though it supports DirectX 11, the feature level is only 10_0%. Even though it supports DirectX 11, the feature level is only 10_0 Even though it supports DirectX 11, the feature level is only 10_0 , which can be problematic with many DirectX 11 & DirectX 12 titles.

Try this.


Thanks again !

When set Force WARP for MT, run OK !