View previous topic - View next topic |
Author |
Message |
valderman Mage

Joined: 29 Aug 2002 Posts: 334 Location: Gothenburg, Sweden
|
Posted: Fri Nov 07, 2008 1:52 pm Post subject: |
[quote] |
|
[quote="DeveloperX"] Captain Vimes wrote: | The solution is to place SDL.dll in your PATH. I recommend C:\Windows\System32\ | I would recommend against it. User programs should never install anything into system directories, and DLL hell isn't pretty at all. Keep it in the same directory as your executable instead. _________________ http://www.weeaboo.se
|
|
Back to top |
|
 |
BadMrBox Bringer of Apocalypse

Joined: 26 Jun 2002 Posts: 1022 Location: Dark Forest's of Sweden
|
Posted: Fri Nov 07, 2008 7:17 pm Post subject: |
[quote] |
|
I agree with Valderman. Place the used dll's in the same directory as the executable. _________________
|
|
Back to top |
|
 |
DeveloperX 202192397

Joined: 04 May 2003 Posts: 1626 Location: Decatur, IL, USA
|
Posted: Fri Nov 07, 2008 7:54 pm Post subject: |
[quote] |
|
so then you think its a good idea to have a hundred copies of the DLL on your system? I stick with placing it on the path, and having ONE copy of it. _________________ Principal Software Architect
Rambling Indie Games, LLC
See my professional portfolio
|
|
Back to top |
|
 |
valderman Mage

Joined: 29 Aug 2002 Posts: 334 Location: Gothenburg, Sweden
|
Posted: Fri Nov 07, 2008 9:11 pm Post subject: |
[quote] |
|
DeveloperX wrote: | so then you think its a good idea to have a hundred copies of the DLL on your system? I stick with placing it on the path, and having ONE copy of it. | So, what do you do when different apps expect a different version of SDL.dll? UNIX has a good way to deal with this, Windows doesn't. It sucks, but there's a reason why all Windows apps keep their own versions of DLLs. _________________ http://www.weeaboo.se
|
|
Back to top |
|
 |
DeveloperX 202192397

Joined: 04 May 2003 Posts: 1626 Location: Decatur, IL, USA
|
Posted: Fri Nov 07, 2008 11:42 pm Post subject: |
[quote] |
|
valderman wrote: | So, what do you do when different apps expect a different version of SDL.dll? UNIX has a good way to deal with this, Windows doesn't. It sucks, but there's a reason why all Windows apps keep their own versions of DLLs. |
Its different when you are learning, than when you are distributing your finished program.
He's learning to write SDL programs, and if he is creating many programs during his learning, its not a good idea to complicate the matter with having to include a copy of the DLL with each and every program that he is writing.
I tend to create between 10 and 50 programs during the duration of a project for testing various concepts, and with your way of thinking I'd have 10 to 50 copies of the DLL on my system.
Most programs install their DLLs somewhere on the path.
Others place them in another folder and add an entry to the PATH environment variable.
In any event, he has a few options, and its up to him to decide which way to go. _________________ Principal Software Architect
Rambling Indie Games, LLC
See my professional portfolio
|
|
Back to top |
|
 |
valderman Mage

Joined: 29 Aug 2002 Posts: 334 Location: Gothenburg, Sweden
|
Posted: Sat Nov 08, 2008 11:21 am Post subject: |
[quote] |
|
DeveloperX wrote: | valderman wrote: | So, what do you do when different apps expect a different version of SDL.dll? UNIX has a good way to deal with this, Windows doesn't. It sucks, but there's a reason why all Windows apps keep their own versions of DLLs. |
Its different when you are learning, than when you are distributing your finished program. | He'll still be messing up his own system that way though, but as long as he's aware of the consequences and how to undo them I guess it isn't a problem.
This is one reason why developing on a Windows system is such a pain in the ass. _________________ http://www.weeaboo.se
|
|
Back to top |
|
 |
RedSlash Mage
Joined: 12 May 2005 Posts: 331
|
Posted: Sat Nov 08, 2008 4:42 pm Post subject: |
[quote] |
|
He could just run his program in Dev-C++ while developing and then bundle in the DLL on release.
|
|
Back to top |
|
 |
