Reputation: 3
I am looking to work with the XNA framework to develop some simple 2D games. I especially would like to be able to develop and debug portions of these games while on-the-go with my netbook. Unfortunately, my netbook's GPU does not support the Shader Model 2.0 that is required by XNA.
Frustrated, I went to Google looking for alternatives. I came across one alternative from "Riemers XNA Tutorial". The following code is supposed to force XNA to run strictly through a computer's CPU, thus allowing my netbook to run an incredibly slow version of XNA.
if (GraphicsAdapter.DefaultAdapter.GetCapabilities(DeviceType.Hardware).MaxPixelShaderProfile < ShaderProfile.PS_2_0)
graphics.PreparingDeviceSettings += new EventHandler<PreparingDeviceSettingsEventArgs> (SetToReference);
}
void SetToReference(object sender, PreparingDeviceSettingsEventArgs eventargs)
{
eventargs.GraphicsDeviceInformation.CreationOptions = CreateOptions.SoftwareVertexProcessing;
eventargs.GraphicsDeviceInformation.DeviceType = DeviceType.Reference;
eventargs.GraphicsDeviceInformation.PresentationParameters.MultiSampleType = MultiSampleType.None;
}
The above code is supposed to be placed in the Game1 method of a default XNA project.
The problem is that when I try to run this new project I receive the following two errors:
Error 1 'XNAReferenceDevice.Game1.LoadGraphicsContent(bool)': no suitable method found to override c:\users\richard\documents\visual studio 2010\Projects\WindowsGame1\WindowsGame1\WindowsGame1\Game1.cs 39 33 WindowsGame1
Error 2 'XNAReferenceDevice.Game1.UnloadGraphicsContent(bool)': no suitable method found to override c:\users\richard\documents\visual studio 2010\Projects\WindowsGame1\WindowsGame1\WindowsGame1\Game1.cs 46 33 WindowsGame1
These two errors also cause blue 'squiggly' lines to appear beneath the LoadGraphicsContent and UnloadGraphicsContent methods.
If anyone could help me solve this problem or point me in a different direction, that would be great.
Thanks in advance!
Upvotes: 0
Views: 709
Reputation: 9050
New versions of XNA lost some compatibility with the past. Probably you are using a newer version of the framework and of XNA than Riemers tutorials.
However, consider that new XNA 4.0 supports minimum pixel shader 2.0! It means you cannot run it on low end machines with only pixel shader 1.1 or with a too slow pixel shader 2.0.
Previous version, XNA 3.1, supports minimum pixel shader 1.1, you can try to switch back to that using visual studio 2008 express.
Sorry but since XNA requires good machines I think you should find a better machine, also for doing 2D graphics.
The compiler error however is not related to pixel shader but is related probably to XNA and C# versions.
Upvotes: 1