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

Pages: 1 2 [3] 4 5 6
Feature requests / Re: Font antialiasing
« on: January 04, 2018, 06:48:09 pm »


Second is default FreeType/SFML rendering, which looks the same as the latest FreeType with default parameters  (FT_CONFIG_OPTION_SUBPIXEL_RENDERING disabled). It may not look THAT bad on dark backgrounds, but for dark text on white bg, it's really on the blurry side.

Feature requests / Re: Font antialiasing
« on: January 04, 2018, 05:43:30 pm »
I tried the 2.8.1 with defaults and it's not better than the current SFML rendering.

However, it seems the method i explained (with FT_CONFIG_OPTION_SUBPIXEL_RENDERING and FT_LCD_FILTER_LEGACY) doesn't use ClearType, both in 2.8 which was the version I used when I wrote this post, and 2.8.1 (I didn't tried other versions). The glyphs doesn't have any colour fringes, they are purely grayscale. If ClearType was used, there would be coloured. I tried many settings and none of them were coloured in any way. So, i don't know why they talk about that. Outdated comments ? Or i misunderstood something?

Freetype is quite advanced, it's possible to have custom parameters for the antialiasing algorithm (FT_LCD_FILTER_LEGACY is just a preset), so creating some of them and making them accessible through a function would be nice. If we find what's happening with this ClearType thing i can make a pull request. Which name would be best ? setSmoothness ? setAntialiasing ?

General discussions / Re: How is SFML going?
« on: January 04, 2018, 01:47:46 pm »
I'd like to help the dev team but i lack time and i have a slightly different vision compared to the authors. Less minimalistic, more fully-featured. Not a game engine, just more complete interfaces. I think that's what is stopping most people using it for other than little games and experiments. I'm using SFML to make a big sound creation software and it works, but some limitations are painful, like the Text class, far from any modern standards. Or if I want to set a View position relative to its top left corner, heh i need to use setCenter and recalculate (it feels strange and uncomfortable for anything more advanced than centering a camera to the player). Some of SFML initial spirit "code it yourself if you need advanced features" just can't work in real world. A bigger community would probably bring more contributors too...

Don't worry i may look negative but i think SFML is still a nice piece of work. It's just hard to get people working and involved on it because time isn't infinite, and too much good ideas are stopped because of this minimalistic spirit.

SFML projects / Re: Curve Masters - Worth continuing?
« on: January 03, 2018, 05:16:10 pm »
What you are experiencing is the result of the market saturation, entry barriers to app developement lowered so everyone can submit their app. As a user, you have to choose where to click, so you click on the most appealing ones. That means a polished shitty game will probably get more players than a great, unpolished game...  ;D

Feature requests / Re: File drop
« on: January 03, 2018, 04:40:04 pm »
I understood you meant only for file drop event, that's why I think the API would be too different from the rest of the Event-related API. C++ is not a managed memory language -- just stating the obvious here -- hence making sure your callback is always callable is not a trivial thing to do: the user has to make sure all references are still valid and so on. It also tends to generate spaghetti code. I think this kind of design should not be forced upon the user unless no other solution is possible at all, or we might lose the S of SFML.

I'd suggest not to worry much about the S of SFML. Too much S = a lib that would not be useful for any serious project. Just avoid getting horribly complicated like the OpenGL api, but we are far, FAR from that. Currently i had more problems fighting against the simplicity of some SFML interfaces rather than their complexity.
Just make a decision and go for it, nobody will ever agree on whether a callback is the best solution or not.

Feature requests / Re: Add "setSmooth" option to font or font texture
« on: January 03, 2018, 03:38:06 pm »
Seems our needs are closely related ! => https://en.sfml-dev.org/forums/index.php?topic=23017.0

You can do it currently, by recompiling sfml and freetype. But yeah, i'd be a nice feature

I suggest you look at PortAudio.
Even if SFML implemented more sample formats, you'd need more advanced options like low latency device support, and such very specific things

Feature requests / Font antialiasing
« on: January 03, 2018, 03:28:55 pm »

I was always annoyed by how blurry the fonts were when displayed with SFML. Take the same font, display it on a browser and on a SFML window, it's not as sharp with SFML even using all the advices I could found (integer positionning, right view size...). It's especially noticeable on small font sizes.

I've found a way to correct it, by recompiling Freetype and SFML:

