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

Pages: [1]
1
Graphics / Re: Incorrect (shapes, sprites and other) texture drawing
« on: February 01, 2021, 11:02:57 am »
Are you rendering on integer positions?
Not

Can you provide a minimal and complete example?
Oh sure

#include <iostream>
#include <SFML/Graphics.hpp>

sf::RenderWindow _window;
sf::RectangleShape _test;
sf::Texture _tex;

void drawingLoop()
{
    _window.setActive(true);

    while (_window.isOpen())
    {
        _window.clear({ 16, 32, 128});

        _window.draw(_test);

        _window.display();
    }
}

int main()
{
    _tex.loadFromFile("Test.png");

    _test.setTexture(&_tex);
    _test.setTextureRect({ 1, 1, 15, 15});
    _test.setOrigin({ 128, 128 });
    _test.setPosition({ 512.5, 256 });
    _test.setSize({ 256, 256 });

        sf::ContextSettings settings;
        settings.antialiasingLevel = 4;

        _window.create({ 1280, 720 }, "Test", sf::Style::Close, settings);
        _window.setVerticalSyncEnabled(true);

        _window.setActive(false);

        sf::Thread drawingThread(&drawingLoop);
        drawingThread.launch();

        while (_window.isOpen())
        {
            sf::Event e;
            while (_window.pollEvent(e))
            {
                if (e.type == sf::Event::Closed)
                {
                    _window.close();
                }
            }
        }

        return 0;
}
 

2
Graphics / Incorrect (shapes, sprites and other) texture drawing
« on: January 31, 2021, 05:04:53 pm »
On drawing any drawable with texture i get this vertical line

How i can remove this?

P.S. Sorry for my bad english

Pages: [1]
anything