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

Pages: [1]
1
General / Re: SFML shader sample official not working.
« on: May 21, 2017, 07:02:53 am »
The shader sample and the win32 sample. All of the samples are on the example folder. But yeah those two doesnt work for me., I am using win10.

2
General / SFML shader sample official not working.
« on: May 21, 2017, 06:11:11 am »
All examples works fine in the offical SFML example with the exception of 2. The shader and the win32. When clicking the exe it will open then says "exe stops working". Im more concern with shader tho as I want to understand how it works but to do that I have to see the output. Any idea how to make the shader sample work?

3
General / Re: texture stretch problem with opengl
« on: May 20, 2017, 01:57:17 pm »
Sorry about the code. I was experimenting with SFML. Anyway this is the link where I base my texture settings

https://www.sfml-dev.org/tutorials/2.4/graphics-sprite.php

Im not sure where is the texture coords configuration there.


4
General / texture stretch problem with opengl
« on: May 20, 2017, 10:01:05 am »
Hello. Pretty new here. Anyway I am learning opengl using SFML instead of GLEW and GLFW. Find it pratical to use this. I have a problem on texture tho. Stretching. here is the image



I am using this image


The size of the original is 512x512. But on my screen its really small but stretch so bad.. Anyway to fix this? thanks


Here is my code
int main()
{
        sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
        sf::CircleShape shape(100.f);
        shape.setFillColor(sf::Color::Green);


        sf::Shader shader;
        sf::Clock clock;

        sf::Texture texture;

        if (!texture.loadFromFile("container.jpg", sf::IntRect(10, 10, 200, 200))) {

        }



        sf::VertexArray quad2 = getQuad2();


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

                window.clear();
                sf::Time elapsed = clock.getElapsedTime();


                float greenValue = (sin(elapsed.asSeconds())) + 0.5f;
       
                sf::Texture::bind(&texture);
                sf::Shader::bind(&shader);
                shader.setParameter("ourColor", 0.0f, greenValue, 0.0f, 1.0f);
                //window.draw(vertices,6,sf::Quads, &shader);
                window.draw(quad2, &shader);
                window.display();

                clock.restart();
        }

        return 0;
}

Pages: [1]