PumpkinBrush
|
Entry point into the program. More...
#include <SFML/Graphics.hpp>
#include <SFML/Graphics/Image.hpp>
#include <SFML/Graphics/Texture.hpp>
#include <SFML/Graphics/Sprite.hpp>
#include <SFML/Network.hpp>
#include <iostream>
#include <ostream>
#include <string>
#include <string.h>
#include "time.h"
#include "App.hpp"
#include "Command.hpp"
#include "Draw.hpp"
#include "Erase.hpp"
#include "Brush.hpp"
#include "Pen.hpp"
#include "Clear.hpp"
#include <SFML/OpenGL.hpp>
Classes | |
struct | metaData |
This struct represents meta data that will be sent to and from the server. It will be used to pack into the SFML API's Packet class and also to unpack that same data. More... | |
Functions | |
void | remoteDraw (App &app, sf::Uint32 xToPass, sf::Uint32 yToPass, sf::Uint32 colorOfModification, sf::Uint32 sizeOfModification, sf::Uint32 brushTypeOfModification) |
The remoteDraw function allows a Client to draw locally the received draw commands from the Server representing draw commands sent from a different client. More... | |
void | packetReceiver (App &app) |
The packetReceiver function uses the socket with in App close to receive information from the server then controls the work flow based on the unpacked command received from the server. More... | |
void | initialization (void) |
The initialization function simply verifies the Application has started by printing out a statement to the command line. More... | |
void | update (App &app) |
The update function controls key and mouse events on the painting canvas of the application. Then updates the canvas accordingly. This function also is where the packetReceiver function is called allowing inputs from the Server to be handled. More... | |
void | draw (App &app) |
The draw call, this is how the canvas refreshes. More... | |
int | main (int argc, char *argv[]) |
The entry point into our program. More... | |
Variables | |
sf::TcpSocket | clientSocket |
sf::Socket::Status | status |
sf::Packet | packet |
Entry point into the program.
void draw | ( | App & | app | ) |
The draw call, this is how the canvas refreshes.
void initialization | ( | void | ) |
The initialization function simply verifies the Application has started by printing out a statement to the command line.
int main | ( | int | argc, |
char * | argv[] | ||
) |
The entry point into our program.
void packetReceiver | ( | App & | app | ) |
The packetReceiver function uses the socket with in App close to receive information from the server then controls the work flow based on the unpacked command received from the server.
app | an App object that allows us to receive packets from the Server as well as execute various commands based on the received information. |
void remoteDraw | ( | App & | app, |
sf::Uint32 | xToPass, | ||
sf::Uint32 | yToPass, | ||
sf::Uint32 | colorOfModification, | ||
sf::Uint32 | sizeOfModification, | ||
sf::Uint32 | brushTypeOfModification | ||
) |
The remoteDraw function allows a Client to draw locally the received draw commands from the Server representing draw commands sent from a different client.
app | an App object that allows us to execute draw commands outside of the update loop. |
xToPass | a sf::Uint32 variable representing the x coordinate for where the remote draw command took place. |
yToPass | a sf::Uint32 variable representing the y coordinate for where the remote draw command took place. |
colorOfModification | a sf::Uint32 variable representing the color drawn where the remote draw command took place. |
sizeOfModification | a sf::Uint32 variable representing the size of the brush(or pen) where the remote draw command took place (small, medium, or large). |
brushTypeOfModification | a sf::Uint32 variable representing the brush type (brush or pen) for where the remote draw command took place. |
void update | ( | App & | app | ) |
The update function controls key and mouse events on the painting canvas of the application. Then updates the canvas accordingly. This function also is where the packetReceiver function is called allowing inputs from the Server to be handled.
app | an App object that allows us to access and manipulate the canvas. |
sf::TcpSocket clientSocket |
sf::Packet packet |
sf::Socket::Status status |