multiplayer pong game for LPC 1768
Dependencies: mbed MbedJSONValue mbed-rtos Adafruit_ST7735 Adafruit_GFX EthernetInterface DebouncedInterrupt
graphics.h@16:7fd48cda0773, 2020-11-13 (annotated)
- Committer:
- vsoltan
- Date:
- Fri Nov 13 23:02:56 2020 +0000
- Revision:
- 16:7fd48cda0773
- Child:
- 17:32ae1f106002
finished display wiring and added graphics class
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
vsoltan | 16:7fd48cda0773 | 1 | |
vsoltan | 16:7fd48cda0773 | 2 | #ifndef GRAPHICS_H |
vsoltan | 16:7fd48cda0773 | 3 | #define GRAPHICS_H |
vsoltan | 16:7fd48cda0773 | 4 | |
vsoltan | 16:7fd48cda0773 | 5 | #include "Adafruit_ST7735.h" |
vsoltan | 16:7fd48cda0773 | 6 | #include "gamestate.h" |
vsoltan | 16:7fd48cda0773 | 7 | |
vsoltan | 16:7fd48cda0773 | 8 | #define P_MOSI p5 |
vsoltan | 16:7fd48cda0773 | 9 | #define P_MISO p6 |
vsoltan | 16:7fd48cda0773 | 10 | #define P_SOCK p7 |
vsoltan | 16:7fd48cda0773 | 11 | #define P_CS p9 |
vsoltan | 16:7fd48cda0773 | 12 | #define P_RS p20 |
vsoltan | 16:7fd48cda0773 | 13 | #define P_DC p19 |
vsoltan | 16:7fd48cda0773 | 14 | |
vsoltan | 16:7fd48cda0773 | 15 | class Graphics { |
vsoltan | 16:7fd48cda0773 | 16 | private: |
vsoltan | 16:7fd48cda0773 | 17 | Adafruit_ST7735 *tft; |
vsoltan | 16:7fd48cda0773 | 18 | public: |
vsoltan | 16:7fd48cda0773 | 19 | Graphics(); |
vsoltan | 16:7fd48cda0773 | 20 | void renderLaunchScreen(); |
vsoltan | 16:7fd48cda0773 | 21 | void renderGameState(GameState *gs); |
vsoltan | 16:7fd48cda0773 | 22 | void renderBall(); |
vsoltan | 16:7fd48cda0773 | 23 | void renderPlayers(); |
vsoltan | 16:7fd48cda0773 | 24 | }; |
vsoltan | 16:7fd48cda0773 | 25 | |
vsoltan | 16:7fd48cda0773 | 26 | void renderLaunchScreen(); |
vsoltan | 16:7fd48cda0773 | 27 | void renderGameState(GameState *gs); |
vsoltan | 16:7fd48cda0773 | 28 | void renderBall(); |
vsoltan | 16:7fd48cda0773 | 29 | void renderPlayers(); |
vsoltan | 16:7fd48cda0773 | 30 | |
vsoltan | 16:7fd48cda0773 | 31 | #endif // GRAPHICS_H |