Jump to content

  • Log In with Google      Sign In   
  • Create Account

Window appears only for a brief moment


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
3 replies to this topic

#1 null434   Members   -  Reputation: 133

Like
0Likes
Like

Posted 20 October 2013 - 05:36 AM

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.
 

Attached Files



Sponsor:

#2 Migi0027   Crossbones+   -  Reputation: 2134

Like
0Likes
Like

Posted 20 October 2013 - 06:22 AM

(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?

Edited by Migi0027, 20 October 2013 - 06:23 AM.

Hi! Cuboid Zone
The Rule: Be polite, be professional, but have a plan to steal all their shaders!

#3 Alessio1989   Members   -  Reputation: 2133

Like
0Likes
Like

Posted 20 October 2013 - 07:23 AM

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.


"Software does not run in a magical fairy aether powered by the fevered dreams of CS PhDs"


#4 Kjell Andersson   Members   -  Reputation: 428

Like
1Likes
Like

Posted 21 October 2013 - 12:47 PM

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).






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.



PARTNERS