Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

DirectXMath as a C++ module

未关闭
#349 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
活跃
技术栈
cpp

调研方向

Start by reading DirectXMath.h and the proposed DirectXMath.ixx contents, then inspect DirectXPackedVector.h and the mentioned SHMath, Stereo3D, and XDSP components. Done means the module structure, standard-library imports, export granularity, and Windows SDK or cppwinrt integration questions are resolved and an agreed module design is documented.

由索引模型根据 Issue 内容生成。

描述

A few months ago, I designed the winrt module for C++/WinRT. C++/WinRT depends on DirectXMath, so I hope DirectXMath can also be modularized. This would help make the winrt module cleaner and compilation faster. Thanks to the high quality of DirectXMath, modularizing it is easy, but some decisions need to be discussed.

Overall, the following changes need to be made:

  1. Provide a macro to disable the inclusion of all standard library headers in DirectXMath.h (for example, XM_IMPL_MODULE).
  2. Create the following DirectXMath.ixx:
    module;
    #include "sal.h"
    #include <intrins.h>
    #include <cassert>
    export module DirectXMath;
    import std;
    #define XM_IMPL_MODULE
    export
    {
    extern "C++"
    {
    #include "DirectXMath.h"
    }
    }
    
    extern "C++" is used so that when the header file and the module are used at the same time, the same functions can be merged and ODR violations can be avoided.

Once the details are settled, I can implement it. Any questions are welcome.

My questions:

  1. I hope to avoid using C standard library headers, and instead use the suffixless headers of the C++ standard library, and complete the std:: qualification for these types. This is to avoid using the std.compact module.
  2. Are fine-grained exports needed?
  3. DirectXPackedVector.h is not in DirectXMath.h. Should it be part of DirectXMath.ixx or a separate module?
  4. How should SHMath, Stereo3D, and XDSP be handled?
  5. Can the Windows SDK package the DirectXMath module?
主要语言
C++
星标
1.8k
派生
262
平均合并
3 天 12 小时
30 天内合并 PR
5

环境准备

我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/DirectXMath 的其他 Issue

查看 microsoft/DirectXMath 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。