mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-10-06 13:48:09 +03:00
Updated Spice SDK (markdown)
+4
-3
@@ -15,10 +15,11 @@ See one of the `.def` files in the sample section for an example.
|
||||
|
||||
#### Implement `spice_sdk_entry_point` in your project
|
||||
|
||||
Sample C++ code:
|
||||
Here is a minimal example:
|
||||
|
||||
```cpp
|
||||
|
||||
SPICE_SDK_V0 spice_sdk = {};
|
||||
spice_sdk_destroy_callback_func destroy_callback;
|
||||
|
||||
SPICE_SDK_ENTRY_POINT
|
||||
@@ -29,12 +30,12 @@ spice_sdk_entry_point(
|
||||
SPICE_SDK_STATUS_CODE status;
|
||||
|
||||
spice.size = sizeof(spice);
|
||||
status = init(0, destroy_callback, &spice);
|
||||
status = init(0, destroy_callback, &spice_sdk);
|
||||
if (status != SPICE_SDK_STATUS_SUCCESS) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// after this point, you can call into the functions in "spice" function table
|
||||
// after this point, you can call into the functions in "spice_sdk" function table
|
||||
// spin up a worker thread here
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user