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 ... 642
General / Re: Disable Font Antialiasing / Smoothing
« on: October 30, 2020, 03:15:19 pm »
I have seen the multitude of posts saying to
This does disable the smoothing / filtering of the actual texture but the font its self has some sort of baked in antialising applied to it that I want to disable.
With PR #1690 you can and should this now also do via sf::Font::setSmooth(bool) directly.

Also don't forget to render the text at integer positions and to not zoom the view, both of which can lead to pixel interpolations.

If you're working on cross-platform support, you should also change all your header includes to use forward-slashes (/) instead of backward-slashes (\). :)

I also recommend to set the SFML_DIR in your CMake cache instead of the CMake file itself, as on other systems, the location might be slightly different.

You don't need to have system and window in the find_package, as they're dependencies of graphics (and audio).
And finally, the linking should not have names with -d, those targets don't exist and CMake will decide whether it uses the release or debug library.

Audio / Re: The program crashes when I use "sf::Music"
« on: October 24, 2020, 01:48:29 pm »
Sounds like you might have simply used the wrong version of the OpenAL DLL (x86 vs x64 architecture) and by rebuilding OpenAL yourself, you made sure to use the same compiler and thus matching architecture.

Graphics / Re: Loading large textures
« on: October 22, 2020, 09:57:33 am »
 Reading data from disk is slow, as such you'll always have some time spent in the loading function.

If you really need it to be on the fly, you could do the load of an sf::Image in a separate thread and then call copyFromImage on a texture in the main thread.
You might still get a frame rate dip due to the amount of data, but it shouldn't necessarily cause too noticeable lag. This could be further refined, by splitting up the large image into multiple smaller ones and loading one after the other.

On the other hand, loading the images up front and keeping them in memory can make things easier and it's not like your PC couldn't handle a few MB or RAM usage. ;)

General / Re: SFML Draw method leaking memory?
« on: October 22, 2020, 09:50:17 am »
It's not uncommon that reporting tools provide false positives, e.g. if they don't account for the destruction of some objects at application termination.

But if there really is an issue with SFML, then it should be reproducible in a few lines of code.
Given that you're doing manual memory management with raw pointers, I'd claim, that the leaks are originating somewhere from your own code. I highly recommend using unique_ptr (or if necessary shared_ptr) and not do any manual memory management.

Sounds like you link SFML dynamically, yet you defined SFML_STATIC.
If you link SFML dynamically, don't define SFML_STATIC.

General / Re: Use console and the game window at the same time
« on: October 21, 2020, 02:52:04 pm »
You can't easily use both at once. Console input is a blocking operation, while rendering something needs a continued operation.

Personally, I suggest to just create your own small text input field with SFML. You can get text input with the TextEntered event.

Alternatively,  but this might be even more complex, is to use an existing GUI library, like Imgui-SFML.

Audio / Re: The program crashes when I use "sf::Music"
« on: October 15, 2020, 10:34:41 am »
If you build the examples that SFML comes with, do they work?

0xc000007b is often an indication of mixing x64 and x86, so make sure you're using the same compiler target for both building SFML and using SFML.

General / Re: Problems when sending a project to someone else.
« on: October 14, 2020, 09:02:29 pm »
It's also part of all SFML release packages. ;)

General / Re: Problems when sending a project to someone else.
« on: October 14, 2020, 06:16:29 pm »
If you send them the example pong application, does it run fine?

General / Re: CMAKE error missing dependencies of SFML
« on: October 14, 2020, 06:12:07 pm »
Looks like you don't have static libraries built.

General / Re: How to setup CMake in Visual Studio?
« on: October 14, 2020, 06:07:53 pm »
If you build SFML as part of your CMake project you don't need to find_package it, as CMake already kowns the SFML targets. Instead you can just add SFML as subdirectory and then link sfml-<module>

The error code translates into 0xC00000FD which is connected to a stack overflow error. Try using a std::vector instead of an array, so the data is dynamically allocated on the heap instead of the stack.

Window / Re: Automatic Graphics Switching
« on: October 14, 2020, 10:57:46 am »
There's the GpuPreference #define that is used to encourage the system to use the discrete graphics card, as one usually wants, due to better graphics support, but I'm not even sure if this has an effect on macOS...
Other than that, I'm not sure if there's even a way to define the mode, as this seems mostly defined from the OS itself.
You could try and use something like gSwitch to better handle the enabling/disabling of the discrete graphics card.

General / Re: Vulkan
« on: October 14, 2020, 10:50:08 am »
You can already create Vulkan surfaces on SFML windows.
There's also a complete example. ;)

As for the sfml-graphics backend, there are plans for multi-backend support. OpenGL (ES) is still the most popular and most used graphics API, so this has still a very good future ahead of itself.

Pages: [1] 2 3 ... 642