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

Pages: [1]
1
General / Re: Visual glitch with a tilemap
« on: June 14, 2018, 11:21:06 pm »
Thanks for the reply. My view is setup with this code:
    //Create Window
    global.window.create(sf::VideoMode(window_base_width, window_base_height), PROJECT_TITLE, sf::Style::None);
    {
        //Setup Fullscreen
        const float max_w = sf::VideoMode::getDesktopMode().width;
        const float max_h = sf::VideoMode::getDesktopMode().height;
        const float aspect = max_w / max_h;
        float new_w, new_h;
        if (max_w < max_h)
        {
            //Portrait display
            new_w = std::min<float>(window_base_width, max_w);
            new_h = new_w / aspect;
        }
        else
        {
            //Landscape display
            new_h = std::min<float>(window_base_height, max_h);
            new_w = new_h * aspect;
        }
        //Setup window view
        sf::View view;
        new_w = std::floor(new_w);
        new_h = std::floor(new_h);
        view.setSize(new_w, new_h);
        view.setCenter(new_w/2, new_h/2);
        global.window.setView(view);
        //Window position and size
        global.window.setSize(sf::Vector2u(max_w, max_h));
        global.window.setPosition(sf::Vector2i(0, 0));
    }

The view's size is not the same as the windows because of this.
So I should set the view's size to the window size and use sf::View::zoom instead of resizing it?

2
General / Visual glitch with a tilemap [Fixed]
« on: June 14, 2018, 10:54:03 pm »
I'm working on a platforming game.
I have a 32x32 tilemap which uses a vertex array, my problem is that vertical lines with textures from other tiles appear when my view coordinates are odd integers (my view coordinates are always integers).

Any ideas what the problem could be? Thanks

Update:
I fixed it (thanks Hapax) by making my view the same size as my window and using sf::View::zoom instead.

3
General / Re: Can't delete objects without memory dumping
« on: May 12, 2018, 01:17:03 am »
I'm not entirely sure what you mean, but: you don't need to delete anything when your program execution ends, it'll be deleted automatically.

Pages: [1]
anything