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 - Sticky

Pages: [1]
1
Graphics / Font crash at game exit
« on: November 25, 2009, 09:28:29 am »
Alright, thanks for that. I'll have a look into the initialisation lists and see what I can do.

Edit:
Yep, works great. Thank you very much for that help!

2
Graphics / Re: Font crash at game exit
« on: November 25, 2009, 08:53:39 am »
Quote from: "Laurent"
it's a known bug

Quote from: "Sticky"
I know about the bug of using the default font


Quote from: "Laurent"
and the possible workarounds are written in several (too many!) messages on this forum ;)

Quote from: "Sticky"
I've got it so that the font is being loaded into the String directly into the constructor, like you said.

Quote from: "Laurent"
It's a know bug.

Two workarounds exist:
- never construct a sf::String with the default font (always pass yours directly to the constructor)
- use the static SFML libraries

Apart from that, I don't want to link statically as it makes everything more difficult to manage.

Quote from: "Sticky"
If there is another way to do this that I'm not aware of, please correct me.


Also if
Quote from: "Laurent"
written in several (too many!) messages
then why don't you just write it once and make it a pinned topic in the graphics forum? Surely this would stop the issues being posted to an extent and leave you with less time having to moderate all of these posts on the forum.

I guess what I was actually trying to ask in my first post was if the way I had it laid out (as in, declaration in the header and then creation in the constructor) was the correct way to do it. Clearly it isn't, because of the errors, hence the question.

3
Graphics / Font crash at game exit
« on: November 23, 2009, 10:48:59 am »
I'm not sure what I'm doing wrong, but whenever I exit my game, it crashes with a segfault.
Quote
Program received signal SIGSEGV, Segmentation fault.
In atioglxx!DrvReleaseContext () (C:\WINDOWS\system32\atioglxx.dll)


I know about the bug of using the default font, but I thought the way I'd gone around it should avoid this issue. The way I've set it up is, in my header file for the class I have:
Code: [Select]
sf::Font fFont;
sf::String sSquared;
sf::String sPow2;
sf::String sSubtitle;


And then in the class constructor I have:
Code: [Select]
if(!fFont.LoadFromFile("resources/Fonts/font.ttf", 56))
printf("Failed loading font");

sSquared = sf::String("text", fFont, 56);
// Other stuff to set up sSquared

sPow2 = sf::String("2", fFont, 24);
// Other stuff to set up sPow2

sSubtitle = sf::String("ssubtitle", fFont, 32);
// Other stuff to set up sSubtitle


If I comment out or remove all of the String and Font code, the game runs without issues.

If there is another way to do this that I'm not aware of, please correct me. Otherwise, I've got it so that the font is being loaded into the String directly into the constructor, like you said. The game loads fine and renders the text, but if I try to use "delete & fFont" or on any of the Strings, it will crash immediately; or, when you try to exit the game it will crash with a memory error about being unable to read\write the selected memory.

To pre-empt any questions about my setup, I'm using the dynamic libraries on Windows XP. My graphics drivers are up to date as far as I know, but the card itself is pretty outdated.

Any help in this matter is appreciated.

Pages: [1]
anything