warning: Creating default object from empty value in /home/hplus/ on line 33.
Not very complex stuff.
jwatte's picture


Public headers (API) for the Etwork networking library.

jwatte's picture


//  chatserver.cpp
//  The Win32 GUI for the chat server sample.
//  This file runs the dialogs, and defers to the chathost.cpp 
//  file for networking and user management.
#include <winsock2.h>
#include <windows.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include <string>
#include "etwork/etwork.h"
#include "etwork/timer.h"

jwatte's picture


//  chathost.h
//  This file defined a simple interface for a service that 
//  hosts text chat over a specific port.
//  Intended as a sample for how to use the message-layer 
//  functionality of the Etwork networking library.
//  <a href="</p>
<p>#if" title="</p>
<p>#if</p></a> !defined( chathost_h )
#define chathost_h
//  Information kept about each client.
struct ChatClient {

jwatte's picture


//  chatclient.cpp
//  This file is an example of how to write a client program 
//  using the Etwork networking message API.
//  It is intended to communicate with a server running 
//  the "chatserver.cpp/chathost.cpp" code, over TCP or UDP.
#include "etwork/etwork.h"
#include "etwork/timer.h"
#include "etwork/errors.h"
#include "resource.h"

jwatte's picture


The sample client program in the Etwork networking library.

jwatte's picture

Online Browsable Source-code

These pages contain the source code for Etwork version 0.4, in online browsable form.

jwatte's picture

Mouse Picking in XNA Framework using Viewport.Unproject

When developing a PC program for the XNA framework, you usually find that you need to do mouse picking. This means taking the mouse coordinates, and turning them into a ray that you can then raycast in your world to see what, if anything, is being hit when the user clicks the mouse.

jwatte's picture

The Direct3D/XNA vertex transform pipeline -- how to go between model coordinates and screen coordinates, and back again!

1) WORLD matrix. This takes vertices from object-local space (0,0,0 in the middle of the object) to world space (position and orientation applied based on 0,0,0 at your "world origin" position). This is a convenient space to do normal mapped lighting and environmental reflection in.

jwatte's picture

Making a sprite follow a path

A while back, I posted a simple program on the XNA forums that showed how to define a path, and then have objects follow that path. I figured I'd copy the code from there onto this site, for easy reference. The program below is a command-line C# program; you can compile it from the command line with "csc flypath.cs" and run it to test it out. Or you can copy the "follower" class from the middle, and use it in your XNA project. (The additional code, including the declaration of Vector2, is just there to make the test program work stand-alone)

jwatte's picture

A simple illustration of different interpolation functions

Here are a few interpolation functions illustrated (I drew these in Photoshop, so they're not bit accurate, but should show the variations well enough):

Linear Interpolation
Linear interpolation

Syndicate content