Add initial FnixLib development implementation
This commit is contained in:
commit
84742ae38e
33 files changed
+3340
No files matched your search
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* FnixLib - tipos públicos comunes.
|
||||
*/
|
||||
#ifndef FNIX_TYPES_H
|
||||
#define FNIX_TYPES_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define FNIX_BEGIN_DECLS extern "C" {
|
||||
#define FNIX_END_DECLS }
|
||||
#else
|
||||
#define FNIX_BEGIN_DECLS
|
||||
#define FNIX_END_DECLS
|
||||
#endif
|
||||
|
||||
FNIX_BEGIN_DECLS
|
||||
|
||||
/* Tipos opacos: su contenido es privado y puede cambiar entre versiones. */
|
||||
typedef struct FnixWindow FnixWindow;
|
||||
typedef struct FnixCanvas FnixCanvas;
|
||||
|
||||
/* Color RGBA con 8 bits por canal. a = 255 es opaco, a = 0 es invisible. */
|
||||
typedef struct FnixColor {
|
||||
uint8_t r, g, b, a;
|
||||
} FnixColor;
|
||||
|
||||
#define FNIX_RGBA(red, green, blue, alpha) \
|
||||
((FnixColor){(red), (green), (blue), (alpha)})
|
||||
#define FNIX_RGB(red, green, blue) FNIX_RGBA((red), (green), (blue), 255)
|
||||
|
||||
#define FNIX_BLACK FNIX_RGB(0, 0, 0)
|
||||
#define FNIX_WHITE FNIX_RGB(255, 255, 255)
|
||||
#define FNIX_RED FNIX_RGB(255, 0, 0)
|
||||
#define FNIX_GREEN FNIX_RGB(0, 255, 0)
|
||||
#define FNIX_BLUE FNIX_RGB(0, 0, 255)
|
||||
#define FNIX_YELLOW FNIX_RGB(255, 255, 0)
|
||||
#define FNIX_CYAN FNIX_RGB(0, 255, 255)
|
||||
#define FNIX_MAGENTA FNIX_RGB(255, 0, 255)
|
||||
#define FNIX_GRAY FNIX_RGB(128, 128, 128)
|
||||
#define FNIX_TRANSPARENT FNIX_RGBA(0, 0, 0, 0)
|
||||
|
||||
FNIX_END_DECLS
|
||||
|
||||
#endif /* FNIX_TYPES_H */
|
||||
Reference in new issue
Block a user