1
Graphics / Re: Untolerably Slow Debug
« on: June 01, 2013, 12:41:33 pm »
Are you inadvertently copying large objects? When I ported my game from C#/XNA to C++/SFML, I had similar issues because I was unfamiliar with C++.
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.
Thanks a lot. Sadly that's not cross platform. I'll use that code, but my feature request to implement that for all platforms in SFML remains.
#include <Xinput.h>
...
bool JoystickImpl::IsConnected(unsigned int index)
{
//removed joyGetPosEx stuff
XINPUT_STATE dummy;
ZeroMemory(&dummy, sizeof(XINPUT_STATE));
DWORD result = XInputGetState(index, &dummy);
return result == ERROR_SUCCESS;
}
//stays fairly constant at 60fps but very visibly stutters every few frames
EnableVerticalSync(true);
SetFramerateLimit(60);
//stays very loosely around 60fps (around 50-80), but runs smoothly
EnableVerticalSync(false);
SetFramerateLimit(60);
sf::VertexArray va(sf::Quads, 4);
va.Append(sf::Vertex(sf::Vector2f(0, 0), sf::Color::Red));
va.Append(sf::Vertex(sf::Vector2f(100, 0), sf::Color::White));
va.Append(sf::Vertex(sf::Vector2f(100, 100), sf::Color::Black));
va.Append(sf::Vertex(sf::Vector2f(0, 100), sf::Color::Yellow));
rTarget->Draw(va); //any render target