valderman Mage

Joined: 29 Aug 2002 Posts: 334 Location: Gothenburg, Sweden
|
Posted: Sat Nov 08, 2008 7:08 pm Post subject: |
[quote] |
|
RedSlash wrote: | He could just run his program in Dev-C++ while developing and then bundle in the DLL on release. | That's another idea. That, or link statically in development builds. _________________ http://www.weeaboo.se
|
|
Back to top |
|
 |
Captain Vimes Grumble Teddy

Joined: 12 May 2006 Posts: 225 Location: The City Streets
|
Posted: Mon Nov 10, 2008 7:08 pm Post subject: |
[quote] |
|
I think that's what I'll do. I mean include it in the bundle when distributing. _________________ "Sometimes it is better to light a flamethrower than to curse the darkness."
- Terry Pratchett
|
|
Back to top |
|
 |
Hajo Demon Hunter

Joined: 30 Sep 2003 Posts: 779 Location: Between chair and keyboard.
|
Posted: Tue Nov 11, 2008 8:57 am Post subject: |
[quote] |
|
Captain Vimes wrote: | ... include it in the bundle when distributing. |
That's a good idea. Just to be certain that the players use exactly the same version of the DLL that you used for development and testing.
Also, I agree with Valderman, that putting the DLL into the programs working directory instead of the wondows folder avoids quite a lot of troubles, particularly if that is an DLL that is used by many applications.
On Linux systems it might be a different story, there I usually let the user get and install the right version of the library, since they have so many dependencies that it's really difficult to bundle a library with an executable that will work on many Linux boxes.
|
|
Back to top |
|
 |
DeveloperX 202192397

Joined: 04 May 2003 Posts: 1626 Location: Decatur, IL, USA
|
Posted: Tue Nov 11, 2008 3:10 pm Post subject: |
[quote] |
|
I recommend placing the DLL in a secondary optional download.
That way your game download is smaller, and if the user already has the DLL, they don't need to download it again.
Hajo is right. for linux, just specify what version you are using. _________________ Principal Software Architect
Rambling Indie Games, LLC
See my professional portfolio
|
|
Back to top |
|
 |
valderman Mage

Joined: 29 Aug 2002 Posts: 334 Location: Gothenburg, Sweden
|
Posted: Tue Nov 11, 2008 11:13 pm Post subject: |
[quote] |
|
DeveloperX wrote: | I recommend placing the DLL in a secondary optional download.
That way your game download is smaller, and if the user already has the DLL, they don't need to download it again.
Hajo is right. for linux, just specify what version you are using. | Does shaving 150 kilobytes of compressed data off of your game distribution really matter in the age of high-speed Internet?
EDIT: also, the "if the user already has the DLL..." part is just another, more complicated, invitation to DLL hell. _________________ http://www.weeaboo.se
|
|
Back to top |
|
 |
Nodtveidt Demon Hunter

