Skip to content

h-s-c/libKD

Repository files navigation

OpenKODE Core implementation

Zlib License Git Flow

Build
Coverage
License Scan

About

  • Cross-platform abstraction layer and application framework implemented in a clean, simple and maintainable manner. Written in C; build and tested with CMake and Github Actions; developed for Windows, Linux, Android and the Web.
  • Specification

Details

  • Threads and synchronization
  • Events
  • Application startup and exit
  • Memory allocation
  • Mathematical functions
  • String and memory functions
  • Time functions
  • File system
  • Network sockets
  • Input/output
  • Windowing
  • Assertions and logging

Examples

#include <KD/kd.h>

KDint KD_APIENTRY kdMain(KDint argc, const KDchar *const *argv)
{
    KDboolean run = KD_TRUE;
    while(run)
    {
        const KDEvent *event = kdWaitEvent(-1);
        if(event)
        {
            switch(event->type)
            {
                case(KD_EVENT_QUIT):
                {
                    run = KD_FALSE;
                }
                default:
                {
                    kdDefaultEvent(event);
                }
            }
        }
    }
    return 0;
}

Platforms

  • Windows, Android, Linux, Web support
  • Experimental OSX/iOS support (needs an EGL implementation)

Compilers

  • Visual C++ (2013 and up)
  • GCC (4.7 and up)
  • Clang/Xcode, Intel C++, Mingw-w64, Tiny C, Emscripten

Build from source

cmake -G Ninja -Bbuild -H.
ninja -C build