Skip to content

ExpiredPopsicle/Lily-Engine-Utils

Repository files navigation

Lily Engine Utils

This is a library I’ve built up over years as I’ve worked on various side project games, game engines, image processing tools, personal convenience systems, and porn-gathering bots.

It does a bunch of stuff from common string manipulation operations on std::string objects to matrix math and image manipulation. These different tasks may be split up into individual subsystems at one point, but at the moment it’s just easier to include all of them and let the compiler figure out what you really need.

The name comes from the old game project that the beginnings of this collection were torn from.

The two sections

Utils

The library itself is in the “utils” directory. I’m gradually working towards the point where you can just add “everything.cpp” to your C++11 or above project and not worry about any linking crap.

Later versions may be header-only.

Expect API breaking changes because nobody but me uses this thing anyway.

If #including individual headers isn’t your style, you can simply #include <lilyengine/utils.h> and get everything.

Autotools usage

To add Lily-Engine-Utils to an autotools-based project, just m4_include() the lilyutils.m4 file directly from the Lily-Engine-Utils source directory, and use the LILY_CXXFLAGS and LILY_LIBS variables from your Makefile.am.

configure.ac:

...
m4_include(your_Lily-Engine-Utils_directory/lilyutils.m4)
...

Makefile.am:

...
projectname_CXXFLAGS=$(LILY_CXXFLAGS)
projectname_LDADD=$(LILY_LIBS)
...

Cross-compile settings will be detected from the $CXX variable in your configure.ac, so “–host=whatever” arguments to your ./configure script will affect the compilation flags.

Generic build system usage

“lilyutils-config”, run from the root directory of the project, will take –libs and –cxxflags parameters, and spit back compiler flags needed to add the library to a project. This will generate absolute paths for header search flags, pointing them to the current Lily-Engine-Utils directory. See the output of “lilyutils-config –help” for more information on available options. Some flags are required for sockets and threading related parts, which are disabled by default.

Tools

In the “tools” directory is a commandline tools build with the lilyengine library. It’s some stuff I find useful for code generation, issue tracking, and some image processing.

Dependencies

The best way to use the utils library is to just feed the output of “lilyutils-config” into your compiler and linker if you’re using Clang, GCC, or anything else that takes the same set of command line parameters. If you do not use one of those compilers, or do not wish to use the “lilyutils-config” method for command line parameters, keep reading this section.

The library has optional dependencies on the Windows sockets library (ws2_32.lib, or libws2_32.a) when compiling on Windows, pthreads on Linux, and possibly pthreads on other Unix-like systems. You cannot use the threading or sockets-related subsystems (or anything that depend on them) without handling these dependencies.

There’s a library #pragma for Visual Studio’s compiler to link the windows sockets library, but it only works on Visual Studio.

Unless the relevant subsystem has been explicitly enabled, these will not be used, and will not cause your program to require them. Here are the #defines needed for each optional subsystem:

SubsystemRequired #defines
SocketsEXPOP_ENABLE_SOCKETS
HTTPEXPOP_ENABLE_SOCKETS
Threaded asset loaderEXPOP_ENABLE_THREADS
Thread-safe consoleEXPOP_ENABLE_THREADS
Thread-safey for archive systemEXPOP_ENABLE_THREADS

Should you enable any of these, it’s up to you to fight with your linker. Have fun!

License

This software is provided ‘as-is’, without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.

Copyright

Copyright (c) 2012-2018 Kiri Jolly http://expiredpopsicle.com expiredpopsicle@gmail.com

About

A bunch of C++ libraries and utilities I've built up over time.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published