Wrapped the init example in a main() for maximum clarity.
This commit is contained in:
parent
484989e925
commit
2652772891
|
@ -15,13 +15,17 @@ Furthermore, on some systems, this thread must also be the thread that `main()`
|
||||||
Here is an example of correct use of `uiInit()` in C:
|
Here is an example of correct use of `uiInit()` in C:
|
||||||
|
|
||||||
```c
|
```c
|
||||||
uiInitError err;
|
int main(void)
|
||||||
|
{
|
||||||
|
uiInitError err;
|
||||||
|
|
||||||
memset(&err, 0, sizeof (uiInitError));
|
memset(&err, 0, sizeof (uiInitError));
|
||||||
err.Size = sizeof (uiInitError);
|
err.Size = sizeof (uiInitError);
|
||||||
if (!uiInit(NULL, &err)) {
|
if (!uiInit(NULL, &err)) {
|
||||||
fprintf(stderr, "error initializing libui: %s\n", err.Message);
|
fprintf(stderr, "error initializing libui: %s\n", err.Message);
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
|
// ...
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue