MultiPlayer.h 547 B

1234567891011121314151617181920212223242526
  1. #pragma once
  2. #include <stdint.h>
  3. #include <stdio.h>
  4. #include "game.h"
  5. #include "game_common.h"
  6. typedef struct {
  7. unsigned int screen_w;
  8. unsigned int screen_h;
  9. GameState state;
  10. GameShapes shapes;
  11. int sock;
  12. int conn;
  13. FILE *conn_s;
  14. } MultiPlayer;
  15. MultiPlayer MultiPlayer_alloc(
  16. const unsigned int screen_w,
  17. const unsigned int screen_h,
  18. const char *server_host,
  19. const uint16_t server_port
  20. );
  21. void MultiPlayer_free(MultiPlayer *const mp);
  22. void MultiPlayer_tick(MultiPlayer *const mp, const double delta);