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

Pages: [1]
1
General / Re: inconsistent fps
« on: December 01, 2013, 01:18:23 am »
nvm found out how to do it just a little tired btw thx allot =)

2
General / Re: inconsistent fps
« on: December 01, 2013, 12:04:03 am »
hmm i tried to read up on it and played around with it but could only make it work with lines  :-\
sf::VertexArray lines(sf::LinesStrip, 4);
        lines[0].color=sf::Color(255,33,33);
        lines[0].position = sf::Vector2f(10, 0);
        lines[1].position = sf::Vector2f(20, 0);
        lines[2].position = sf::Vector2f(30, 5);
        lines[3].position = sf::Vector2f(40, 2);
        window.draw(lines);
 

but couldn't really get it to work with rectangles i tried
sf::VertexArray squares(sf::RectangleShape, 4);
and stuff like that
so i was wondering how do i do it ?

3
General / Re: inconsistent fps
« on: November 30, 2013, 08:32:41 pm »
sorry for late respond :/

i figured out the code that made it slow
it goes something like this

        sf::RectangleShape Grect;
        sf::RectangleShape Brect;
        Brect.setSize(sf::Vector2f(50,50));
        Brect.setFillColor(sf::Color::Color(0,0,150));

        Grect.setSize(sf::Vector2f(50,50));
        Grect.setFillColor(sf::Color::Color(0,200,0));
void drawrect()
{
for(int i=0; i<900; i++)
{



        Brect.setPosition(x(i),y(i));
        Grect.setPosition(x(i),y(i));
        window.draw(Brect);
        window.draw(Grect);

}
}
 

so basically it just draws the same square multiple times at different positions
its kinda weird that it only slows it down initially given that i am always running this code
but any way is there any better way of doing this ?

4
General / Re: inconsistent fps
« on: November 25, 2013, 05:17:15 pm »
well i am using window.setFramerateLimit(60) but commenting it out doesn't seem to do anything

my program has over 700 lines of code so i wouldn't know what to show

in the initial loop

what it does is it takes bunch of images of my computer and rescales them

after that it doesn't do much



5
General / inconsistent fps
« on: November 25, 2013, 01:40:47 am »
when running the program in the initial 2-10 sec the frame rate is around 10
but then jumps to 60
but sometimes it doesn't jump up to 60 fps
forcing me to restart the program
now my 4th loop is no different from 5th loop or the 30th loop
which is why i don't think this is a code problem
also checking windows task manager when it is running at 10 fps the cpu usage is around 100%
but when its around 60 fps the cpu usage is way less then 30%
so basically i have no clue what the problem is
language is c++
os windows 7



any help is appreciated =)

Pages: [1]