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

Pages: [1]
1
General / Visual Studio 2019 compatibility
« on: June 18, 2021, 10:08:09 pm »
I'm following the "SFML and Visual Studio" Tutorial on this site. It states:

"You must download the package that matches your version of Visual C++. Indeed, a library compiled with VC++ 10 (Visual Studio 2010) won't be compatible with VC++ 12 (Visual Studio 2013) for example. If there's no SFML package compiled for your version of Visual C++, you will have to build SFML yourself."

This implies that the "Visual C++ 15 (2017) - 32-bit" package from the download page is not compatible with Visual Studio 2019. Is that actually the case?

2
Graphics / Unexpected result while drawing pixels
« on: February 27, 2010, 02:15:51 pm »
Hi,

I'm new to SFML and I got some unexpected results running my first test code:

Code: [Select]
#include <SFML/Graphics.hpp>

using namespace sf;

int main()
{
const unsigned int width = 200;
const unsigned int height = width;

RenderWindow app(VideoMode(width, height, 32), "");

Image image(width, height);
Sprite sprite(image);

const unsigned int step = 2;
for (unsigned int y = 0; y <= height - step; y += step)
{
for (unsigned int x = 0; x <= width - step; x += step)
{
image.SetPixel(x, y, Color::White);
}
}

app.Draw(sprite);
app.Display();

while (app.IsOpened())
{
Event event;
while (app.GetEvent(event))
{
if (event.Type == Event::Closed)
{
app.Close();
}
}
}

return EXIT_SUCCESS;
}


The resulting image is not what I would expect: the pixels become gray and blurry towards the edges of the image. What is causing this and how can I prevent it? I'm using SFML version 1.5 under Windows 7 64 bit with an ATI Radeon 5770 graphics card with the latest display drivers.

I would like to mix drawing shapes (using sf::Shape::Line, sf::Shape::Circle and sf::Shape::Rectangle) and pixels: draw some shapes, then draw some pixels, draw some more shapes, etc, and then display the results. What is a good approach to draw the pixels in this case?

Pages: [1]