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

Pages: [1]
1
Graphics / Problem Drawing Text
« on: June 17, 2011, 01:48:22 pm »
Those were good points and you solved my problem. The issue was the move instead of using set position. Originally it worked because I was re-constructing the text every loop.

2
Graphics / Problem Drawing Text
« on: June 17, 2011, 04:10:41 am »
I'm trying to draw the fps for my game using sf::Text and sf::Clock.

Here is my code:

Code: [Select]

float Framerate = 1.f / rWindow.GetFrameTime() * 1000;
float time = timer.GetElapsedTime();
std::stringstream ss;
ss << "FPS: " << Framerate << "Time: " << time;
std::string fRString = ss.str();


if(time > 2000.f)
{
text.SetString(fRString);
timer.Reset();
}

ss.str("");
text.Move(View2.GetCenter().x - (View2.GetSize().x / 2 - 1), View2.GetCenter().y - (View2.GetSize().y / 2 - 1));


With sf::Text text and sf::Clock timer declared outside of the game loop.
This does not work. I can see the text get drawn once and than never again.

 If I move the sf::Text text to be constructed within the game-loop instead of main it works. What am I doing wrong? Timer still works outside of the game loop so I guess I am just missing something. I'm obviously trying to construct my text outside of the game loop to capture fps and stop it from updating every frame, with it in the loop it just updates to fast to read.

3
General / Installation VS 2008 Issue
« on: March 17, 2011, 10:41:42 am »
Oh I had an include for the window as well just testing if it would work. It did not. But this code gives the same error for System.hpp.

4
General / Installation VS 2008 Issue
« on: March 17, 2011, 10:37:12 am »
Nothing, its just the default header file that's created with win32 console apps.

5
General / Installation VS 2008 Issue
« on: March 17, 2011, 10:19:05 am »
I'm trying to install SFML. I've been working over the tutorial for quite some time and can not figure out why my library is not being installed.

I went through and added the path of sfml lib and include to vs VC++ directories / libraries

I also added the sfml library to my projects linker input but it still returns

Cannot open include file: 'SFML/Window.hpp': No such file or directory

here is the code



Code: [Select]
#include "stdafx.h"
#include <SFML/System.hpp>
#include <iostream>

int main()
{
    sf::Clock Clock;
    while (Clock.GetElapsedTime() < 5.f)
    {
        std::cout << Clock.GetElapsedTime() << std::endl;
        sf::Sleep(0.5f);
    }

    return 0;
}


I'm new to VS. Is there something I am doing wrong? I've tried putting all the dll's in my projects directories and it still wont work.

Pages: [1]