Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML lags on my computer  (Read 2731 times)

0 Members and 1 Guest are viewing this topic.

joelthelion

  • Newbie
  • *
  • Posts: 3
    • View Profile
SFML lags on my computer
« on: June 22, 2013, 10:10:50 am »
Hi all,

I have started writing a few simple things with SFML and so far I love it, the API is great!

Unfortunately I've found out that even simple animations lag on my computer. At first I thought it was a problem with my code, but the pong example provided with the library lags as well. The animation is pretty smooth, but every second or so the is a big annoying lag. I can probably film my screen if needed.

My computer runs 32 bit Arch Linux with open-source intel graphics. I can run games such as supertuxcart or play movies, making me think it should be able to handle a 2d ball game. I checked and SFML seems to be built in Release mode.

What could cause this problem? Are other people experiencing it as well? Thanks!

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: SFML lags on my computer
« Reply #1 on: June 22, 2013, 10:25:30 am »
Other games often depend on SDL which has a software renderer (i.e. everything happens on the CPU), SFML on the other hand is built up on OpenGL, which will directly use the graphics card, thus if the graphics driver is a bit wonky the application will be as well.
I'm not sure if there are multiple drivers for your intel card, but if there are, you should try another one.

Besides that I can only think of other applications interrupting yours. But since you're on Linux that chances is lower I guess.

What are your system specs?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: SFML lags on my computer
« Reply #2 on: June 22, 2013, 10:37:37 am »
You should try to run glxgears, it's the standard program to test OpenGL drivers.
Laurent Gomila - SFML developer

joelthelion

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: SFML lags on my computer
« Reply #3 on: June 22, 2013, 11:04:15 am »
The computer is a Core 2 Duo P8400 with the associated integrated linux graphics. The driver is the intel open source driver which is pretty good by linux standards (which are pretty low :-().

I tried glxgears, and while it gives 60FPS (which is equal to the refresh rate, I think), it does have the same problem which is an occasion 200 or 300 ms freeze.

I guess this underlines the poor state of linux graphics, again. I hope wayland will sort things out. I'll try again with my desktop computers which has a newer intel cpu with a sandy bridge graphics chip and decent (in my recalling) graphics performance.

Anyways, thanks for your help, and have a nice week-end!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: SFML lags on my computer
« Reply #4 on: June 22, 2013, 11:17:02 am »
Can't you try another (proprietary) driver?
Laurent Gomila - SFML developer

joelthelion

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: SFML lags on my computer
« Reply #5 on: June 22, 2013, 11:31:10 am »
Can't you try another (proprietary) driver?

The open source driver is the official intel driver for linux, there is no proprietary driver, which is why I usually buy intel. Usually it works fairly well, but I don't do a lot of multimedia so I had never noticed this issue.

Lethn

  • Full Member
  • ***
  • Posts: 133
    • View Profile
Re: SFML lags on my computer
« Reply #6 on: June 22, 2013, 02:30:57 pm »
How complicated are your animations and what are you using? If it's sprites I would have thought even very low end graphics cards could cope these days, you should consider maybe testing the code on a friends computer or something like that and see if it makes a difference.

I love being able to just grab the exe and libraries from my project folder and handing it over to my friends without any issues :D

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: SFML lags on my computer
« Reply #7 on: June 22, 2013, 02:33:55 pm »
Quote
How complicated are your animations and what are you using?
It's not his code since glxgears has the same problem. It's a driver bug.
Laurent Gomila - SFML developer

Lethn

  • Full Member
  • ***
  • Posts: 133
    • View Profile
Re: SFML lags on my computer
« Reply #8 on: June 22, 2013, 02:50:01 pm »
Ah, kay, that does happen :P but I was thinking in terms of the amount of resources his animations etc. were using, if he loaded several thousand polygons onto the screen at once then I could see why it would lag but of course looking at what he's described he's clearly just using sprites.
« Last Edit: June 22, 2013, 02:54:08 pm by Lethn »

 

anything