Window appears only for a brief moment

Started by
2 comments, last by Kjell Andersson 10 years, 5 months ago

I'm using visual studio c++ 2012 on windows 7 and directx 10. I copied the code from the tutorial in the directx sdk documention which produces a flat triangle on screen. I can successfully compile the code and see the result but when I sent the .exe and necessary .fx file to other computer, the user on the other side encountered a problem that the window appears and disappeared quickly after clicking the .exe. I've installed c++ redistributed 2012 x86 update 3 on that computer but it seems that's not where problem is.

Here's the shader code:

struct vin // The input to vertex shader
{
float4 pos : POSITION;
float4 col : COLOR;
};
struct vout // The output of vertex shader and input of pixel shader
{
float4 pos : SV_POSITION;
float4 col : COLOR;
};
//
// Vertex Shader
//
vout VS( vin Vin )
{
vout Vout;
Vout.pos = Vin.pos;
Vout.col = Vin.col;
return Vout;
}
//
// Pixel Shader
//
float4 PS( vout Vout) : SV_Target
{
return Vout.col;
}
technique10 Render
{
pass P0
{
SetVertexShader( CompileShader( vs_4_0, VS() ) );
SetPixelShader( CompileShader( ps_4_0, PS() ) );
}
}
And since the source code is too long, I added it as an attach file.
Advertisement

(It is most likely because of a crash in your application)

  • Have you compiled your source code in release mode or debug?
  • Is his GPU capable of processing dx 10 calls?
  • Do you compile to x86 or x64?
  • Try outputting a log file which contains all your steps when running, and see where it stops.
  • Does he have the DX10 runtimes?
  • Is there any kind of possibility of debugging the executable on his?

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

I know that my answer is take for granted, but have you debugged it?

Since the project is very short, you should be able to debug the project step-by-step very quickly.

Look at the function return value, look at the parameters of the functions that fail.

Visual studio, even the express edition, has a good graphics debugger, you should learn how to use it (at least the basis) before run into a project that cannot be debugged with a print function.

"Recursion is the first step towards madness." - "Skegg?ld, Skálm?ld, Skildir ro Klofnir!"
Direct3D 12 quick reference: https://github.com/alessiot89/D3D12QuickRef/

The most probable cause is that your friend is lacking runtime DLLs on his computer.

Also, be sure to not compile against debug runtimes (with respect to both DirectX and MSVCRT) - make a release build.

The debug runtimes are normally not installed if you are not a developer yourself.

The best way to find out what is missing on your friends computer, and what you made wrong with your build, is to use Dependency Walker (http://www.dependencywalker.com).

This topic is closed to new replies.

Advertisement