move grid functions to trait
This commit is contained in:
parent
314bec36f3
commit
bcf040911d
11 changed files with 96 additions and 88 deletions
14
README.md
14
README.md
|
@ -63,15 +63,13 @@ int main(void) {
|
|||
|
||||
sp2_PixelGrid *pixels = sp2_pixel_grid_new(sp2_PIXEL_WIDTH, sp2_PIXEL_HEIGHT);
|
||||
sp2_pixel_grid_fill(pixels, true);
|
||||
|
||||
command = sp2_command_bitmap_linear_win(0, 0, pixels); // pixels get consumed here
|
||||
if (command == NULL)
|
||||
return 4;
|
||||
if (!sp2_connection_send(connection, command)) // command gets consumed here
|
||||
return 5;
|
||||
|
||||
// connection does not get consumed and has to be freed manually
|
||||
sp2_connection_dealloc(connection);
|
||||
sp2_Command *command = sp2_command_bitmap_linear_win(0, 0, pixels, Uncompressed);
|
||||
sp2_Packet *packet = sp2_packet_from_command(command);
|
||||
if (!sp2_connection_send(connection, packet))
|
||||
return 1;
|
||||
|
||||
sp2_connection_dealloc(connection);
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue