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

Pages: [1] 2 3 ... 721
1
Graphics / Re: How do I disable font smoothing?
« on: May 03, 2024, 07:19:09 am »
Also make sure you're rendering text only on integer position and choose the fitting font size, i.e. never scaling the text.

2
System / Re: Fail to Build Project
« on: May 02, 2024, 04:23:27 pm »
Make sure your configuration is for the correct compiler architecture (Win32 vs x64) and config (Debug vs Release). Note how no SFML libraries are listed above.

Also don't delete %(AdditionalLibraryDirectories) from the Additional Library Directory, otherwise the linker might fail to find system libraries.

3
System / Re: Fail to Build Project
« on: May 02, 2024, 03:51:13 pm »
Double check the config with the tutorial, you must have done some mistake somewhere to get the shown error output.

Provide the verbose build output, so we can see the complete configuration: https://www.sfml-dev.org/faq.php#tr-grl-verbose-ide

4
System / Re: Fail to Build Project
« on: May 02, 2024, 03:06:19 pm »
How are you linking SFML?

5
System / Re: Fail to Build Project
« on: May 02, 2024, 02:55:20 pm »
Are you #include-ing the lib file instead of a header file?

You need to provide more information on what you're doing in order for us to help and not just make random guesses.

6
It's recommended to use the SFML CMake template, which integrates the downloading and building of SFML, thus you don't have to worry about not matching configurations.

If it can't find the shared libraries, then it's either not been built as shared libraries, the path specified to SFML is wrong, or the CMake config for SFML hasn't been updated.

7
General / Re: Randomizing the movement of the Sprites
« on: April 30, 2024, 01:59:04 pm »
You'll need to wrap your sprite in an entity, so it can hold a different velocity.
Then you can use <random> to generate random numbers and assign a random velocity to each of your entities.

In the update function, use a delta time step and the set velocity to move your sprites/entities one at a time a bit every frame.

8
General / Re: AABB collision resolution not working as expected
« on: April 29, 2024, 09:00:16 pm »
Hehe ;D

The debugger can be a valuable tool for finding our own mistakes :D

9
General / Re: Smooth character movement with Arrow keys
« on: April 29, 2024, 01:04:14 pm »
Using events over isKeyPressed isn't a "reformatting", you're changing the underlying code. Formatting usually refers to code styling change that don't affect the semantics and usually also not the syntax.

The event that you're getting from the pollEvent() call already carries all the necessary information, as such it's for one redundant to again ask the system/device what the keyboard state of a specific key is, in relation to an event. Meaning if the event is of type KeyPressed (event.type == sf::Event::KeyPressed), then you know that a key has been pressed, you don't have to query again if the key is pressed.
In the worst case you might miss the key press, although you process the event, the key might have already been let go. Meaning you get a KeyPressed event that happened like 0.5ms ago, but then you ask the device again if at this moment right now the key is pressed, but you've let go in that time frame, thus the input isn't processed. Granted this is quite an edge case, but it does happen and can lead to frustrations for players/users.
And finally, real-time input checks are slightly more expensive, as you have to query device information, while the event has already gathered that information, and on some systems (e.g. macOS), you'll need additional permissions for the function to return anything at all.

The "new" recommendation is to use events whenever possible, but also never mix events and real-time checks for the same event occurrence. ;)

10
General / Re: How can I use stbi writing functions?
« on: April 29, 2024, 09:50:25 am »
As a side note: While SFML does use stbi, it shouldn't leak outside the SFML bounds

11
Graphics / Re: What is the best way to animate large frames?
« on: April 29, 2024, 08:38:16 am »
At what point would it make sense to use a video format instead of trying to manually create an animation of images? ;)

On one hand make sure you're measuring the "performance" in release mode.
Then to make sure you're optimizing for the right bottleneck use profiling tools to find the hot paths.

Assuming it's the reading from disk part, there isn't much you can do, as you'll have to read the image data into memory at one point.
You could perform the reading in a separate thread, so you don't block your "UI" thread, but make sure to only do this for the disk reading part (i.e. sf::Image) and not to try to do any OpenGL calls in a separate thread.

13
What other kind of textures do you have anyways?

Creating a texture on the fly isn't a cheap operation.
If it's an OpenGL texture, you could also just bind it, instead of creating a copy.

14
General / Re: AABB collision resolution not working as expected
« on: April 28, 2024, 05:31:31 pm »
Can you check that your BoundingBox and Transform component actually updated correctly, so you aren't just getting the same information for all the entities?

I recommend getting out the debugger and stepping through the collision resolution code, to see what values you're working on and where the values aren't as expected.

15
General / Re: cannot open source file "sfml/graphics.hpp"
« on: April 27, 2024, 11:02:06 pm »
You need to configure your IDE/compiler so it knows where to find the SFML header files?

Pages: [1] 2 3 ... 721