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.


Topics - Shane

Pages: [1]
1
SFML projects / My Megaman 2 SFML Project *video link fixed*
« on: December 01, 2017, 06:12:40 am »
I was playing Megaman on my NES and thought to myself, I bet I could make this.  A few days go by and this is the result.  You may notice at times the blocks and sprites have a red border with white dots.  That's just me toggling on/off the collision detection box and hot points for testing.




2
Drawing a circleshape to a renderwindow when the window has a title bar the size / scaling is to big. If the windows has sf:style::None (removing the title bar) the shape is rendered correctly. It appears the circleshape is being scaled to fit the windows size including the size of the title bar. A printf of the window size displays the correct size in both cases. See an image illustrating the issue below.



Has anyone else experienced this issue?  or have a solution?

Environment
Lenovo P50s Laptop
Display Adapter: Intel HD Graphics 520 (driver version 21.20.16.4678)
Windows 10 (version 10.0.16299.64)
Visual Studio 2017
SFML 2.4.2 (64x)

Here is the Main.cpp

#include <SFML/Graphics.hpp>

int main()
{
        sf::RenderWindow window(sf::VideoMode(200, 200),"SFML works!", sf::Style::None);
        sf::CircleShape shape(100.f);
        shape.setFillColor(sf::Color::Green);
       
        while (window.isOpen())
        {
                sf::Event event;
                while (window.pollEvent(event))
                {
                        if (event.type == sf::Event::Closed)
                                window.close();
                }

                window.clear(sf::Color::Magenta);
                window.draw(shape);
                window.display();
        }

        return 0;
}
 

Pages: [1]