Nick Prat
Nick Prat

Reputation: 21

DirectX: Graphics are distored when run out of Visual Studio

When I run my exe outside of visual studio, with a release build, the graphics are very distorted. It works completely fine when I run it in debug mode, but I can't seem to figure out why it happens in release mode. It works fine if I start the application through visual studio though, which is the strange part. If you guys have any suggestion, I would really appreciate it. Thanks!

Expected Result (Debug Build): https://i.sstatic.net/XH0cJ.png

Actual Result (Release Build): https://i.sstatic.net/5lms0.png

(I don't have enough reputation to post picture)

Upvotes: 2

Views: 142

Answers (2)

axon
axon

Reputation: 1200

Are you copying your geometry into the Vertex Buffer once at start-up or once every frame? Check that your pointer to the geometry isn't pointing to something temporary; sometimes this will work ok in Debug mode (or Release mode when the debugger is attached) but will be optimized out when running as a standalone exe in release mode.

Upvotes: 0

Ben Brammer
Ben Brammer

Reputation: 998

There are two variables that are possibly not what you believe them to be. First, and less likely, is that there is code preprocessed differently than you believe. I don't believe that to be the case because if that were the whole problem, you'd see the same behavior in and out of VS. It may still be a factor, though. More likely, the culprit is in your configuration management; frequently, when you add projects or configurations, the configuration uses unexpected configurations from different projects. Check to see that your release configuration is using all release configuration versions of each project.

Other variables might be command line parameters and path differences, but I'm sure you've already checked that :)

Good luck.

Upvotes: 1

Related Questions