61
General / Re: Efficient way to draw and get pixels
« on: January 28, 2022, 12:32:26 pm »
moving GPU to CPU is always slow, unfortunately.
but in this case you could try an OpenGL function, like glReadPixels.
but in this case you could try an OpenGL function, like glReadPixels.
unsigned char data[4];
glReadPixels(sf::Mouse::getPosition(window).x, sf::Mouse::getPosition(window).y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &data);
glReadPixels(sf::Mouse::getPosition(window).x, sf::Mouse::getPosition(window).y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &data);