servicepoint-binding-c/crates/servicepoint_binding_c/examples/lang_c/src/main.c

20 lines
563 B
C
Raw Normal View History

2024-05-12 18:28:53 +02:00
#include <stdio.h>
#include "servicepoint.h"
2024-05-12 18:28:53 +02:00
int main(void) {
sp_Connection *connection = sp_connection_open("localhost:2342");
2024-05-12 18:28:53 +02:00
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_CCommand *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;
2024-05-12 18:28:53 +02:00
sp_connection_dealloc(connection);
2024-05-12 18:28:53 +02:00
return 0;
}