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

Pages: [1]
1
Graphics / Re: Problem with VertexArray
« on: November 25, 2016, 11:06:24 pm »
I tested it on other computer and result is correct. Apparently, the problem in the graphic driver. But even in correct image I see, that horizontal length of rhombus is 15 pixels, but vectical length is 16 pixels, although coordinates is symmetric in both sides (from 55.0 to 70.0). Is there a way to correct it?

2
Graphics / Re: Problem with VertexArray
« on: November 24, 2016, 09:45:44 pm »
Thanks for an answers.

This is a small program, where nothing is excess.

#include <windows.h>
#include "SFML/Graphics/RenderWindow.hpp"
#include "SFML/Graphics/VertexArray.hpp"

int WINAPI WinMain (HINSTANCE hinstance, HINSTANCE hprevinstance, LPSTR LpCmdLine, int nCmdShow)
{
        sf::RenderWindow myWindow;
        myWindow.create (sf::VideoMode (1024, 768), "DM", sf::Style::Titlebar | sf::Style::Close);

        while (myWindow.isOpen())
        {
                myWindow.clear(sf::Color::White);

                sf::VertexArray polygonImage2;
                polygonImage2.clear();
                polygonImage2.setPrimitiveType (sf::LinesStrip);
                polygonImage2.resize (5);

                float c = 1.0f;

                polygonImage2[0] = {sf::Vector2f {62.5f * c, 55.0f * c}, sf::Color::Black};
                polygonImage2[1] = {sf::Vector2f {70.0f * c, 62.5f * c}, sf::Color::Black};
                polygonImage2[2] = {sf::Vector2f {62.5f * c, 70.0f * c}, sf::Color::Black};
                polygonImage2[3] = {sf::Vector2f {55.0f * c, 62.5f * c}, sf::Color::Black};
                polygonImage2[4] = {sf::Vector2f {62.5f * c, 55.0f * c}, sf::Color::Black};

                myWindow.draw (polygonImage2);
                myWindow.display();
        }
        return 0;
}

And it still give me the same result with interrupt lines. I'm using 2.3.2 version of SFML. Is it problem with graphic driver? Is there any possible ways to resolve it?

3
Graphics / Re: Problem with VertexArray
« on: November 24, 2016, 08:04:36 pm »
This is simplified case which demonstrates the problem. I think that VertexArray with LineStrip mode must be continuous, because each next line begins from the last point of previous.

4
Graphics / Problem with VertexArray
« on: November 24, 2016, 07:45:35 pm »
Hello,

I want to draw rhombus with sf::VertexArray class

sf::VertexArray polygonImage2;
polygonImage2.clear();
polygonImage2.setPrimitiveType (sf::LinesStrip);
polygonImage2.resize (5);

float c = 1.0f;

polygonImage2[0] = {sf::Vector2f {62.5f * c, 55.0f * c}, sf::Color::Black};
polygonImage2[1] = {sf::Vector2f {70.0f * c, 62.5f * c}, sf::Color::Black};
polygonImage2[2] = {sf::Vector2f {62.5f * c, 70.0f * c}, sf::Color::Black};
polygonImage2[3] = {sf::Vector2f {55.0f * c, 62.5f * c}, sf::Color::Black};
polygonImage2[4] = {sf::Vector2f {62.5f * c, 55.0f * c}, sf::Color::Black};

theWindow.draw (polygonImage2);

but result shape is interrupted in the bottom. How can I solve this problem?

Pages: [1]