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

Pages: 1 [2] 3 4 ... 1287
16
Feature requests / Re: (CMake) Make BUILD_SHARED_LIBS=OFF by default
« on: April 14, 2021, 02:57:47 pm »
Quote
This is not a CMake's default. BUILD_SHARED_LIBS should be manually defined and set to ON so that CMake builds a shared library instead of static one.
My bad, I didn't check. I always create shared libs, whether it is at home or at work. Adding SHARED to add_library has probably become automatic for me, so that I don't notice it anymore.

I really wonder why STATIC is the default on CMake.

I checked a few other projects, and about half were defining BUILD_SHARED_LIBS to ON by default. So I would say it really depends on what's the most suitable default for each project. And shared libs is the recommended default for SFML, so I wouldn't change anything.

What's wrong about having to turn this flag off?

17
Graphics / Re: Achiving some sort of projection texture mapping
« on: April 14, 2021, 09:19:00 am »
Or just set the sprite's textureRect to its global bounding rectangle whenever it moves ;)

18
You can't.

19
Feature requests / Re: (CMake) Make BUILD_SHARED_LIBS=OFF by default
« on: April 14, 2021, 08:09:10 am »
Quote
I propose to not set  BUILD_SHARED_LIBS to "OFF"
You mean to not set to "ON" or to set to "OFF", right?

I disagree, as static linking is far from being the default. To me it's a special case, that should be used only for specific reasons. It's even an exotic thing on non-Windows OSes.

Quote
I expect that static libs are built by default
CMake builds shared libs by default (if nothing is explicitly specified), so why would you expect static libs?

20
It's \n, not /n.

21
Graphics / Re: Possible shearing ?
« on: April 05, 2021, 09:22:55 am »
It is possible, but SFML doesn't define any helper function for that, you'll have to build your sf::Transform from the 3x3 matrix directly.
See https://www.sfml-dev.org/documentation/2.5.1/classsf_1_1Transform.php#a78c48677712fcf41122d02f1301d71a3

Search "2D shear matrix" to know how to build one -- it's really simple.

22
Graphics / Re: Textures are flipped when loaded
« on: April 04, 2021, 05:06:50 pm »
I'm afraid the only way to handle EXIF data correctly is to use a library. Maybe you can find one that just reads EXIF fields, instead of a full image processing library like ImageMagick.

23
Graphics / Re: Textures are flipped when loaded
« on: April 04, 2021, 09:30:14 am »
Maybe the JPEG image has an "orientation" EXIF field that the OS interprets when showing the properties? You can easily check that.

How is the image, once loaded into your program? Rotated 90°? What happens if you open the image into an image editor -- for example GIMP, which shows a popup when there's an EXIF rotation.

24
Graphics / Re: LoadFromFile fails after too many sf::Text objects
« on: March 29, 2021, 09:32:14 am »
Why are you trying to load 1000 times the same font?

You should definitely not do this. A font consumes a lot of resources, and you most likely run out of GPU memory after 508.

25
General / Re: Using SFML in a static library project
« on: March 23, 2021, 08:04:38 am »
Could be that your project contains .c source files instead of .cpp or .cxx, and is recognized as a C project.

It would also help to see the complete compiler log.

26
Graphics / Re: Vertex Array 2.0
« on: February 25, 2021, 08:47:12 am »
I didn't read everything, but after a quick look at your code, I have the feeling that you don't really understand what you're doing.

The way you build tiles doesn't make any sense at all and is full of errors. Your code should even crash, as you write past the end of the vertex array memory.

27
Graphics / Re: How do I set a position/scale etc on a single axis?
« on: February 10, 2021, 08:32:20 am »
If there was a way, it would be in the documentation ;)

28
Graphics / Re: Why can't I transform from a function?
« on: February 09, 2021, 04:02:18 pm »
Yes.

29
Graphics / Re: Why can't I transform from a function?
« on: February 09, 2021, 02:01:35 pm »
You pass the shape to the function by value, ie. inside the function you're working on a copy of it. To work on the original instance, pass it by reference.

30
Graphics / Re: Tilemap sample and sf::View
« on: February 08, 2021, 10:27:44 am »
Your level[] array contains 16x16 numbers, and you pass 32,16 as the tile count to the load function.

Pages: 1 [2] 3 4 ... 1287