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

Pages: [1]
1
Graphics / Re: Black lines on vertex array
« on: July 01, 2017, 05:41:47 pm »
Yes, your solution works. Thank you.

2
Graphics / [SOLVED] Black lines on vertex array
« on: June 30, 2017, 08:43:51 pm »
Currently, I'm trying to generate white noise using a vertex array of points to display the pixels. The size of the output is 200 by 200 pixels. However, when I run the code, black vertical lines appear in the noise. When I resize the window, it fixes the problem, but I don't understand why, as I presume my sizes for the vertex array and window are correct.

Here is the code that I'm running:
#include <SFML/Graphics.hpp>
#include <time.h>

using namespace sf;

int main(int argc, char** argv) {
    srand(time(NULL));
    RenderWindow window(VideoMode(200, 200), "");
    VertexArray noise(Points, 200 * 200);
    int value = 0;
       
    for (int i = 0; i < 200 * 200; i++) {
        noise[i].position = Vector2f(i % 200, i / 200);
        value = rand() % 256;
        noise[i].color = Color(value, value, value);
    }
       
    while (window.isOpen()) {
        Event event;
        while (window.pollEvent(event)) {
            if (event.type == Event::Closed)
                window.close();
        }
       
        window.draw(noise);
        window.display();
    }
    return 0;
}

All the values regarding the size of the window are set to 200, though I still get some empty space.

Pages: [1]