XNA Creators Club Online
Page 1 of 1 (5 items)
Sort Posts: Previous Next

dll question

Last post 8/15/2009 5:35 AM by siferion. 4 replies.
  • 8/15/2009 2:40 AM

    dll question

    I want to export my whole engine project to a dll, but its part of a solution that includes another game project that uses said engine project as a game engine. How do I I export the game engine project into a dll file? Is there a wizard or publish property for this?
  • 8/15/2009 2:51 AM In reply to

    Re: dll question

    Storm Kiernan:
    Is there a wizard or publish property for this?

    No, you'll have to pull out the necessary code and put it into a Code Library project.
    Jim Perry - Microsoft XNA MVP
    If people spent a minute searching the forums and reading the FAQs before posting I'd be out of a job.
      Got some XNA Game Studio/XNA Framework development info to share with the community? Put it on the XNA Wiki.
        Please mark posts as Answers or Good Feedback when appropriate.
  • 8/15/2009 2:57 AM In reply to

    Re: dll question

    I'm not exactly clear on your scenario, but it sounds like you have a solution with multiple projects. (Or maybe just one projects with a bunch of files?)

    Either way, ultimately what you want is for the game engine code to reside inside of it's own project. This Windows (or Xbox) Game Library will compile into it's own .dll file (.NET Assembly). 

    When you compile your solution each project will have a assembly created. If it is a Game project it will be an .exe file. If it is a Library project it will be a .dll file. You just need to browse to the bin/debug folder to grab the .dll.

    This all assumes your solution has a Library project. If you simply have all your code in a single project then you will want to break out the "engine" code into it's own Library project and leave the "game" code in the current project.

    Hopefully this helps, but if not - perhaps you can describe exactly what your current solution looks like - how many projects are in there, etc.


    Chad Carter
    Microsoft XNA Game Studio 3.0 Unleashed - Book contains information on 2D, 3D, HLSL, Content Pipeline, XACT, Particle Systems, AI, Physics, Game States, Performance, Zune and 4 full games (2 of which are multiplayer)!

    Twitter

    XNA Essentials
  • 8/15/2009 5:25 AM In reply to

    Re: dll question

    Just to clarify - in order to create a .dll file for my game engine, I would need to move all of my game engine files into a XNA Game Library and publish that project, and then extract the .dll file from somewhere in the publish folders. Is this correct?
  • 8/15/2009 5:35 AM In reply to

    Re: dll question

    It's already really easy to move your code into a dll (or rather class library). Open the solution, add a new class library project, drag and drop the files from the game executable into the class library. You can also import other class libraries into your solution, but be careful modifying the class library when you open it in multiple solutions as it all is read from the one you imported from.
Page 1 of 1 (5 items) Previous Next