Skip to content

eastlIntegration

Alex Krieg edited this page Oct 27, 2024 · 1 revision

ImGui integration

TitleImage

EA STL Repository Visit the EA STL to learn it in detail.

Setup

Add the EASTL.cmake dependency to the dependncy folder. You can find the file here.
Reconfigure the CMake Project.
EA STL for SFML should be available now.

#if EASTL_LIBRARY_AVAILABLE == 1
    // ImGui for SFML is available
#else
    // ImGui is not available
#endif

How to use it?

To be compatible to the default C++ STL, the namespace QSFML implements using for aliasing the EA STL and c++ STL containers.
Checkout the file QSFML_EditorWidget_base.h to see all used containes.

// Default c++ code
std::vector<int> myInts;
myInts.push_back(10);
// do something...

This code can be replaced by:

// Default c++ code
QSFML::vector<int> myInts;
myInts.push_back(10);
// do something...

If the dependency EASTL.cmake is not available, then QSFML::vector<> is equal to std::vector<>.
If the dependency EASTL.cmake is available, then QSFML::vector<> is equal to eastl::vector<>.

By using the EA Templates via the QSFML namespace, it does not matter if the dependency is available or not, if it is not available, the default c++ STL is used...