Joined: 11 Nov 2002 Posts: 786 Location: Camuy, PR
|
Posted: Sun Nov 16, 2008 7:05 pm Post subject: |
[quote] |
|
I always place the required DLLs in the same directory as the main program. The nature of DLLs allows for newer versions to supersede older ones; however, developers RARELY take this into consideration when they create new versions of the DLL, and VERY often, later versions of the DLL will simply not work with existing programs built on older versions (two cases in point: bass.dll and freeimage.dll...two libs I'm using right now that are version-specific). It's not that much to give up in terms of disk space, really...especially if your libraries are small. It's worth it...the slight increase in required disk space is totally worth saving the headaches of having the user make sure he has the right version. _________________ If you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows. - wallace
|
|
Back to top |
|
 |
Captain Vimes Grumble Teddy

Joined: 12 May 2006 Posts: 225 Location: The City Streets
|
Posted: Tue Feb 10, 2009 1:38 am Post subject: |
[quote] |
|
Okay... some necromancy going on here. But anyway... two more questions.
First, for DevX. Thank you so much for all your help with the game engine - I've been trying to get some actual games working, and I've recently started one ("The Horde") which I am really excited about.
I'm currently a senior in high school, and one of the scholarship notices that I received on FastWeb says that there's a $5000 scholarship contest on FreshBrain - and one of the categories is "gaming." I want to submit "The Horde" for the contest, and I'm practically guaranteed to win if I do since no one else has entered so far, but I figured that I should ask if I could use your edited version of the game engine before I submitted it.
Number two: working on "The Horde" (I'm planning to finish the project for RPGDX whether or not DevX approves the scholarship thing), I've run across a problem that I haven't had before. I've been using the game engine in several other test projects and it's worked fine, but I tried it for "The Horde" using only a background and it doesn't draw anything. It's just a black screen.
Here's the relevant code:
Code: | bool InitializeGame()
{
//...initializing things that don't do anything yet...
Sprite* title = new Sprite(SDL_LoadBMP("hordeTitle.bmp"), pHammer->GetScreen());
pHammer->AddBackgroundLayer(title);
return true;
} |
I added a bunch of fprintf(stderr, "whatever") statements to this function to make sure that it was running all right. It's fine. After adding more fprintf() statements to the various functions that Hammer::Draw() calls, I found out the problem was here:
Code: | // calls the Draw method on all sprites in the list
void SpriteManager::Draw()
{
fprintf(stderr, "Begin SpriteManager::Draw()\n");
std::vector<Sprite>::iterator iter;
for (iter = spriteList_.begin(); iter <spriteList_>Draw();
}
fprintf(stderr, "End SpriteManager::Draw()\n");
} |
Here's the resulting stderr file:
Begin SpriteManager::Draw()
End SpriteManager::Draw()
Begin SpriteManager::Draw()
End SpriteManager::Draw()
Begin SpriteManager::Draw()
End SpriteManager::Draw()
Begin SpriteManager::Draw()
End SpriteManager::Draw()
Begin SpriteManager::Draw()
End SpriteManager::Draw()
Begin SpriteManager::Draw()
End SpriteManager::Draw()
Yeah, you get the idea. I've tried messing with the parameters to the for() loop, but that just makes it crash when it tries to access a NULL pointer. I'm thinking that the problem lies in the fact that there is only one Sprite* in backgroundManager_, but I'm not sure.
Any ideas?
EDIT: Okay, it's not accepting my edits. the for() loop is just your generic iterator loop, and there's an fprintf() call in the loop that says "Calling (*iter)->Draw()". Hopefully THIS edit will show up... _________________ "Sometimes it is better to light a flamethrower than to curse the darkness."
- Terry Pratchett
|
|
Back to top |
|
 |
DeveloperX 202192397

Joined: 04 May 2003 Posts: 1626 Location: Decatur, IL, USA
|
Posted: Tue Feb 10, 2009 5:28 am Post subject: |
[quote] |
|
Captain Vimes wrote: |
First, for DevX. Thank you so much for all your help with the game engine - I've been trying to get some actual games working, and I've recently started one ("The Horde") which I am really excited about.
I'm currently a senior in high school, and one of the scholarship notices that I received on FastWeb says that there's a $5000 scholarship contest on FreshBrain - and one of the categories is "gaming." I want to submit "The Horde" for the contest, and I'm practically guaranteed to win if I do since no one else has entered so far, but I figured that I should ask if I could use your edited version of the game engine before I submitted it.
|
Permission Granted. I wish you luck! :)
Quote: |
Number two: working on "The Horde" (I'm planning to finish the project for RPGDX whether or not DevX approves the scholarship thing), I've run across a problem that I haven't had before. I've been using the game engine in several other test projects and it's worked fine, but I tried it for "The Horde" using only a background and it doesn't draw anything. It's just a black screen.
...
Any ideas?
|
oooh....hmm I need to resurrect the engine code and refresh my memory of what it was that I did..haha I've written 14 different 'game engines' since then LOL!
I cannot jump into the code tonight, but I can tomorrow.
I'll leave a 'sticky' note on my desk as a reminder :D _________________ Principal Software Architect
Rambling Indie Games, LLC
See my professional portfolio
|
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|