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

Pages: [1]
1
Graphics / Re: creating a texture through code
« on: January 14, 2021, 07:41:16 am »
how would i work on a local pixel buffer? would you be able to give a short code example of it? thanks for the reply

2
Graphics / creating a texture through code
« on: January 13, 2021, 04:44:04 am »
is there a way to create a blank texture with a set size, then access the pixels in the texture to set them?

something similar to the fallowing. (I specifically need the texture to be a pointer)

sf::Texture* texture;
texture = new sf::Texture;
texture->setSize(100, 100);

for (int y = 0; y < 100; y++)
{
    for (int x = 0; x < 100; x++)
    {
        texture->setPixel(sf::Color(127, 127, 127);
    }
}

Pages: [1]
anything