Jump to content

  • Log In with Google      Sign In   
  • Create Account


D3D11 SDK Tutorial question


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

#1 keiokrysha   Members   -  Reputation: 106

Like
0Likes
Like

Posted 13 September 2012 - 01:32 AM

In the SDK tutorials, some of them use .fx files to store shaders information, take Tutorial04 as an example, it has the .fx file "Tutorial04.fx",
Can anybody tell me why if I create a .fx file with the same content(copy/paste from "Turotial04.fx") but different title, then change the two places in the code where the file title are used:
[source lang="cpp"]hr = CompileShaderFromFile( L"Tutorial04.fx", "PS", "ps_4_0", &pPSBlob );[/source]
Change L"Tutorial04.fx" to new .fx file tile
[source lang="cpp"]hr = CompileShaderFromFile( L"Tutorial04.fx", "VS", "vs_4_0", &pVSBlob );[/source]
Change L"Tutorial04.fx" to new .fx file title
Then the program pops up an error message? "
[source lang="java"]if( FAILED( hr ) ) { MessageBox( NULL, L"The FX file cannot be compiled. Please run this executable from the directory that contains the FX file.", L"Error", MB_OK ); return hr; }[/source]

That says only a .fx file with title "Tutorial04" will work here, I guess it has something to do with the resource.h and Tutorial04.rc files, but I do not know what it is. Can anybody help? Thanks.

Sponsor:

#2 Erik Rufelt   Crossbones+   -  Reputation: 3041

Like
1Likes
Like

Posted 13 September 2012 - 06:10 AM

If you're lucky it might just be in the wrong folder. If you run your app from Visual Studio the current working directory where the app will look for files is in the project folder.
Usually it looks like this by default when you create a new project:
- Visual Studio Projects
- - ProjectName
- - - ProjectName
- - - - program.cpp
- - - - Tutorial04.fx

If you double-click your built .exe in Windows, place the .fx file in the same folder as the .exe instead.

Edited by Erik Rufelt, 13 September 2012 - 06:11 AM.


#3 keiokrysha   Members   -  Reputation: 106

Like
0Likes
Like

Posted 13 September 2012 - 08:41 AM

Hi Erik Rufelt, you are absolutely correct, I checked the project folder and there was not any .fx file, it was on my desktop, I just dragged it into the "Solution Explorer" in my Visual Studio 2010, after I put it in the project folder, the program can continue, however I am encoutering a new problem now, which I have post in another thread. Thank you very much!




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