DirectXTK | DirectX Tool Kit ( aka DirectXTK | Runtime Evironment library

 by   microsoft C++ Version: apr2023 License: MIT

kandi X-RAY | DirectXTK Summary

kandi X-RAY | DirectXTK Summary

DirectXTK is a C++ library typically used in Server, Runtime Evironment applications. DirectXTK has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

The DirectX Tool Kit (aka DirectXTK) is a collection of helper classes for writing DirectX 11.x code in C++
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              DirectXTK has a medium active ecosystem.
              It has 2312 star(s) with 498 fork(s). There are 203 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 29 open issues and 258 have been closed. On average issues are closed in 22 days. There are 2 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of DirectXTK is apr2023

            kandi-Quality Quality

              DirectXTK has 0 bugs and 0 code smells.

            kandi-Security Security

              DirectXTK has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              DirectXTK code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              DirectXTK is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              DirectXTK releases are available to install and integrate.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of DirectXTK
            Get all kandi verified functions for this library.

            DirectXTK Key Features

            No Key Features are available at this moment for DirectXTK.

            DirectXTK Examples and Code Snippets

            No Code Snippets are available at this moment for DirectXTK.

            Community Discussions

            QUESTION

            Applying a texture to a custom effect using DirectXTK results in the texture being stretched
            Asked 2022-Feb-14 at 01:59

            I'm trying to apply a custom effect using the DirectXTK. The effect is supposed to be an "unlit" shader with just one texture. But for some reason, the texture is stretched across the model. I looked in renderdoc and the texturecoordinates appear to be loaded correctly so i'm not sure what's going on.

            UnlitEffect.h ...

            ANSWER

            Answered 2022-Feb-14 at 01:59

            Chuck Walbourn was correct. My issue was that I was normalizing my texture coordinates in the pixel shader. The correct code is return BaseColor.Sample(SampleType, vout.TexCoord);

            Source https://stackoverflow.com/questions/70825685

            QUESTION

            Can I command CMake to not generate a Build system, but compile/link only?
            Asked 2022-Jan-21 at 11:49

            I am working on a small-ish scale project.

            ...

            ANSWER

            Answered 2022-Jan-21 at 11:49

            Is it possible to not generate build systems for everything whats under lib/ and instead compile and link the library directly into the Engine project?

            This sounds like an XY problem. What do you really want to do?

            1. Are you trying to avoid CMake spending time configuring those projects? If they're really optional, then add option()s to disable them.
            2. Are you spending a lot of time rebuilding everything when you only want some parts? Let me point you to the cmake --build ... --config --target Game command. That will build only what is needed for target Game.
            3. Something else?

            But this question of not "generat[ing] build systems" is ill-formed. CMake is a build system generator. How do you make a C++ compiler not compile C++?

            Source https://stackoverflow.com/questions/70799944

            QUESTION

            How to access individual frames of an animated GIF loaded into a ID3D11ShaderResourceView?
            Asked 2021-Sep-01 at 02:40

            I used CreateWICTextureFromFile() from DirectXTK to load an animated GIF texture.

            ...

            ANSWER

            Answered 2021-Sep-01 at 02:40

            The CreateWICTextureFromFile function in DirectX Tool Kit (a.k.a. the 'light-weight' version in the WICTextureLoader module) only loads a single 2D texture, not multi-frame images like animated GIF or TIFF.

            The DirectXTex function LoadFromWICFile can load multiframe images if you give it the WIC_FLAGS_ALL_FRAMES flag. Because the library is focused on DirectX resources, it will resize them all to match the first image size.

            That said, what WIC is going to return to you is a bunch of raw frames. You have query the metadata from WIC to actually get the animation information, and it's a little complicated to reconstruct. I have a simple implementation in the DirectXTex texassemble tool you can reference here. I focused on converting the animated GIF into a 'flip-book' style 2D texture array which is quite a bit larger.

            The sample I referenced can be found on GitHub

            Source https://stackoverflow.com/questions/68978930

            QUESTION

            DirectX bounding box drawing
            Asked 2021-Jun-06 at 19:15

            The idea is to draw the bounding box as 2D corners on the screen after my DiretXTK model is displayed.

            I got the bounding box corners form DirectXKT in a std::vector, so

            ...

            ANSWER

            Answered 2021-Jun-06 at 19:15

            In the DirectX Tool Kit wiki, I have a DebugDraw helper which is specifically designed for drawing DirectXMath bounding volumes using DirectX Tool Kit's PrimitiveBatch.

            See this topic page.

            You may also want to take a look at the Collision sample.

            Source https://stackoverflow.com/questions/67858354

            QUESTION

            DirectX and DirectXTK translation limits
            Asked 2021-Jun-03 at 23:54

            I use DirectX Toolkit to display a 3d model, following the 'Rendering the model' and my pyramid is displayed:

            When trying to transform the object, the scaling and rotation work well but I'm not sure how to move the object (translate) around. Basically I'm looking for an algorithm that determines, given the current camera position, focus, viewport and the rendered model (which the DirectX toolkit gives me the bounding box so it's "size") the minimum and maximum values for XYZ translation so the object remains visible.

            The bounding box is always the same, no matter the view port size, so how do I compare it's size against my viewport?

            Please excuse my newbiness, I'm not a 3D developer, at least yet.

            The "Simple Rendering" example which draws a triangle:

            ...

            ANSWER

            Answered 2021-Jun-03 at 23:54

            TL:DR: To move your model around the world, create a matrix for the translation and set it as the world matrix with SetWorld.

            Source https://stackoverflow.com/questions/67792814

            QUESTION

            D3D11 DirectXTK Spritebatch fullscreen issues
            Asked 2021-May-04 at 21:09

            I am working on a low resolution 2D game using the DirectXTK and Spritebatch. Everything works fine in windowed mode, however whenever I start or switch to fullscreen the image is blurred to stretch the backbuffer to fit the screen.

            I Initialise the device and swap chain with these settings:

            ...

            ANSWER

            Answered 2021-May-04 at 21:09

            Thank you to Chuck Walbourn for pointing me to the DirectXTK templates.

            After changing my Graphics class to match the template, the full screen on longer blurs.

            Although I am not changing the backbuffer screen resolution It needs to be unchanged so that the low resolution is stretched to fit the window. If I change the backbuffer it is difficult to see the game because it is then rendered so small.

            It appears the reason the fullscreen mode is not blurred when using the template is because it is actually borderless windowed mode and not exclusive fullscreen.

            Source https://stackoverflow.com/questions/66518222

            QUESTION

            DirectXTK 3D audio uses only left channel
            Asked 2021-Apr-15 at 05:29

            I've decided to try the DirectXTK12 audio and it's working fine except for the 3D sound. I'm following the guide from wiki but the sound is always in the left speaker no matter how I position the listener/emitter. What's wrong? My code looks like this:

            ...

            ANSWER

            Answered 2021-Apr-11 at 07:51

            I've fixed the issue by converting used Sound.wav to mono (1 channel) sound.

            Source https://stackoverflow.com/questions/66841890

            QUESTION

            "Component not found" error when I try to load a PNG texture (Direct3D 11)
            Asked 2021-Jan-21 at 04:31

            I am trying to load a texture from a .GLB model in Direct3D 11. The image data is encoded as PNG (I checked the buffer and I could see the file signature in the first 4 bytes). When I try to execute my code, there is an HRESULT returning a WIC "component not found" error (0x88982F50). This is when I try to use WIC from a regular C++ 64-bit Windows API application. Is a component not installed on my machine? Should I use a different approach?

            Here is the relevant code:

            ...

            ANSWER

            Answered 2021-Jan-20 at 22:28

            I found what was wrong. Besides the fact that I was not calling CoInitialize (which I should), I was not referencing the buffer right.

            Instead of:

            Source https://stackoverflow.com/questions/65818179

            QUESTION

            Allocating memory for a texture
            Asked 2020-Dec-26 at 20:59

            I've been looking at the WICTextureLoader.cpp file that is part of the DirectX Toolkit. And I'm trying to understand this bit of code:

            https://github.com/microsoft/DirectXTK/blob/master/Src/WICTextureLoader.cpp#L530

            ...

            ANSWER

            Answered 2020-Dec-26 at 20:59

            bpp here is "bits per pixel". The expression rounds up to the next whole byte (8 bits).

            This is a classic C pattern for "align up" for power-of-2 alignments, here expressed as a C++ template.

            Source https://stackoverflow.com/questions/65451037

            QUESTION

            Is there a way to include both WICTextureLoader and DDSTextureLoader without 'redefinition' errors?
            Asked 2020-Dec-23 at 12:25

            I'm trying to load a DDS texture. For that, I'm using DDSTextureLoader11 provided by DirectXTex. I already am using another texture loader from the same library - WICTextureLoader11.

            The problem is, I don't get errors with WICTextureLoader11, however I do get errors either when including only DDSTextureLoader11, or when I use both of them.

            This is some of the errors I get when I include both or only DDSTextureLoader11:

            /WICTextureLoader11.cpp:51:17: error: redefinition of 'SetDebugObjectName'

            /WICTextureLoader11.cpp:273:17: error: redefinition of 'MakeSRGB'

            /WICTextureLoader11.cpp:747:17: error: no matching function for call to 'SetDebugObjectName'

            /DDSTextureLoader.h:156:35: error: redefinition of default argument

            I first thought that it was because both WICTextureLoader and DDSTextureLoader contain same functions, so when including both they "overlap" (i.e. compiler detects redefinition).

            I'm using a batchfile to compile my project, where I link against both DirectXTex and DirectXTK. I also tried to include DDSTextureLoader, but without success: I've read the GitHub page of the DirectXTK's DDSTextureLoader, where I include that gives me a link error, which I guess is related to the incorrect call of the function CreateDDSTextureFromFile, so right now I'm trying to find a way to make the right call to the function.

            Edit: no, it seems like I'm making the right function call. The wrong thing is that I'm trying to include DDSTextureLoader.h, but it also wants DDSTextureLoader.cpp. However, the errors occur when I include DDSTextureLoader.cpp, such as:

            'DDSTextureLoader.cpp': call to 'BitsPerPixel' is ambiguous -> 'DirectXTex.h' or 'DDSTextureLoader' error: redefinition of 'SetDebugTextureInfo', previous definition in 'WICTextureLoader'.

            I think, what I need is to include the .cpp file, but somehow get rid of the errors.

            Edit2: So far, I tried to get rid of DirectXTex (I don't remember why I even needed it), and I've included WICTextureLoader.cpp and DDSTextureLoader.cpp. I downloaded and built the DirectXTK library, then included #pragma comment(lib, "directxtk.lib"). Now, the weird thing is: when I compile with Clang++, it doesn't throw any errors (but the program crashes after a second-long gray screen), however when I compile with cl (through vcvars64), I get fatal error LNK1104: cannot open file 'directxtk.lib'.

            Edit3: Wait, I don't even know why I even need the directxtk.lib. So I removed it, and it compiles, but nothing works. I thought I needed that static library to resolve external symbol errors when trying to include the header (XXXTextureLoader.h), instead of the source (XXXTextureLoader.cpp).

            Edit4: Wait,wait,wait. I think, I'm going crazy. Now, if I include only WICTextureLoader.cpp (and remove DDSTextureLoader.cpp), it gives me this error: (directxtk.lib) mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease'. I don't know why I did that, but I'm crazy now, I blindly brute-force my way through resolving this cursed issue. Why can't I just throw both headers in my directory and just simply include them? Is there a way to do so? What should I do? Why doesn't DirectXTK/Tex pages on GitHub give a step-by-step guide to how to use these things? The examples drive me crazy!

            Please, help me resolve this what seems to be a simple issue.

            Edit5: The last thing that I tried is to include DDSTextureLoader.h and WICTextureLoader.h, and use directxtk.lib, but it gives me these errors:

            directxtk.lib(DDSTextureLoader.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in main-3dacd8.o

            directxtk.lib(pch.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in main-3dacd8.o

            LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library

            I don't use VS, so I don't know how to use /NODEFAULTLIB.

            ...

            ANSWER

            Answered 2020-Dec-23 at 04:01

            You have three choices for loading DDS and other image files with WIC:

            • Use DirectXTex (the library)

            • Use DDSTextureLoader/WICTextureLoader (the standalone versions)

            • or use DirectX Tool Kit (the library).

            There's no reason to use more than one of them in the same program, and it's going to conflict if you try. See this post.

            Unless you are writing a texture processing tool, or need support for the plethora of legacy DDS pixel formats, using DirectX Tool Kit is usually the simplest. The tutorials for DirectX Tool Kit covers this pretty well.

            The error you are getting indicates something much more basic to using Visual C++. The DirectXTex, DirectXTK libraries build using the recommended "Multithreaded DLL" version of the C/C++ Runtime (i.e. /MDd and /MD).

            The error indicates your program is building with "Statically linked" version of the C/C++ Runtime.

            See Microsoft Docs

            You didn't mention what compiler toolset you are using other than "not VS".

            See directx-vs-templates for a bunch of 'basic device and present loop' samples. If you don't use VS, there are 'CMakeLists.txt' available on that site.

            Source https://stackoverflow.com/questions/65409371

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install DirectXTK

            You can download it from GitHub.

            Support

            Documentation is available on the GitHub wiki.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link