Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

DirectXMath as a C++ module

Aperta
#349 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
cpp

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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?
Lingua principale
C++
Stelle
1.8k
Fork
262
Merge medio
3g 12h
PR unite (30g)
5

Preparare l'ambiente

Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/DirectXMath

Tutte le issue di microsoft/DirectXMath

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.