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

Author Topic: Are the examples supposed to work?  (Read 5513 times)

0 Members and 1 Guest are viewing this topic.

jokoon

  • Newbie
  • *
  • Posts: 35
    • View Profile
Are the examples supposed to work?
« on: November 06, 2014, 03:55:35 pm »
I was trying to learn how to use shader in SFML, I encountered the Effect virtual class, and I wanted to know what were the argument of the update() function and where was it called.

I tried to setup the examples using CMake, I got an error:

CMake Error at ftp/CMakeLists.txt:8 (sfml_add_example):
  Unknown CMake command "sfml_add_example".

I could not find the source of SFML 1.6 either.

So how are those effects class used ? Where can I see the full code of those examples, meaning the main() ?

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Are the examples supposed to work?
« Reply #1 on: November 06, 2014, 04:01:59 pm »
Examples are supposed to work. Yes.
SFML 1.6 is ancient. Don't bother with it. Get 2.1 at least - or even better build the current master branch from the github repository.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Are the examples supposed to work?
« Reply #2 on: November 06, 2014, 04:03:21 pm »
If you want to know parameters of a function, check out the API documentation.

Don't use SFML 1.6, it's outdated, buggy, unmaintained and lacks a lot of features.

If you want to build the examples, just check the SFML_BUILD_EXAMPLES when building SFML.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

jokoon

  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: Are the examples supposed to work?
« Reply #3 on: November 07, 2014, 09:55:54 pm »
If you want to know parameters of a function, check out the API documentation.

Don't use SFML 1.6, it's outdated, buggy, unmaintained and lacks a lot of features.

If you want to build the examples, just check the SFML_BUILD_EXAMPLES when building SFML.

You did not understand my question.

Where is the main() in the examples ? I could not find it.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
AW: Are the examples supposed to work?
« Reply #4 on: November 07, 2014, 10:00:31 pm »
What virtual effect class are you talking about?
What examples are you talking about?
When doing what exactly did you encounter issues with CMake?
What has SFML 1.6 to do with all of this?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Are the examples supposed to work?
« Reply #5 on: November 07, 2014, 10:15:03 pm »
You can't build examples alone with CMake, they can only be built together with SFML. Only the top-level CMakeLists.txt can be given to the cmake executable.

But you don't need to compile them, they are pre-compiled in SFML releases.

Most examples are in a single file, and when it's not the case, there are not more than 2 or 3 files; it shouldn't be hard to find the main() function... If you look at the Shader example, there's the Effect.hpp header which defines the Effect abstract class, and Shader.cpp which contains the implementation of the example -- and the main() function. I can't believe you didn't find it :P
Laurent Gomila - SFML developer

jokoon

  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: Are the examples supposed to work?
« Reply #6 on: November 08, 2014, 08:34:09 am »
Oh yes, sorry.

(I did not scroll the entire .cpp file)

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Are the examples supposed to work?
« Reply #7 on: November 08, 2014, 01:28:58 pm »
Every decent editor has a search function...
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

jokoon

  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: Are the examples supposed to work?
« Reply #8 on: November 08, 2014, 02:26:06 pm »
I thought there was some example manager class or something like that...

I also thought the example were deprecated because the cmake script returned some error...

My fault :p