文章 "DirectX 教程(第一部分):绘制第一个三角形"

 

新文章 DirectX 教程(第一部分):绘制第一个三角形已发布:

这是一篇关于 DirectX 的介绍性文章,介绍了使用 API 进行操作的细节。 它应有助于理解其组件的初始化顺序。 本文包含一个如何编写 MQL5 脚本的示例,该脚本使用 DirectX 渲染一个三角形。

渲染图元是图形 API 的主要目的。 现代显卡适用于快速渲染大量三角形。 实际上,在计算机图形学的当前发展阶段,绘制 3D 对象最有效的方法是以多边形创建曲面。 曲面可由三个指定的点来定义。 3D 建模软件通常使用矩形,但图形卡仍会强制把多边形转换成三角形。

网格

三角形网格

作者:Rorschach

 
 

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


.

附加的文件:
DX.mq5  21 kb
 
Rorschach #:

.

Sir:

Your this DX.mq5 issame as DXTutorial.mq5, and received 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



请使用手机"扫一扫" 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. 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           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. 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 !

 
okwh #:

Thanks again !

 When set   Force WARP   for MT, run OK !

My pleasure!