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 - shayan-sa

Pages: [1]
1
General discussions / Low frame rate for about 10 instances
« on: February 09, 2017, 02:51:26 pm »
HI
I am using SFML for a game, and I have developed it for months, now I have everything ready to put things on the scene, but when there are about 10 instances on the scene, the game almost freezes. for fewer instances everything is fine, and I get a very smooth 60 FPS. My approach to the problem was to use a profiling program called very sleepy, which gives me how much each function uses the CPU. so after running the game alongside very sleepy I noticed, the most Consuming functions are
  • RtlSubscribeWnfStateChangeNotification : 72%
  • DwmFlush 8%

these two functions use 80 percent of the total CPU the program uses, and I haven't written them, they are not part of SFML too.
my most consuming function only uses about 0.02%.
I should mention that my laptop has 16 GB of RAM, and my CPU and GPU handle most advanced games, so hardware should not be a problem...

What should I do?

2
General / Re: SFML game development book,Projectile::getBoundingRec()
« on: August 06, 2016, 02:40:13 pm »
So what is globalBounds??? I am pretty confused now! when we use getWorldTransform, we want to get to the real transform not relative to anything? isn't this what globalBounds return?
and another question, that won't be nice, if for example i have a bullet, that is a little large, and has 45 degrees rotation, then the rectangle would be big, and it is possible that bullet collides with an enemy while it is only close to it! how can i rotate bounding rectangle?
Without looking at the code, I would guess that this gives a "local" bounding rectangle within the "world" co-ordinate system.

Bounding rectangles are always axis-aligned so the rectangle is not rotated; the rectangle is instead expanded to contain what would have been the rotated rectangle.


3
General / SFML game development book,Projectile::getBoundingRec()
« on: August 05, 2016, 09:26:40 pm »
I am not sure, if this is not a silly question, but i can't understand.
in SFML book, we reach this code:

sf::FloatRect Projectile::getBoundingRect()const
{
        return getWorldTransform().transformRect(mSprite.getLocalBounds);
}
 

my question is why we should not using mSprite.getGlobalBounds() . I am not still able to understand SFML well, but as document says, it will use transforms too. is there any difference?
and as another question, for example, when we rotate a shape, by PI/2 radians, it means the bounding rectangle is also rotated by PI/2 radians?

4
i was wrong . Scene node base classes are transformable , and drawable .
they both has virtual destructors . so , the scene node class has virtual destructor too , and all the derived classes in the hierarchy .

5
Hi
i am reading sfml game development book and i am wondering about why there is no virtual destructor in the codes ? for example scene node is a base class that contain some virtual functions , then aircraft is an entity where entity is itself a scene node . we assign an aircraft to one the scene nodes as unique_ptr<sceneNode>.
so here delete is performed on the scene node ! now we don't have any virtual destructor in the scene node . also there is none in the entity class .
so only the default destructor of the scene node is called , and derived classes resources will leak .
i have read that there must be a virtual destructor , if and only if , there is a virtual function exists in the base class code .and in our case there is virtual function

that is what i think , any way if i am wrong please guide me .
thanks .

6
General / output for android
« on: March 29, 2016, 06:13:48 pm »
hi
I want to make a game for android , I am fairly new with sfml , and I don't know how to get my output for android . I use visual studio 2013 , and for now I can only build a program that runs on windows ! how I can use cross platform capabilities ? which steps is needed to make a game work on android?

7
General / saving configuration for the libraries
« on: February 08, 2016, 01:31:46 pm »
I have managed to setup the sfml , and it is now working , I am using visual studio 2013, the question is , is there a way to get rid of including the library , each time I open a new project?? as I am using training samples , I may put each of them in a new project , so doing all the steps of set up again , is very annoying ! is there any way to save configuration a project and export it to another ? is there a short way?

8
General / how to run exe file , without including dll's?
« on: February 08, 2016, 01:04:26 am »
I am working with visual basic 2013 , and I have managed to setup the sfml successfully ! but there is something I can't understand . when I debug my program these is no need for dll files . but when I run the exe file , it requires dll's ! I am using -d libraries , and SFML_STATIC , and every thing works fine . examples of sfml like pong , does not require dll's , so how can I do that?

Pages: [1]
anything