Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actualqorthos

Posted 29 January 2013 - 08:43 AM

Gentlemen, thank you for your time.

 

Also MapSubresource returns the data stream you should write to. Your old one is no good.

 

Ah geez, I didn't even see that the method had a return value.  

 

To get more detailed error information, you'll want to create your device with the DeviceCreationFlags.Debug flag passed to the constructor. If you do this and enable native code debugging (it's a checkbox under the Debug section of your project properties) you'll get get descriptive error and warning messages in the debugger output window. In cases like these they will usually tell you exactly what you're doing wrong. In this particular case you probably just need to pass MapMode.WriteDiscard instead of MapMode.Write. WriteDiscard is the common pattern for dynamic resources, where you invalidate the previous contents and completely fill the buffer with new contents. Also you may know this already, but if you'd like you can put both your world matrix and your color in the same constant buffer.

 

The MapMode changed fixed the crashing problem (could have sworn I checked that before posting here, but it looks like I done missed it.  I checked for an option to enable native code debugging but didn't find it.  Is that an option available for Visual Studio Express?


#1qorthos

Posted 29 January 2013 - 08:43 AM

Also MapSubresource returns the data stream you should write to. Your old one is no good.

 

Ah geez, I didn't even see that the method had a return value.  

 

To get more detailed error information, you'll want to create your device with the DeviceCreationFlags.Debug flag passed to the constructor. If you do this and enable native code debugging (it's a checkbox under the Debug section of your project properties) you'll get get descriptive error and warning messages in the debugger output window. In cases like these they will usually tell you exactly what you're doing wrong. In this particular case you probably just need to pass MapMode.WriteDiscard instead of MapMode.Write. WriteDiscard is the common pattern for dynamic resources, where you invalidate the previous contents and completely fill the buffer with new contents. Also you may know this already, but if you'd like you can put both your world matrix and your color in the same constant buffer.

 

The MapMode changed fixed the crashing problem (could have sworn I checked that before posting here, but it looks like I done missed it.  I checked for an option to enable native code debugging but didn't find it.  Is that an option available for Visual Studio Express?


PARTNERS