Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

DirectXMath as a C++ module

Đang mở
#349 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Sôi nổi
Công nghệ
cpp

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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?
Ngôn ngữ chính
C++
Star
1.8k
Fork
262
Merge trung bình
3 ngày 12 giờ
Pull request đã merge (30 ngày)
5

Chuẩn bị môi trường

Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/DirectXMath

Tất cả issue của microsoft/DirectXMath

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.