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

Author Topic: Using SFML with C, not C++  (Read 2543 times)

0 Members and 1 Guest are viewing this topic.


  • Newbie
  • *
  • Posts: 6
    • View Profile
Using SFML with C, not C++
« on: April 22, 2019, 10:20:27 pm »
I know that via the CSFML page: https://www.sfml-dev.org/download/csfml/ there are no docs on the SFML api for C, as it's essentially the same as the C++ one.

However, are there any resources out there for using SFML with C? I need some help...

For example, what if I want to make the example provided here https://www.sfml-dev.org/tutorials/2.5/start-linux.php in C on a Mac?

I don't want to use XCode, and don't want to use C++, only C.

1) First, how would I translate the SFML "api" calls to valid calls in C? I can read C and C++, but not sure where I would access sf::CircleShape, for example, as obviously C doesn't have inheritance.

2) How would I build this with C?

Hopefully these questions make sense... sorry, a newbie here!

Thanks for the help.


  • Hero Member
  • *****
  • Posts: 3071
  • My number of posts is shown in hexadecimal.
    • View Profile
Re: Using SFML with C, not C++
« Reply #1 on: April 22, 2019, 10:43:39 pm »
Although I haven't used SFML with C, I believe it's the same as with C++ but without the double colon separator to make a single name.
e.g. sf::CircleShape becomes sfCircleShape

It seems that there is some documentation with the CSFML source code.
Selba Ward - SFML drawables
Kairos - Timing Library
Rectangular Boundary Collision - Rectangular SAT Collision

@Hapaxiation - Hapaxia on Twitter


  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Using SFML with C, not C++
« Reply #2 on: February 19, 2021, 10:44:09 am »
This is pretty disappointing. Couldn't the README here at least contain a couple of examples of how to call the C SFML binding? https://github.com/SFML/CSFML/blob/master/readme.txt

Is the intention literally that everyone must use trial and error?