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

Author Topic: Random Offset of scene [LinuxMint SFML git]  (Read 5607 times)

0 Members and 2 Guests are viewing this topic.

Skender

  • Newbie
  • *
  • Posts: 3
    • View Profile
Random Offset of scene [LinuxMint SFML git]
« on: February 23, 2015, 05:07:07 pm »
Hello there,

I try to develop some SFML app on Linux Mint but I get random offsets in my scene. I would like to know if this has something to do with SFML or maybe with my desktop manager.

Correct:


Wrong:


My code looks like this:
#include <SFML/Graphics.hpp>
#include <tmx/MapLoader.h>

int main()
{
        sf::RectangleShape rect(sf::Vector2f(50,50));
        rect.setPosition(sf::Vector2f(0,0));
    sf::RenderWindow window(sf::VideoMode(640, 480), "SFML works!", sf::Style::Close);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }
        window.clear(sf::Color(0,255,0,255));
        window.draw(rect);
        window.display();
    }

    return 0;
}

This problem occurs about half the time, no matter what configuration (Debug/Release).

Thanks for any help in advance.

dabbertorres

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
    • website/blog
Re: Random Offset of scene [LinuxMint SFML git]
« Reply #1 on: February 23, 2015, 10:05:38 pm »
Which version of SFML?

Skender

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Random Offset of scene [LinuxMint SFML git]
« Reply #2 on: February 24, 2015, 06:12:42 am »
It is the git version (as mentioned in the title) from like 4 or 5 days ago.

Spirro

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: Random Offset of scene [LinuxMint SFML git]
« Reply #3 on: February 24, 2015, 07:09:52 am »
Hello there,

I try to develop some SFML app on Linux Mint but I get random offsets in my scene. I would like to know if this has something to do with SFML or maybe with my desktop manager.

This problem occurs about half the time, no matter what configuration (Debug/Release).

Thanks for any help in advance.

I also run mint(17.1) with the cinnamon desktop.  I like it better, but it's buggy and sluggish at times, but meh I like it.
I compiled what you posted(comment out the include for tmx as it wasn't needed for the code provided) and ran the executable 10 times in debug and 10 times in release and they all displayed properly.  I could run them more, but you mention your problem happening half the time so with 20 tries total I'd think it would show up on my end by then, but it didn't.

Oh and I also compile and use the latest git code for SFML.  Not sure what to tell you about this one.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
AW: Random Offset of scene [LinuxMint SFML git]
« Reply #4 on: February 24, 2015, 07:41:46 am »
What WM are you using?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Skender

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Random Offset of scene [LinuxMint SFML git]
« Reply #5 on: February 24, 2015, 11:57:37 am »
I use cinnamon desktop

SuperV1234

  • SFML Team
  • Full Member
  • *****
  • Posts: 190
    • View Profile
Re: Random Offset of scene [LinuxMint SFML git]
« Reply #6 on: February 24, 2015, 11:14:30 pm »
Having the same issue, using Arch Linux x64, XFCE4 and XFWM4.
Only happens with the git version of SFML.

3/4 of the window are corrupted:


binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: Random Offset of scene [LinuxMint SFML git]
« Reply #7 on: February 26, 2015, 02:36:41 pm »
Does trying out any of the commits I listed here resolve the issue?
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

SuperV1234

  • SFML Team
  • Full Member
  • *****
  • Posts: 190
    • View Profile
Re: Random Offset of scene [LinuxMint SFML git]
« Reply #8 on: February 26, 2015, 03:12:01 pm »
Does trying out any of the commits I listed here resolve the issue?

Issue still occurs with f162857 and f464e25.

The issue **does not occur** with commit 19920f5!


binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: Random Offset of scene [LinuxMint SFML git]
« Reply #9 on: February 26, 2015, 06:59:45 pm »
Just tested out master on my Arch x64 VM with XFCE4 and XFWM. Everything seems to be running fine...
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

SuperV1234

  • SFML Team
  • Full Member
  • *****
  • Posts: 190
    • View Profile
Re: Random Offset of scene [LinuxMint SFML git]
« Reply #10 on: February 27, 2015, 02:38:56 pm »
Just tested out master on my Arch x64 VM with XFCE4 and XFWM. Everything seems to be running fine...


If you have enough time, could you try cloning and building one of my projects that have this issue?
https://github.com/SuperV1234/DelversChoice
(clone, use ./init-repository.sh, then build with CMake)

Some projects present the issue, some don't - but I can't find a significant difference in the window-creation/rendering code


binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: Random Offset of scene [LinuxMint SFML git]
« Reply #11 on: February 27, 2015, 10:14:01 pm »
It works fine for me.

PS: Next time, you might want to mention that you have to run the executable from the _RELEASE directory ;).
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

SuperV1234

  • SFML Team
  • Full Member
  • *****
  • Posts: 190
    • View Profile
Re: Random Offset of scene [LinuxMint SFML git]
« Reply #12 on: February 28, 2015, 06:08:53 pm »
Really sorry about forgetting to mention the _RELEASE folder detail.
So, what could the issue be? GPU drivers, maybe?

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: Random Offset of scene [LinuxMint SFML git]
« Reply #13 on: March 01, 2015, 08:52:45 pm »
I'm just guessing here, but it could be a pixel format or window mapping issue. Can you try to create a minimal example that also produces this behaviour? I know it's more or less try and miss, but it would help greatly if we can rule out a bunch of things from the start.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: Random Offset of scene [LinuxMint SFML git]
« Reply #14 on: March 06, 2015, 11:40:53 pm »
Can you try Delver's Choice out using this branch (it's still on my repository)? I think I tracked down the problem. The window visual (pixel format) wasn't being set properly since the line went missing during the XCB rewrite.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

 

anything