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

Pages: [1]
1
General / Re: sfml for VS2015
« on: October 24, 2015, 06:21:57 pm »
actually I started learning sfml on vs 2013 and it now feels scary to change the ide as it got me one month to set up sfml .

Sorry , I knew that was a stupid question.

But i will upgrade to 2015
Thank you.

2
General / sfml for VS2015
« on: October 24, 2015, 06:12:21 pm »
The download page shows

Visual C++ 14 (2015) - 64-bit-32bit

So now can i link sfml 2.3.2 with Visual Studio 2015 - comunity
it should work perfectly right?

3
Graphics / Re: Displaying An Image Using ::Image
« on: October 23, 2015, 12:30:49 pm »
Thank you , I will keep that in mind.

4
Graphics / Re: Displaying An Image Using ::Image
« on: October 23, 2015, 09:16:47 am »
Okay , So i did this and it works also

Are you saying that this is not performance effective?


                for (int i = 0; i < 1280; i++)
                {
                        for (int j = 0; j < 720; j++)
                                image.setPixel(i, j, sf::Color::Black);
                }

                texture.loadFromImage(image);            //loading the image again into texture
               

                window.clear();
                window.draw(sprite);
                window.display();
                }


        return 0;
}
 

5
Graphics / Displaying An Image Using ::Image
« on: October 23, 2015, 08:59:56 am »
I am trying to Load and display  an image from file and then  changing all its pixels one by one to black. After changing all pixels program should display the new image. But it only shows the original image and nothing else.
Where am i doing wrong?

Image Dimensions are 1280 720



#include <SFML/Graphics.hpp>
#include <iostream>


int main()
{  
       
        sf::RenderWindow window(sf::VideoMode(800, 600), "SFML ");
       
        sf::Image image;
        if (!(image.loadFromFile("map.jpg")))
                std::cout << "Cannot load image";   //Load Image
       
        sf::Texture texture;
        texture.loadFromImage(image);  //Load Texture from image

        sf::Sprite sprite;
        sprite.setTexture(texture);    


        while (window.isOpen())
        {
               
                sf::Event event;
               
                while (window.pollEvent(event))
                {
                        if (event.type == sf::Event::Closed)
                                window.close();
                       
                        }//Event handling done
                       

                for (int i = 0; i < 1280; i++)
                {
                        for (int j = 0; j < 720; j++)
                                image.setPixel(i, j, sf::Color::Black);
                }

                window.clear();
                window.draw(sprite);
                window.display();
                }


        return 0;
}


 

Pages: [1]