Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Celtic Minstrel

Pages: 1 ... 3 4 [5] 6
61
General / Re: a problen when making .exe with release
« on: June 24, 2012, 08:30:31 am »
Global variables are evil and from time to time SFML has some problems with it, regarding loading order of graphics stuff.
Global variables are also necessary in some situations, unless you want to pass things around to every function in your program.

I think what Exploiter's trying to get at though is that if you have global variables you can get things being initialized in the wrong order. This really depends a lot on just how your ImageFactory class works. If this isn't what you've done already, I would suggest making sure any actual loading of images does not occur before your main function is called. That is, don't do it in an ImageFactory constructor. Instead do it in an init() method and call that from main.

62
General / Re: a problen when making .exe with release
« on: June 23, 2012, 04:06:40 pm »
Does your game output any error messages to the console?

63
Window / Re: Rendering on closed window
« on: June 23, 2012, 04:40:50 am »
Oh right. Duh. <_<

64
Window / Re: Rendering on closed window
« on: June 22, 2012, 10:31:20 pm »
Um, #2 still renders on the closed window. :P

65
Graphics / Re: [THOR2] - Questions about the animation class.
« on: June 22, 2012, 07:44:12 pm »
Infinite loops have their uses. So do break and continue. I'd never recommend against using the latter (in the general case at least), and for the former I'll only say "exercise caution" since, being infinite, they have the potential to hang your application.

Still, if you can do something like "dool done = false; while(!done) { /* ...stuff... */ }", then that's probably better.

66
Graphics / Re: Odd text artifacts
« on: June 22, 2012, 07:40:37 pm »
To get past the other font issue I was having (the bold font made exclamation marks and lowercase i's merge into their dots), I wrote a class that loads a different font file based on whether the requested style is bold or italics, and now I'm no longer seeing these artifacts either. I'm not sure if that's just a fluke and they'll return later, but... this issue may be just with the default font?

67
Window / Re: How you are supposed to close the window correctly?
« on: June 22, 2012, 04:53:30 pm »
I only ever use std::exit (with non-zero argument) for exiting with an error, and not often for that; more often I use exceptions.

68
Graphics / Re: [solved] Resizing the view with the window
« on: June 22, 2012, 04:48:38 pm »
There's an interesting use of assignment being an expression. :P

69
Graphics / Re: Iterate through sprites vs changing texture on sprite
« on: June 22, 2012, 04:46:52 pm »
I'd say it's probably better to have all the sprite's frames in a single texture and switch using setTextureRect(). (Or setSubRect() if you're using SFML 1.6.)

So basically what Pyro said. Which I think is neither of the options you suggested.

70
Graphics / Re: [THOR2] - Questions about the animation class.
« on: June 22, 2012, 04:44:20 pm »
Just for the record, the name "_Sign" is reserved by the standard for future expansions, since it begins with an underscore followed by an uppercase letter. You're probably fine with it for now, but if it's not too much trouble I'd suggest lowercasing it.

More information here if you're curious.

71
Window / Re: How you are supposed to close the window correctly?
« on: June 22, 2012, 04:30:33 pm »
To hide it completely and not use it at all, I think you'd need to change your build settings to tell it not to use a console. (Or perhaps what Acrobat posted, I dunno; not even sure what he means.) To just hide it temporarily... not sure, probably some Windows API call.

72
General discussions / Re: SFML 2.0 RC
« on: June 22, 2012, 03:32:13 am »
Or if you're using C++11, there's the <random> header. If you seed your random generator and require the same results on different platforms, you can't rely on rand(), but the <random> header should be consistent across platforms.

Of course, if you don't need repeatable random numbers, all that doesn't matter. ;)

73
Feature requests / Re: Few suggestions
« on: June 22, 2012, 01:19:34 am »
I actually prefer having x and y rather than a vector in the mouse events; as for prevPos, you can easily track that yourself. ;)

74
Window / Re: Question about fullscreen
« on: June 21, 2012, 04:49:34 pm »
I think he's asking how he can change the aspect ratio of the window while preserving the aspect ratio of the main viewport. I don't really know how it would be done; might it involve glScissors?

75
General / Re: Setting Up With CMAKE tutorial Help
« on: June 21, 2012, 09:21:06 am »
Quote
Under Windows 7 click start, right click computer then select properties.  At the upper left of the window that appears you will see an option called "Advanced System Settings".  Click that and a new window comes up.  At the lower right click "Environment Variables".
Don't do that! I will add the variable permanently.
What's wrong with adding it permanently to the path?

Pages: 1 ... 3 4 [5] 6