vgl 1.0.0
Virtual Globe Library: API reference
Loading...
Searching...
No Matches
base.h File Reference
#include <vgl/version.h>
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Classes

struct  vgl_dvec2
 
struct  vgl_dvec3
 
struct  vgl_dvec4
 
struct  vgl_dmat4
 

Macros

#define VGL_API
 
#define VGL_DEPRECATED(message)
 
#define VGL_POINTER_PADDING(name)   uint32_t name;
 
#define VGL_FALSE   0u
 
#define VGL_TRUE   1u
 
#define VGL_SUCCEEDED(result)   ((result) >= 0)
 
#define VGL_FAILED(result)   ((result) < 0)
 

Typedefs

typedef uint32_t vgl_bool
 

Enumerations

enum  vgl_result {
  VGL_RESULT_SUCCESS = 0 , VGL_RESULT_INCOMPLETE = 1 , VGL_RESULT_NOT_READY = 2 , VGL_RESULT_INVALID_ARGUMENT = -1 ,
  VGL_RESULT_OUT_OF_MEMORY = -2 , VGL_RESULT_NOT_SUPPORTED = -3 , VGL_RESULT_INVALID_OPERATION = -4 , VGL_RESULT_NOT_FOUND = -5 ,
  VGL_RESULT_IO_ERROR = -6 , VGL_RESULT_CORRUPT_DATA = -7 , VGL_RESULT_VERSION_MISMATCH = -8 , VGL_RESULT_CANCELLED = -9 ,
  VGL_RESULT_BACKEND_ERROR = -10 , VGL_RESULT_INTERNAL_ERROR = -11 , VGL_RESULT_MAX_ENUM = 0x7FFFFFFF
}
 

Functions

vgl_result vgl_result_name_get (vgl_result result, const char **out_name)
 
vgl_result vgl_version_get (uint32_t *out_major, uint32_t *out_minor, uint32_t *out_patch)
 

Macro Definition Documentation

◆ VGL_API

#define VGL_API

◆ VGL_DEPRECATED

#define VGL_DEPRECATED (   message)

◆ VGL_POINTER_PADDING

#define VGL_POINTER_PADDING (   name)    uint32_t name;

◆ VGL_FALSE

#define VGL_FALSE   0u

◆ VGL_TRUE

#define VGL_TRUE   1u

◆ VGL_SUCCEEDED

#define VGL_SUCCEEDED (   result)    ((result) >= 0)

True for success and the non-error statuses.

◆ VGL_FAILED

#define VGL_FAILED (   result)    ((result) < 0)

True for errors.

Typedef Documentation

◆ vgl_bool

typedef uint32_t vgl_bool

Boolean. Any non-zero value is true on input; the library writes exactly 0 or 1.

Enumeration Type Documentation

◆ vgl_result

enum vgl_result

Result code returned by every vgl function. Zero is success, positive values are non-error statuses and negative values are errors. Treat unknown negative codes as failures and unknown positive codes as success.

Enumerator
VGL_RESULT_SUCCESS 

The function succeeded.

VGL_RESULT_INCOMPLETE 

The function succeeded, but an output array was too small to hold all elements.

VGL_RESULT_NOT_READY 

The function succeeded, but the requested data is not loaded yet; the output holds the best available answer, as documented.

VGL_RESULT_INVALID_ARGUMENT 

An argument is null, out of range or otherwise invalid.

VGL_RESULT_OUT_OF_MEMORY 

An allocation failed, or a memory budget does not allow it.

VGL_RESULT_NOT_SUPPORTED 

The request is valid, but this build, backend or device does not support it.

VGL_RESULT_INVALID_OPERATION 

The function is not allowed in the current state of the object.

VGL_RESULT_NOT_FOUND 

A requested item, file or tile does not exist.

VGL_RESULT_IO_ERROR 

Reading data failed.

VGL_RESULT_CORRUPT_DATA 

Data was read but failed validation or decoding.

VGL_RESULT_VERSION_MISMATCH 

A pack, interface or structure version is not supported by this binary.

VGL_RESULT_CANCELLED 

An asynchronous operation was cancelled.

VGL_RESULT_BACKEND_ERROR 

A graphics API or engine call failed.

VGL_RESULT_INTERNAL_ERROR 

A bug in the library. Please report it.

VGL_RESULT_MAX_ENUM 

Function Documentation

◆ vgl_result_name_get()

vgl_result vgl_result_name_get ( vgl_result  result,
const char **  out_name 
)

Gets the name of a result code, such as "VGL_RESULT_OUT_OF_MEMORY".

Parameters
resultThe result code.
out_nameReceives a static string, valid for the lifetime of the process. For an unknown code this is "VGL_RESULT_UNKNOWN".
Return values
VGL_RESULT_SUCCESSThe name was written.
VGL_RESULT_NOT_FOUNDThe code is unknown; "VGL_RESULT_UNKNOWN" was written.
VGL_RESULT_INVALID_ARGUMENTout_name is null.
Thread safety
Free-threaded.

◆ vgl_version_get()

vgl_result vgl_version_get ( uint32_t *  out_major,
uint32_t *  out_minor,
uint32_t *  out_patch 
)

Gets the version of the vgl binary, which may differ from the VGL_VERSION_* macros the caller was compiled against.

Parameters
out_majorReceives the major version.
out_minorReceives the minor version.
out_patchReceives the patch version.
Return values
VGL_RESULT_SUCCESSThe version was written.
VGL_RESULT_INVALID_ARGUMENTAn output pointer is null.
Thread safety
Free-threaded.