Started re-adding the uiInit functions, with a new method of returning errors.
This commit is contained in:
parent
db9be102e6
commit
4c46a25154
|
@ -1,3 +1,4 @@
|
||||||
<!-- 8 april 2019 -->
|
<!-- 8 april 2019 -->
|
||||||
|
|
||||||
* [Using libui](using-libui.md)
|
* [Using libui](using-libui.md)
|
||||||
|
* [Initialization and the Main Loop](init-main.md)
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
<!-- 12 april 2019 -->
|
||||||
|
|
||||||
|
# Initialization and the Main Loop
|
||||||
|
|
||||||
|
## Reference
|
||||||
|
|
||||||
|
### `uiInit()`
|
||||||
|
|
||||||
|
```c
|
||||||
|
int uiInit(void *options, uiInitError *err);
|
||||||
|
```
|
||||||
|
|
||||||
|
### `uiUninit()`
|
||||||
|
|
||||||
|
```c
|
||||||
|
void uiUninit(void);
|
||||||
|
```
|
||||||
|
|
||||||
|
### `uiInitError`
|
||||||
|
|
||||||
|
```c
|
||||||
|
typedef struct uiInitError uiInitError;
|
||||||
|
struct uiInitError {
|
||||||
|
size_t Size;
|
||||||
|
char Message[256];
|
||||||
|
};
|
||||||
|
```
|
10
ui.h
10
ui.h
|
@ -30,6 +30,16 @@ extern "C" {
|
||||||
// This has the advantage of being ABI-able should we ever need an ABI...
|
// This has the advantage of being ABI-able should we ever need an ABI...
|
||||||
#define uiprivEnum(s) typedef unsigned int s; enum
|
#define uiprivEnum(s) typedef unsigned int s; enum
|
||||||
|
|
||||||
|
typedef struct uiInitError uiInitError;
|
||||||
|
|
||||||
|
struct uiInitError {
|
||||||
|
size_t Size;
|
||||||
|
char Message[256];
|
||||||
|
};
|
||||||
|
|
||||||
|
uiprivExtern int uiInit(void *options, uiInitError *err);
|
||||||
|
uiprivExtern void uiUninit(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -23,8 +23,6 @@ struct uiInitOptions {
|
||||||
size_t Size;
|
size_t Size;
|
||||||
};
|
};
|
||||||
|
|
||||||
uiprivExtern const char *uiInit(uiInitOptions *options);
|
|
||||||
uiprivExtern void uiUninit(void);
|
|
||||||
uiprivExtern void uiFreeInitError(const char *err);
|
uiprivExtern void uiFreeInitError(const char *err);
|
||||||
|
|
||||||
uiprivExtern void uiMain(void);
|
uiprivExtern void uiMain(void);
|
||||||
|
|
Loading…
Reference in New Issue