move examples into package (include them in published crate)
This commit is contained in:
parent
5514f60c28
commit
c92493fad1
22 changed files with 26 additions and 165 deletions
1
crates/servicepoint_binding_c/examples/lang_c/src/lib.rs
Normal file
1
crates/servicepoint_binding_c/examples/lang_c/src/lib.rs
Normal file
|
@ -0,0 +1 @@
|
|||
|
19
crates/servicepoint_binding_c/examples/lang_c/src/main.c
Normal file
19
crates/servicepoint_binding_c/examples/lang_c/src/main.c
Normal file
|
@ -0,0 +1,19 @@
|
|||
#include <stdio.h>
|
||||
#include "servicepoint.h"
|
||||
|
||||
int main(void) {
|
||||
sp_Connection *connection = sp_connection_open("localhost:2342");
|
||||
if (connection == NULL)
|
||||
return 1;
|
||||
|
||||
sp_PixelGrid *pixels = sp_pixel_grid_new(sp_PIXEL_WIDTH, sp_PIXEL_HEIGHT);
|
||||
sp_pixel_grid_fill(pixels, true);
|
||||
|
||||
sp_Command *command = sp_command_bitmap_linear_win(0, 0, pixels, Uncompressed);
|
||||
sp_Packet *packet = sp_packet_from_command(command);
|
||||
if (!sp_connection_send(connection, packet))
|
||||
return 1;
|
||||
|
||||
sp_connection_dealloc(connection);
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue