-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add sfml and sdl examples #292
base: master
Are you sure you want to change the base?
Conversation
Hey thanks for the example! It can definitely be useful for users checking how to use the sfml and sdl libraries. However it may be hard to test compilation CI as it seems to be missing X11 support. Maybe you could add the examples to the smippets as well? |
I didn't see the snippets page. I'll add it ! |
I think examples belong in a separate repo (or maybe multiple separate repos?) |
It's really cool to have common library as part of unit testing. Because it test real world scenario. Complexity and hidden bugs often hides in there. |
@OlivierLDff yeah, that's why currently all examples included in the examples directory are included in the CI testing suite. This specific case is a bit complex though as it requires an X11 environment, which is unusual for CI. |
I'm doing some unit test on gui (using Qt) in github action, here how I am doing: sudo apt install libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-xinerama0 libxcb-keysyms1 libxcb1 libxcb-render-util0 libxcb-randr0
xvfb-run ctest --build-config "${{ matrix.build_type }}" --progress --verbose |
|
||
add_executable(CPMSFMLExample main.cpp) | ||
target_compile_features(CPMSFMLExample PRIVATE cxx_std_17) | ||
target_link_libraries(CPMSFMLExample sfml-system sfml-graphics sfml-window sfml-audio) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example only uses the Graphics module which transitively depends on the Window and System module so this line can be as simple as
target_link_libraries(CPMSFMLExample PRIVATE sfml-graphics)
@@ -0,0 +1,16 @@ | |||
#include <SFML/Graphics.hpp> | |||
#include <SFML/Window.hpp> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<SFML/Graphics.hpp>
includes <SFML/Window.hpp>
so that 2nd header can be removed.
No description provided.