Skip to content

DDS.h can't compile on it's own anymore #97

Description

@ianthomson

Removal of #include <dxgiformat.h> (or <d3d11_x.h>) from DDS.h causes it to no longer have all the includes it needs to define the structures within it. Is this intended? Is there a guideline to prerequisite includes you follow that is satisfied by this change? It is a minor change on our codebase to support it, but goes against how we ask our .h to be compilable on their own.
(Update : and #include <stdint.h>)

Activity

  1. walbourn commented on May 4, 2018

    @walbourn
    Collaborator

    The problem is that exactly which file it should include depends on the platform and which version of Direct3D you are using. I resync'd the DDS.H file so it could be shared between DirectXTex, DirectX Tool Kit for DX 11, and DirectX Tool Kit for DX 12 by just copying it between them.

    For 'internal' implementation header files, I rely on the DirectXTexP.h or pch.h to get the global headers, which if you look is a bit complicated for 'all cases':

    #if defined(_XBOX_ONE) && defined(_TITLE)
    #include <d3d12_x.h>
    #include <d3d11_x.h>
    #elif (_WIN32_WINNT >= _WIN32_WINNT_WIN10)
    #include <d3d12.h>
    #include <d3d11_4.h>
    #else
    #include <d3d11_1.h>
    #endif
    

    So while I generally agree with Lakos-style guidance here, for this file that I try to keep in sync across so many depos I just kept it simple.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ddsDirectDraw Surface (DDS)question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions