Advertisement Jump to content
Sign in to follow this  

Correct texture mapping protocol

This topic is 1793 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi All,


I am following the Microsoft example of applying textures to primitives:

I am trying to turn it into oop code so I can adapt it to my 'game'. I am wondering how to take out the CreateDDSTextureFromFile() function and have it called first, to initialize the texture into memory.


I thought simply having a function which ONLY calls CreateDDSTextureFromFile(), to load up individual texture sheets before anything else, but when I do that in this example it just draws a black quad (I turned it from a cube into a 2d quad).


Where have I gone wrong in my thinking? EDIT - I am an idiot, was just using the wrong file path to load the texture. It works now. But part two of my question remains.



P.S Unrelated to this issue but roughly 50% of the time when I run this code the program will crash and point to

	CBNeverChanges cbNeverChanges;
->	cbNeverChanges.mView = XMMatrixTranspose(g_View);
	g_pImmediateContext->UpdateSubresource(g_pCBNeverChanges, 0, nullptr, &cbNeverChanges, 0, 0);

with an access violation reading location 0xFFFFFFFF.


But I can just re-run the build and it will again either crash or work fine. any insight onto what would cause temperamental crashes?


Edit, the original source file is from here: and I am using example07

Edited by SteveHatcher

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!