Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Rounded SFML window  (Read 3329 times)

0 Members and 1 Guest are viewing this topic.

FIWE

  • Newbie
  • *
  • Posts: 2
    • View Profile
Rounded SFML window
« on: March 17, 2019, 01:52:00 pm »
Hello!

I am quite new to SFML and I am trying to render a window where the edges are rounded. When displaying a window that has its style set to none, the edges gets edgy. Is there any way to fix this without having the window style containing a titlebar?

Thanks in advance.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11027
    • View Profile
    • development blog
    • Email
Re: Rounded SFML window
« Reply #1 on: March 17, 2019, 02:01:46 pm »
SFML doesn't support transparent or special shaped windows.

You could take a look at Texus' Transparent Window class: https://github.com/texus/TransparentWindows
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

FIWE

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Rounded SFML window
« Reply #2 on: March 17, 2019, 02:12:01 pm »
Ok, thank you anyways.

degski

  • Newbie
  • *
  • Posts: 23
    • View Profile
    • Email
Re: Rounded SFML window
« Reply #3 on: April 14, 2019, 11:04:08 am »
I have done some work on this and just for having something to apply it too I created my first Pong, here's a screenshot:



The repo is https://github.com/degski/pong (the above image is resized there)

It depends on https://github.com/degski/Sax (just C++-stuff), and the bit where the transparent/rounded (any shape really) Window related stuff gets done https://github.com/degski/SFML-Extensions (notably: https://github.com/degski/SFML-Extensions/blob/master/sfml-extensions/Extensions.cpp as from line 98).

Needless to say that this kind of manip is Windows only.