Jump to content

View more

Image of the Day

Inventory ! Va falloir trouver une autre couleur pour le cadre D: #AzTroScreenshot #screenshotsaturday https://t.co/PvxhGL7cOH
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Correct texture mapping protocol

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
No replies to this topic

#1 SteveHatcher   Members   

1236
Like
0Likes
Like

Posted 23 February 2014 - 12:28 AM

Hi All,

 

I am following the Microsoft example of applying textures to primitives: http://msdn.microsoft.com/en-us/library/windows/apps/jj552949.aspx

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.

 

Thanks

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: http://code.msdn.microsoft.com/windowsdesktop/Direct3D-Tutorial-Win32-829979ef and I am using example07


Edited by SteveHatcher, 23 February 2014 - 12:33 AM.





Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.