Final Platform Layer  0.9.2.0
Getting started

Table of Contents

Download & Setup

Download

Setup?

Requirements

FPL uses built-in operating system libraries and requires a C99 complaint compiler.
Depending on the compiler and platform - linking to one system library may be needed:

Win32

Unix/Linux

C-Runtime

By default FPL uses the C-Run-Time library functions such as vsnprintf(), getchar() but its usage is optional.
For more details see the page How to disable the use of the CRT in FPL

How to use FPL?

In one of your C/C++ translation units include this:

#define FPL_IMPLEMENTATION
#include "final_platform_layer.h"

You can then include this file in any other C/C++ source or header file as you would with any other header file.

Provide the typical main entry point with at least the initialization and release of the platform:

int main(int argc, char **argv) {
// Initialize the platform
if (fplPlatformInit(fplInitFlags_All, fpl_null)) {
// your code goes here
// Release the platform
return 0;
} else {
return -1;
}
}

How to use FPL in multiple translation units?

To use FPL in multiple translation units, it is recommended creating a separated "final_platform_layer.c" in the same directory FPL is located and define the implementation there only:

final_platform_layer.c:

#define FPL_IMPLEMENTATION
#define FPL_NO_ENTRYPOINT // Disable the entry point inclusion
#include "final_platform_layer.h"

This way FPL implementation is compiled once and can be used everywhere.

In your main translation unit you just include the entry point only using the preprocessor define FPL_ENTRYPOINT.

main_translation_unit.c:

#define FPL_ENTRYPOINT // Integrate entrypoint only
#include "final_platform_layer.h"

How to use FPL in a static library?

To use FPL as a/in static library you do the same steps required for using FPL in multiple translation units. See How to use FPL in multiple translation units? for more details.

How do i get the code-documentation to show up in the IDE?

When FPL is compiled directly in your main translation unit, some IDE's read the comments from the implementation bodies instead from the header definitions.
This is obviously wrong, but we can't help it. Those editors just are not designed for single-header-file libraries :-(

But do not fear, you can get the comments to show up in your IDE properly, just compile the implementation into a separated translation unit only.
This way the IDE will parse the comments from the api declaration only. See How to use FPL in multiple translation units? for more details.

Options

See Compiler Options for all compile time options.