Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.

Dr Pain

dedicated server init

This topic is 6128 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How can PR be set up so it doesn''t have a rendering window, but still work? I''ve got an MFC application that is to be used as a dedicated game server, so it needs to be able to load PRO files and packages, but it doesn''t need to render. And in fact, I don''t want it to have a graphical window displayed, just the MFC window. After the MFC initialization, I use the following code to attempt to set up PR.
   PR_Settings.MissingTextureFatal = 0;  
   PR_Settings.UseWindowed = 1;
   Terrain_Globals.InitializationParameters.ScreenWidth = 800;
   Terrain_Globals.InitializationParameters.ScreenHeight = 600;
   Terrain_Globals.InitializationParameters.MaxPolys = 10000;
   Terrain_Globals.InitializationParameters.MaxTextures = 1024;
   Terrain_Globals.InitializationParameters.MaxMaterials = 1024;
   Terrain_Globals.InitializationParameters.MaxCharacters = 32;
   Terrain_Globals.InitializationParameters.MaxParticles = 5000;
   Terrain_Globals.InitializationParameters.MaxEmitters = 500;
   Terrain_Globals.InitializationParameters.MaxVoices = 32;
   Terrain_Globals.InitializationParameters.MaxWAVs = 32;
   strcpy(Terrain_Globals.InitializationParameters.PackagePath, "Data/Packages");


   PR_Settings.UseAGP = 1;  // tried 0 also


   PR_SetMode(800, 600, 60);

   Terrain_Globals.DrawCollisionWireframes = 0;
   Terrain_Globals.LOD_Distances[0] =  5000.0f;
   Terrain_Globals.LOD_Distances[1] = 10000.0f;
   Terrain_Globals.LOD_Distances[2] = 20000.0f;
   Terrain_Globals.LOD_Distances[3] = 30000.0f;
   Terrain_Globals.terrain = NULL;


If I leave in the call to PR_SetMode, I get the error that "This video card does not support rendering to a window". If I remove that call, I get an "Unhandled exception in Server.exe" from the PR_SetD3DPipeline call. I''ve also tried removing a variety of the above init lines with more or less the same results. How can I fix this?? What am I missing?

Share this post

Link to post
Share on other sites
Dr Pain, did you got a chance to have a look to EPR.zip on the UserApps dir ?

It implements the terrain engine within a MFC app... It would maybe help you!


Share this post

Link to post
Share on other sites
Thanks for the tip, Amadrias. I looked at MFCPR4F, EPR, and PR4EPR, but they all create a graphical rendering window, which is what I''m trying to avoid.

Share this post

Link to post
Share on other sites

You shouldn''t call PR_Initialize() but LS_InitializeTerrainEngine() instead. That''s the way you get all terrain engine initialized...


Share this post

Link to post
Share on other sites
Well, I found the problem. Once again just a stupid mistake.

I had not included the devdlg dialog resource in my project, and the call to DialogBox() in PR_ChooseDDraw_Driver() fails without a warning, and therefore doesn''t enumerate my video drivers.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!