Gaming.Xbox.XboxOne.x64\Layout\Image\Loose project subdirectory are deployed to the console. When you build a Microsoft Game Development Kit project for XBOX, compiled application files are automatically copied to this directory and deployed. To deploy additional game resources, such as textures and shaders, their files also need to be copied to the Loose subdirectory of the XBOX One XDK project.
The Loose directory is relative to the project directory. For example, if the project is stored in the c:\MyProjects\D3D12Game1\D3D12Game1 directory, the Loose directory is a subdirectory of the project, which is here: c:\MyProjects\D3D12Game1\D3D12Game1\Gaming.Xbox.XboxOne.x64\Layout\Image\Loose.
Any files placed in the Loose directory, either manually or as part of the build process, are deployed with your app.
Files in the Loose directory are deployed with the same relative path that they have in the Loose directory. For example, files in Loose\Models are deployed in a Models subdirectory on the console.
Files in the Loose directory aren’t deleted when building or cleaning the project unless they exist as content in the project (see Adding files to the project as follows).
There are three primary ways to add files to Gaming.Xbox.XboxOne.x64\Layout\Image\Loose.
Manually copying files
Manually copying files into theLoose directory causes them to be deployed with the project as long as they remain in the directory.
To add files manually
- Use xcopy to copy files from the project directory to the \Layout\Image\Loose directory.
Loose directory continue to be deployed as long as they’re in the directory. Files manually copied to the Loose directory aren’t deleted when the project is built or cleaned. To stop the files from being deployed, they must be deleted from the Loose directory.
Copying with a post-build event
Creating a post-build event in Visual Studio to copy files causes files to be copied to theLoose directory every time that you build your project. In addition, a post-build event can make use of $(ProjectDir) and $(LayoutDir), Visual Studio properties that identify the project directory and the layout directory, respectively.
For example, the following command line causes a file, MyPicture.bmp, to be copied from the project directory to \Image\Loose in the Layout directory, where deployment copies it to the console.
To add files by using a post-build event
- Open your project’s Property Pages dialog box. Under Build Events, select the Post-Build Event page.
- In Command Line, enter a command line that uses xcopy to copy files from the project directory to the Layout\Image\Loose directory.
Files that are copied to the
Loose directory with a post-build event continue to be deployed as long as they’re in the directory - even if the post-build event is removed from the project. Files copied to the Loose directory with a post-build event aren’t deleted when the project is built or cleaned. To stop the files from being deployed, they must also be deleted from the Loose directory.Adding files to the project
Files can also be added to the project as resources. Project resources are automatically copied to theLoose directory and deployed with the project.
To add files as a project resource
- Right-click the project, and then select Add, Existing Item.
- Select the item to add to the project.
- Open the properties window for the resource, and then ensure that the Content property is set to Yes.
Loose directory and deployed with the project. Removing the file from the project also removes it from the Loose directory.