the change in Freetype was to uncomment FT_CONFIG_OPTION_SUBPIXEL_RENDERING in ftoption.h

then in SFML to call the function FT_Library_SetLcdFilter with FT_LCD_FILTER_LEGACY as parameter : https://www.freetype.org/freetype2/docs/reference/ft2-lcd_filtering.html

I've tried other filter values but FT_LCD_FILTER_LEGACY  was the best to my taste.

Since some people may prefer the more blurry variant, would adding a "setSharpness" function be a good idea ?

setSharpness could take a sharpness parameter for chosing between the heavy default antialias, some lighter ones or no antialising at all (it's possible, I managed to do it while messing with FreeType options)

100 % reproductible, two programs, the first request to get to the front, the second checks if it lost focus :

Requester, brings window to foreground every 2sec, using windows api
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>

#include <windows.h>

int main(){
        sf::RenderWindow window(sf::VideoMode(200, 200), "request focus");

        sf::Event evt;

                while (window.pollEvent(evt)){

        return 0;

Focus checker, displays a green window when it has focus, red if it hasn't

#include <SFML/Graphics.hpp>

int main(){
        sf::RenderWindow window(sf::VideoMode(200, 200), "focus checker");
        sf::Event evt;

        sf::Color c(0,255,0);

                while (window.pollEvent(evt)){
                                case sf::Event::LostFocus:
                                        c = sf::Color(255,0,0);
                                case sf::Event::GainedFocus:
                                        c = sf::Color(0,255,0);


        return 0;

Run both programs, you'll see the focus checker stays green when the requester gets to the foreground. No problem when the user switch window or click outside, it seems to happen only when another window takes the focus by itself.

See compiled test in attachment. It doesn't check for window close event so you have to kill them using task manager

hello, some problems I have, not sure if they are SFML bugs :
  • I have a program that keeps fixed-size contents no matter the window size (the UI elements are of the same size when the window is bigger). This is done by resizing the view size on Window Resize event. But sometimes on Windows, when I mess with window switching, it doesnt work properly, the whole content get scaled, like if the Resized event wasnt triggered. (or maybe triggered but with the old width/height value)
  • LostFocus event doesn't work when another window get the focus itself (not a user action). I found that with League of Legends, the game laucher brings itself to the foreground, and my app don't get any LostFocus event so i cant disable mouse clicks..

I know my post needs more testing, but it was to see if other people noticed the same problems

Feature requests / Re: Plattform independet File Open / File Save dialogs
« on: October 19, 2017, 01:27:43 pm »
I recommend tinyfiledialogs if you only need file dialogs. Works very well, VERY EASY to use it's a single C file, so much easier and lighter than a whole gui toolkit... nativefiledialog isnt bad either but i had special character problems on Windows with it (can't be used directly with fopen) so i recommend tinyfiledialogs more.

Feature requests / Re: double click ?
« on: October 17, 2017, 06:55:58 pm »
mmmh that's what i though about the single / double click sequence. I guess something like this would be needed for compatibility : (and to me it's the way it should have been done directly by the Windows programmers)

Single click OS event : trigger Single click SFML event

Double click OS event : trigger Double click SFML event AND Single click SFML event

I'm not familiar with SFML internal code neither Windows API, but i can look at that when i have time

Feature requests / Re: double click ?
« on: October 15, 2017, 08:21:26 pm »
I'm not sure it has to keep track of the timing since it's an event sent by the operating system (just guessing here I didnt looked the docs, but I really doubt every application handle that with custom timing code).

I remember in applications like The Games Factory or Multimedia Fusion (game making tools) I had to check for Click and DoubleClick if i wanted my game to handle fast clicks without missing some of them, because the operating system would send alternatively Click and DoubleClick events on fast repeated button presses. So maybe SFML already has this bit of code somewhere (faking single clicks when a DoubleClick event is received)

Feature requests / Re: double click ?
« on: October 15, 2017, 06:55:28 pm »
overhead for such thing are you serious ?

Feature requests / double click ?
« on: October 15, 2017, 01:46:51 pm »
Maybe it's me but i didnt find a mouse DoubleClick event. Would be nice if included.

It's not reliable to do it manually, since the double click speed is user-configurable in most operating systems, doing it with a hard coded timer (like suggested in an old post i found) would not be good for user experience

Pages: 1 2 [3] 4 5 6