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

Pages: 1 2 [3] 4 5 ... 12
31
Graphics / sf::Text ignoring spaces at the end
« on: February 07, 2012, 11:15:16 am »
Ugh, didn't use the correct terms to search.
I'm sorry I feel stupid.  :oops:

32
Graphics / sf::Text ignoring spaces at the end
« on: February 07, 2012, 11:00:15 am »
Hello,

sf::Text seems to be ignoring blank spaces I put at the end of a string. When I try to get the Global Bounds's width it always returns the value of the string without the spaces
The problem is shown by the code:

Code: [Select]
#include <SFML/Graphics.hpp>
#include <iostream>

int main()
{
sf::Text text1("Hello this is a string");
sf::Text text2("Hello this is a string    ");

std::cout << "Bounds for text1: " << text1.GetGlobalBounds().Width << std::endl;
std::cout << "Bounds for text2: " << text2.GetGlobalBounds().Width << std::endl;

getchar();
return 0;
}


Is this behaviour intentional?
Is there a workaround?

Using latest commit of SFML,
Windows 7,
ATI Radeon HD4870.

Best Regards.

33
General / SetFramerateLimit does not seem to work correctly
« on: February 01, 2012, 09:30:18 pm »
Quote from: "Laurent"
Quote
When I open an SFML application

Any SFML application?

Yeah, compiled with the new commit I mean.
I think it might not be SFML's problem though. I just found that this happens only after I play the game Portal 2. So I'm going to guess a driver problem. I'll try a full driver cleanup and reinstall.

EDIT: I just remember I had this problem before:
http://www.sfml-dev.org/forum/viewtopic.php?t=5802&highlight=
Shame on me! Although I'm not using vsync this time.

34
General / SetFramerateLimit does not seem to work correctly
« on: February 01, 2012, 08:14:02 pm »
I'm having a strange issue with this new commit however should I post this on the sf::Time thread? But since it's somewhat related, I think I'll post here.

When I open an SFML application it starts with 66FPS but after a while they drop to 32FPS and it stays there. Even if I restart the application the FPS doesn't change, I have to restart the computer.

What could be causing this? Driver issue?
I have an ATI Radeon 4870, latest drivers, using Windows 7.
Compiled with both debug and release, static library.

35
General / SetFramerateLimit does not seem to work correctly
« on: January 31, 2012, 08:17:42 am »
Hi,

I'm probably being thick here but I was looking at the source code for sf::Time and I curious about what value did "static const Time Zero" on line 85 had. But can't find it's value being assigned anywhere. Am I missing something?

I hope this isn't a stupid question.  :wink:

36
General / Mouse problem.
« on: January 29, 2012, 02:29:13 am »
Quote from: "Viruses"
The GetPosition() function takes a parameter? I didn't know that. How does that work?

You should really read the documentation:
http://www.sfml-dev.org/documentation/2.0/classsf_1_1Mouse.php#ac48d527ca5b712252d80a9a991f5a582

37
General / Mouse problem.
« on: January 29, 2012, 01:18:35 am »
Quote from: "Viruses"
I have no idea what 90% of those functions you mentioned do..

That's what the documentation is for:
http://www.sfml-dev.org/documentation/

38
General discussions / New naming convention
« on: January 09, 2012, 01:02:41 am »
I understand you want an homogeneous vocabulary between C++'s std and SFML but please don't get rid of the set/gets.
It's really convenient when you're using an IDE with intellisense like in Visual Studio. You just need to write "get" and boom, you get all the get functions for the class you're working with.  
But either way, excellent work so far.  :)

39
System / Clock::GetElapsedTime() error in my code
« on: January 08, 2012, 04:07:33 am »
You seem to be creating a new sf::Clock each loop, causing it to restart the time.
Create it outside the loop (as class member for example) or an unclean solution would be making it static sf::Clock enemyClock (but correct me if I'm wrong!)

40
General / For some reason this error wont go away.
« on: January 03, 2012, 05:56:55 am »
Quote
I also put a picture of the current build settings I have for CMake in there just in case anyone asks what settings used. :)

You need to press Configure again to set the settings.  :wink:
Only then press Generate.

41
General / Image Manager Destruction (Solved)
« on: January 02, 2012, 10:10:18 pm »
Thanks! It works like a charm!  :D

42
General / Image Manager Destruction (Solved)
« on: January 02, 2012, 08:11:39 am »
I guess it's fixed. I don't know if this is a good practice but... Just added this on the destructor before delete:
Code: [Select]
it->second = NULL;
delete it->second;

And it's working like a peach as singleton, global and monostate object...  :?

Thanks for the help,
Regards.

EDIT: Actually I just realized that deleting a null pointer doesn't actually free the allocated space. Darn. Any more ideas?  :(

43
General / For some reason this error wont go away.
« on: January 02, 2012, 04:27:18 am »
But all you had to do was download and compile the latest commit posted above.
That or get the latest version from github or the download page.

44
General / Image Manager Destruction (Solved)
« on: January 02, 2012, 03:13:32 am »
I actually didn't know what a monostate was so I researched a bit and tried using it (defined it as static) but the problem persists.
I did:

Code: [Select]
class Managers
{
private:
static ImageManager imgmng;
};

//outside the class
ImageManager Manager::imgmng = ImageManager();

This works but the same error occurs when exiting. Did I do this wrong?

45
General / Image Manager Destruction (Solved)
« on: January 01, 2012, 03:58:29 am »
Darn my mistake, forgot minimal code.
Here it is:
Code: [Select]
#include <SFML\Graphics.hpp>
#include "ImageManager.hpp"

ImageManager imgmng;

int main()
{
sf::RenderWindow App(sf::VideoMode(560,270,32),"Error");
imgmng.GetImage("any.png");
return 0;
}

Just this reproduces the error. On the image manager that i linked above I just replaced sf::Image with sf::texture for SFML 2.0 and included these headers that were missing:
Code: [Select]
#include <SFML/Graphics.hpp>
#include <map>
#include <string>


When closing, the call stack points to delete it->second; on the destructor.

Pages: 1 2 [3] 4 5 ... 12
anything