Netpaint 1.0
Copyright 2004 Polyart
Started: Sept 27, 2004
Status: Nearly complete; missing a few features.
Goals
Design a simple usable network useable paintbrush program. The network and file part of the polyart stream library will be completed and tested during this project. Several other useful “polylib” libraries will be created.
Description by Sample Usage
Server Usage:
A master server must always be running. Players can run the supplied program to set up their own server. Running one will create a tray icon. The tray icon will be green when players are not connected and red when they are. Each server will have one bitmap associated with it. Left clicking the server tray icon will open the server information dialog. It will display basic server information such as how many players are connected and their ping. The current bitmap state will also be displayed. Right clicking a server will display a popup menu with the choices Exit, and Settings. Setting will provide an option to run on windows startup.
Netpaint Usage
Player selects a server from the available servers. The current canvas is downloaded from the server and is displayed. The player may select several tools and several colors. The initial tool is a draw line tool. The player may click and drag the mouse to draw lines on the canvas. If other players connect to the same server they may also interact with the same canvas and both players will see each other’s work in real time. Players may also type messages to each other.
Design
The following libraries will need to be coded.
- CServerConnecter - Routines for selecting and connecting to a server from a server list
- CDisplay - A non-glut window manager
- The polyart stand alone server will be modified to support multiple games without modification
- A separate program will be created to wrap the stand alone server to allow it to run in the tray
Since the ultimate goal is to create usable routines for future games, the program will be using OpenGL. The canvas is a 500x500 24 bit RGB bitmap rendered to the screen on a plane. Each line is drawn to the canvas by rendering to the canvas texture. The brush is a PNG file which is a circle with transparent edges. When the player draws lines, the -control sequence is sent to the server. All control sequences are sent to each player. Temporary local lines are displayed until the server is able to send back the line control sequence.
Implementation Stages
Stage 1: Basic draw: Complete
- Create window.
- Create the canvas using a pbuffer.
- Convert mouse clicks and drags into control sequences.
- Connect an input and output stream endpoint together to use as a pipe. Send control sequences through the stream.
- Create the brush PNG.
- Render brush PNG to the canvas based on the control sequences.
Stage 2: Basic Network: Complete
- Finish socket stream endpoints.
- Create a simple bounce server. It will send the data it receives back.
- Create CNetClient class to create socket stream endpoints which are connected to a server. It will connect to a master server, enumerate the available servers, and connect to the selected server.
- Erase the current stream and replace with two new streams
- An input stream endpoint connected to the net output endpoint
- A net input endpoint connected to an output stream endpoint