Running XNA in Delphi Prism

I installed Delphi Prism and XNA Game Studio 3.0. I managed to translate the Delphi Prism XNA Tutorial 1 “Displaying 3D Models on the Screen” ( http://msdn.microsoft.com/en-us/library/bb197293.aspx ). The project compiles fine, but I cannot load the model. Looks like a new type of contentproj has appeared in XNA that is not in Delphi Prism ... Any idea how to make it work?

+3
source share
6 answers

You can simply create a content project using msbuild. Perhaps this is not the same integration where you can just add content and change settings in the solution browser ... but it will be a trick :-)

here is more information about this: http://blogs.msdn.com/shawnhar/archive/2006/11/07/build-it-ahead-of-time.aspx

+4
source

Finally, I managed to get it to work through 1) creating "* .contentproj" using MSBuild from the command line, 2) copying the resulting Content directory as a subdirectory into which the Delphi Prism executable is output.

It would be nice if Delphi Prism automatically detects * .contentproj and automatically builds it.

+2
source

I haven't done anything yet, but here is my best guess :-)

So, a content project type is a subproject for a standard XNA project that simply compiles game content (textures, sound, etc.) as an embedded compilation process, right?

Thus, I would suggest that there should be some link to the sub-project in the project file or the solution file, perhaps the best way would be to create a simple XMA project in C # or VB and look at the generated meta files (csproj, contentproj etc.)

Edit:


Oh, I suggest here that you manually create a contentproj file and insert the link, as soon as you know how they look, I assume that VS will then allow you to add, delete your content, etc.


Then the question simply arises as to how the compilation process of the XNA content pipeline starts, if it doesn’t “just happen”, which may be a question for marc hoffman and others.

Hope this helps a bit, this is just an assumption.

Glad to see you at StackOverFlow, by the way.

RGDS Tim Jarvis.

0
source

To my knowledge, Prism is announced and not released. Therefore, the test is not the final product. As an RO customer, I expect an email release to be released, but not earlier than announcing it. Honestly, I do not know that XNA support is already complete or even working. You might be trying to do this prematurely, given that the official release of Prism is still almost a month away soon.

I don’t know what to tell you to fix your problems with XNA, but it would be wise to wait for Prism himself. Until Prism is released, I believe XNA support is "pending."

0
source

It should be summer in Australia :-) Glad to see you here :-) I manually added a subproject, but it does not work ...

0
source

System.reflection can be used to access the internal work of XNA to create xnb files

method Game1.LoadContent; var importer : TextureImporter; texContent : Texture2DContent; cc : ContentCompiler; fullPath : String; fs : FileStream; args : array[1..7] of System.Object; begin spriteBatch := new SpriteBatch(GraphicsDevice); importer := new TextureImporter; texContent := importer.Import('asset.png', nil) as Texture2DContent; var compilerType := typeOf(ContentCompiler); cc := compilerType.GetConstructors(BindingFlags.NonPublic or BindingFlags.Instance)[0].Invoke(nil) as ContentCompiler; var compileMethod := compilerType.GetMethod("Compile", BindingFlags.NonPublic or BindingFlags.Instance); fullPath := 'assestName.xnb'; fs := File.Create(fullPath); args[1] := fs; args[2] := texContent; args[3] := TargetPlatform.Windows; args[4] := GraphicsProfile.Reach; args[5] := true; args[6] := fullPath; args[7] := fullPath; compileMethod.Invoke ( cc, args ); //SpriteTexture := Content.Load('assetName'); end; 
0
source

All Articles