Index: ode_net.h
===================================================================
--- ode_net.h	(revision 0)
+++ ode_net.h	(revision 1)
@@ -0,0 +1,25 @@
+#ifndef _ODE_NET_H
+#define _ODE_NET_H
+extern int raydium_ode_network_MaxElementsPerPacket (void);
+extern int raydium_network_nid_element_find (int nid);
+extern void raydium_ode_network_newdel_event (int type, char *buff);
+extern void raydium_ode_network_nidwho_event (int type, char *buff);
+extern void raydium_ode_network_explosion_event (int type, char *buff);
+extern void raydium_ode_network_init (void);
+extern char raydium_ode_network_TimeToSend (void);
+extern void raydium_ode_network_element_send (short nelems, int *e);
+extern void raydium_ode_network_element_send_all (void);
+extern void raydium_ode_network_element_send_random (int nelems);
+extern void raydium_ode_network_element_send_iterative (int nelems);
+extern void raydium_ode_network_nidwho (int nid);
+extern void raydium_ode_network_apply (raydium_ode_network_Event * ev);
+extern void raydium_ode_network_read (void);
+extern void raydium_ode_network_element_new (int e);
+extern void raydium_ode_network_element_delete (int e);
+extern void raydium_ode_network_explosion_send (raydium_ode_network_Explosion * exp);
+extern char raydium_ode_network_element_isdistant (int elem);
+extern char raydium_ode_network_element_isdistant_name (char *elem);
+extern char raydium_ode_network_element_distantowner(int elem);
+extern char raydium_ode_network_element_distantowner_name(char *elem);
+extern void raydium_ode_network_element_trajectory_correct (int elem);
+#endif
Index: signal.h
===================================================================
--- signal.h	(revision 0)
+++ signal.h	(revision 1)
@@ -0,0 +1,17 @@
+#ifndef _HEADERS_SIGNAL_H
+#define _HEADERS_SIGNAL_H
+/*=
+Signals
+2500
+**/
+
+// Quickview
+/**
+There almost nothing to said about signals management, except that Raydium 
+will try to catch SIGINT signal (sended by CTRL+C sequence, for example).
+There's nothing else for now, but we plan a user callback for this signal. 
+**/
+
+extern void raydium_signal_handler (int sig);
+extern void raydium_signal_install_trap (void);
+#endif
Index: land.h
===================================================================
--- land.h	(revision 0)
+++ land.h	(revision 1)
@@ -0,0 +1,19 @@
+#ifndef _LAND_H
+#define _LAND_H
+
+/*=
+Land
+1800
+**/
+
+// Introduction
+/**
+Historically, this file was quite complex, since Raydium was using
+his own physic. Now, this file is almost empty, since ODE integration
+now provides new landscape functions.
+**/
+
+extern GLfloat raydium_land_internal_landtmp (GLfloat x, GLfloat y, GLfloat phase, GLfloat ampl, GLfloat periode);
+extern void raydium_land_draw_water (GLfloat phase, GLfloat ampl, GLfloat periode, int sub, GLfloat pas, char *texture);
+extern GLfloat raydium_land_surface (GLfloat x, GLfloat y, GLfloat * nx, GLfloat * ny, GLfloat * nz);
+#endif
Index: render.h
===================================================================
--- render.h	(revision 0)
+++ render.h	(revision 1)
@@ -0,0 +1,88 @@
+#ifndef _RENDER_H
+#define _RENDER_H
+/*=
+Rendering
+1300
+**/
+
+// Introduction
+/*=
+render.c contains Raydium rendering core, so only "public" and 
+interesting function will be documented.
+
+It' obvious for me that many parts of this code have to be 
+rewritten (tips: slow, buggy, old, ... :) 
+**/
+
+
+extern int  raydium_rendering_prepare_texture_unit (GLenum tu, GLuint tex);
+/**
+This function will "prepare" hardawre texture unit ##tu## to render ##tex## texture.
+There almost no reason to call this function by yourself.
+**/
+
+extern void raydium_rendering_internal_prepare_texture_render (GLuint tex);
+/**
+Same as above, but for texture unit #0 only.
+**/
+
+extern void raydium_rendering_internal_restore_render_state (void);
+/**
+Internal. Deprecated.
+**/
+
+// DO NOT DOCUMENT THIS ... THING !
+extern char infov (GLfloat x, GLfloat y);
+
+extern void raydium_rendering_from_to (GLuint from, GLuint to);
+/**
+Renders vertices from ##from## to ##to##.
+Using object management functions is a better idea.
+**/
+
+extern void raydium_rendering (void);
+/**
+Renders all vertices (probably useless, now).
+**/
+
+extern void raydium_rendering_finish (void);
+/**
+You must call this function at the end of each frame. This will flush all
+commands to hardware, fire a lot off callbacks, and prepare next frame.
+**/
+
+extern void raydium_rendering_wireframe (void);
+/**
+Switch to wireframe rendering.
+**/
+
+extern void raydium_rendering_normal (void);
+/**
+Switch back to standard rendering.
+**/
+
+extern void raydium_rendering_rgb_force (GLfloat r, GLfloat g, GLfloat b);
+/**
+Force all RGB colored vertices to take ##(r,g,b)## color. One example of this
+use is for making "team colored" cars : Do not apply textures to some faces
+while modelling, and force to team color each time you render a car.
+**/
+
+extern void raydium_rendering_rgb_normal (void);
+/**
+Disable "rgb force" state. See above.
+**/
+
+extern void raydium_rendering_displaylists_disable(void);
+/**
+Disable display lists usage.
+Some old video cards and broken drivers may get better performances WITHOUT
+display lists (on large objects, mainly).
+**/
+
+extern void raydium_rendering_displaylists_enable(void);
+/**
+Enable display lists usage. default state.
+**/
+
+#endif
Index: file.h
===================================================================
--- file.h	(revision 0)
+++ file.h	(revision 1)
@@ -0,0 +1,93 @@
+#ifndef _FILE_H
+#define _FILE_H
+/*=
+Files
+2100
+**/
+
+// Warning
+/**
+It's important to use only functions with ##raydium_file_*## prefix.
+All other functions may change or disappear. Upper level functions are
+available (see ##object.c##).
+**/
+
+// Introduction
+/**
+##file.c## use .tri mesh files (text), available in 3 versions:
+
+1. version 1: providing normals and uv texture mapping informations.
+2. version 0: providing normals.
+3. version -1: only providing vertices. 
+	 
+Version 1 example file:
+%%
+1
+5.1 15.75 -3.82 0.0000 0.0000 -1.0000 0.5158 0.5489 rgb(0.5,0.5,0.5)
+6.3 11.75 -3.82 0.0000 0.0000 -1.0000 0.5196 0.5365 rgb(0.5,0.5,0.5)
+5.0 11.75 -3.82 0.0000 0.0000 -1.0000 0.5158 0.5365 rgb(0.5,0.5,0.5)
+...
+%%
+	      
+You can find the file version on first line, and then data.
+Next lines: vertex position (x,y,z), normal (x,y,z), texture mapping (u,v)
+and texture (string). 
+**/
+
+
+#define DONT_SAVE_DUMMY_TEXTURE
+extern void raydium_file_dirname(char *dest,char *from);
+/**
+Reliable and portable version of libc's ##dirname## function.
+This function extracts directory from ##from## filename, and writes it
+to ##dest##.
+No memory allocation will be done by the function.
+**/
+
+extern void raydium_file_log_fopen_display(void);
+/**
+Display (console) all filenames that were opened before the call.
+##--files## command line option will call this function at the application's
+exit, closed or not.
+**/
+
+extern FILE *raydium_file_fopen(char *file, char *mode);
+/**
+Raydium wrapper to libc's ##fopen## function.
+This function will:
+- Update some stats
+- Try to download the file from repositories if no local version is found, or
+will try to update the file if asked (##--repository-refresh## or 
+##repository-force##). See R3S on Raydium's Wiki.
+**/
+
+#ifdef PHP_SUPPORT
+extern int raydium_rayphp_repository_file_get(char *file);
+#else
+#define raydium_php_repository_file_get fopen
+#endif
+extern void dump_vertex_to (char *filename);
+/**
+This function save all scene to filename (.tri file) in version 1.
+Vertice may be sorted.
+Please, try to do not use this function.
+**/
+
+extern void dump_vertex_to_alpha (char *filename);
+/**
+Now useless and deprecated.
+**/
+
+extern int raydium_file_set_textures (char *name);
+/**
+Internal use.
+This function analyze texture filename, and search for extended multitexturing
+informations (u,v and another texture).
+**/
+
+extern void read_vertex_from (char *filename);
+/**
+Loads filename. Again, avoid use of this function.
+**/
+
+#endif
Index: random.h
===================================================================
--- random.h	(revision 0)
+++ random.h	(revision 1)
@@ -0,0 +1,52 @@
+#ifndef _RANDOM_H
+#define _RANDOM_H
+/*=
+Random
+400
+**/
+
+// Introduction
+/**
+These functions deals with random numbers generation.
+**/
+
+extern void raydium_random_randomize (void);
+/**
+This function initialize the random number generator 
+with current time for seed.
+**Note: ** You are not supposed to use this function.
+**/
+
+extern GLfloat raydium_random_pos_1 (void);
+/**
+"positive, to one": 0 <= res <= 1
+**/
+
+extern GLfloat raydium_random_neg_pos_1 (void);
+/**
+"negative and positive, one as absolute limit": -1 <= res <= 1
+**/
+
+extern GLfloat raydium_random_0_x (GLfloat i);
+/**
+"zero to x": 0 <= res <= x
+**/
+
+extern GLfloat raydium_random_f (GLfloat min, GLfloat max);
+/**
+min <= res <= max (float)
+**/
+
+extern int raydium_random_i (int min, int max);
+/**
+min <= res <= max (integer)
+**/
+
+extern char raydium_random_proba (GLfloat proba);
+/**
+Returns true or false (0 or 1) depending of "proba" factor.
+##proba## must be: 0 <= proba <=1
+ex: 50% = 0.5
+**/
+
+#endif
Index: log.h
===================================================================
--- log.h	(revision 0)
+++ log.h	(revision 1)
@@ -0,0 +1,31 @@
+#ifndef _LOG_H
+#define _LOG_H
+
+/*=
+Logging
+300
+**/
+
+// Introduction to log.c
+/**
+Raydium uses and provides his own logging system, 
+hidden behind a single function, as shown below.
+**/
+
+#ifndef RAYDIUM_NETWORK_ONLY
+extern void raydium_console_line_add (char *format, ...);
+#endif
+extern void raydium_log (char *format, ...);
+/**
+This function must be used like "printf", using a format 
+("%s, %i, %x, ...") and then, suitable variables, 
+but without the end-line char ('\n')
+
+%%(c)
+raydium_log("You are player %i, %s",player_number,player_name);
+%%
+ 
+For now, this function writes to the parent terminal and the in-game console, with "Raydium: " string prefix.
+The user can force logging to a file, using ##--logfile## command line switch.
+**/
+#endif
Index: raydoc.php
===================================================================
--- raydoc.php	(revision 0)
+++ raydoc.php	(revision 1)
@@ -0,0 +1,256 @@
+#!/usr/bin/php
+<?
+
+// This script generates a Wiki(ni) style documentation from comments of
+// all header files of Raydium (raydium/header/*.h)
+
+$page="http://raydium.yoopla.org/wiki/RaydiumApiReference";
+
+$intro="
+======Raydium API Reference======
+
+=====CQFD Corp.=====
+
+This document is the most up-to-date version. **This is a work in progress**:
+only the core of Raydium is described here, and there's again some 
+errors and wrong informations. Try, wait, or contribute ;)
+
+\"\"<a href=$page#index>Index of all Raydium functions</a>\"\"
+
+----
+This document is autogenerated, any change will be lost,
+use RaydiumApiReferenceComments for any need.
+{DATE}, for Raydium **{VERSION}**
+----
+";
+
+
+
+function getTagLine($tag,$lines,$from=0)
+{
+for($i=$from;$i<count($lines);$i++)
+    {
+    $l=$lines[$i];
+    if(substr(trim($l),0,strlen($tag))==$tag)
+	return $i;
+    }
+return -1;
+}
+
+function getVersion()
+{
+$file="../main.c";
+$f=file($file);
+$l=getTagLine("char *raydium_version",$f);
+$v=explode('"',trim($f[$l]));
+return $v[1];
+}
+
+function getMain($filename,$offset)
+{
+$f=file($filename);
+$l=getTagLine("/*=",$f);
+if($l==-1)
+    return -1;
+$res=trim($f[$l+$offset]);
+return $res;
+}
+
+function getPriority($filename)
+{
+$res=trim(getMain($filename,2));
+if(is_numeric($res))
+    return $res;
+else
+    return -1;
+}
+
+function getTitle($filename)
+{
+return trim(getMain($filename,1));
+}
+
+
+
+function getHeaders($directory)
+{
+$res=array();
+if (is_dir($directory)) 
+    {
+	if ($dh = opendir($directory)) 
+	{
+	    while (($file = readdir($dh)) !== false) 
+	    {
+		if(substr($file,-2)==".h")
+		{
+		    $res[]=$file;
+		}
+	    }
+	closedir($dh);
+	}
+    }
+    else echo "'$directory' is not a directory";
+return $res;
+}
+
+
+function h1($str)
+{
+echo "\n=====$str:=====\n";
+}
+
+function h2($str)
+{
+echo "====$str:====\n";
+}
+
+function body($str)
+{
+echo $str."\n\n";
+}
+
+function intro($str)
+{
+$str=str_replace("{DATE}","Generated: ".date("Y-m-d H:i:s"),$str);
+$str=str_replace("{VERSION}",getVersion(),$str);
+echo $str;
+}
+
+$index=array();
+function addToIndex($f)
+{
+static $i=0;
+global $index;
+
+$p=strpos($f,"raydium_");
+if($p!==false)
+    $f=substr($f,$p);
+
+$index[$i]=$f."|$i";
+return $i++;
+}
+
+// Main
+
+$files=getHeaders(".");
+//var_dump($files);
+if($files==-1)
+    die("No header found");
+
+unset($sorted);
+for($i=0;$i<count($files);$i++)
+    {
+    $file=$files[$i];
+    $p=getPriority($file);
+    if($p==-1)
+	$p=999000+$i;
+	
+    while(isset($sorted[$p]))
+	$p++;
+    $sorted[$p]=$file;
+    }
+ksort($sorted);
+$sorted=array_values($sorted);
+//var_dump($sorted);
+
+// Files are sorted, now
+
+intro($intro);
+
+for($i=0;$i<count($sorted);$i++)
+    {
+    $file=$sorted[$i];
+    $title=getTitle($file);
+
+    if($title==-1) 
+	{
+	h1(($i+1)." no documentation for $file");
+	continue;
+	}
+    
+    h1(($i+1)." $title");
+    
+    $f=file($file);
+    $last=0;
+    $n=0;
+    while(($l=getTagLine("/**",$f,$last))!=-1)
+	{
+	$title=trim($f[$l-1]);
+	if($title=="")
+	    $title="// unknown item";
+	    
+	// types:
+	// 1 - Comment (//)
+	// 2 - Macro (#)
+	// 3 - Code (...)
+	$type=3;
+	if($title[0]=="/")
+	    {
+	    $type=1;
+	    $title=trim(substr($title,2));
+	    }
+
+	if($title[0]=="#")
+	    {
+	    $type=2;
+	    $pos=strpos($title,")");
+	    if($pos)
+		{
+		$title=substr($title,0,$pos+1);
+		}
+	    $title=trim(str_replace("#define ","",$title))." (macro)";
+	    
+	    }
+
+	if($type==3)
+	    {
+	    if(substr($title,0,7)=="extern ")
+		$title=trim(substr($title,7));
+	    if($title[strlen($title)-1]==";")
+		$title=substr($title,0,-1);
+	    $title=trim(str_replace("**","* *",$title));
+	    }
+	
+	if($type==2 || $type==3)
+	    $id=addToIndex($title);
+	
+	h2('""'."<a name=$id></a>".'""'.($i+1).".".($n+1)." $title");
+	
+	$last=$l+1;
+	$end=getTagLine("**/",$f,$last);
+	if($end==-1)
+	    die("expected '**/' (started line $l)");
+	
+	unset($body);
+/*	for($j=$l+1;$j<$end;$j++)
+	    {
+	    $lj=trim($f[$j]);
+	    if($lj=="") 
+		$lj="\n\n";
+	    else
+		$lj.=" ";
+	    $body[]=$lj;
+	    }
+	$str=implode("",$body);*/
+	for($j=$l+1;$j<$end;$j++)
+	    {
+	    $lj=trim($f[$j]);
+	    $body[]=$lj;
+	    }
+	$str=@implode("\n",$body);
+	body($str);
+	
+	$last=$end+1;
+	$n++;
+	}
+    }
+
+sort($index);
+h1('""<a name=index></a>""Index');
+for($i=0;$i<count($index);$i++)
+    {
+    $j=explode("|",$index[$i]);
+    $k=$j[0];
+    $l=$j[1];
+    echo '""'."<a href=$page#$l><tt>$k</tt></a>".'""'."\n";
+    }

Property changes on: raydoc.php
___________________________________________________________________
Added: svn:executable
\ No newline at end of property
Index: gui.h
===================================================================
--- gui.h	(revision 0)
+++ gui.h	(revision 1)
@@ -0,0 +1,318 @@
+#ifndef _GUI_H
+#define _GUI_H
+
+#include "../gui.h"
+
+/*=
+Graphic User Interfaces
+3200
+**/
+
+// Introduction
+/**
+Raydium provides a support for simple GUI definitions thru a set of
+functions (RayPHP interface is available).
+Raydium's GUI are themable, using ".gui" theme text files. A default "full"
+theme is provided as "theme-raydium2.gui" (and suitable ".tga" file) on the 
+data repository.
+Complete informations about theme building are readable in this file.
+**/
+
+// Vocabulary
+/**
+This API will allow declaeation of:
+- "widgets" (label, button, edit box, track bar, check box, combo box)
+- "windows" (containers for widgets)
+
+"Focus" is supported for windows and widgets. The final user will not have
+any control on windows focus. "Tab" key is used for widget focus cycling.
+
+Widgets and windows are identified by a name or by a unique numeric id.
+**/
+
+
+// Building
+/**
+The idea is simple: build a window (position and size), and create
+widgets over this window.
+All widgets are created using the current sizes (x,y and font). See 
+suitable function).
+Buttons provides a simple callback, and all other widgets (but label)
+provides an unified "read" function. Window deletion is also possible.
+
+You must set current theme before any of this operations (see below).
+**/
+
+void raydium_gui_window_init(int window);
+/**
+Internal use. Will reset ##window##.
+**/
+
+void raydium_gui_init(void);
+/**
+Internal use. Will init all GUI API. Called once by Raydium.
+**/
+
+void raydium_gui_theme_init(void);
+/**
+Internal use. Will init theme.
+**/
+
+int raydium_gui_theme_load(char *filename);
+/**
+This function will load and set current theme (".gui" files). You must load
+a theme by yourself, since Raydium will never do it for you.
+This function must be called before GUI building.
+**/
+
+char raydium_gui_window_isvalid(int i);
+/**
+Mostly internal. Will check if ##i## window is valid.
+**/
+
+int raydium_gui_window_find(char *name);
+/**
+Will search ##name## window's numeric id.
+**/
+
+char raydium_gui_widget_isvalid(int i, int window);
+/**
+Mostly internal. Will check if ##i## widget of ##window## is valid.
+**/
+
+int raydium_gui_widget_find(char *name, int window);
+/**
+Will search ##name## widget numeric id (for ##window##).
+**/
+
+void raydium_gui_widget_next(void);
+/**
+Mostly internal. Cycle focus.
+**/
+
+void raydium_gui_widget_draw_internal(GLfloat *uv, GLfloat *xy);
+/**
+Internal use. Generic drawing function.
+**/
+
+void raydium_gui_button_draw(int w, int window);
+/**
+Internal use.
+**/
+
+void raydium_gui_track_draw(int w, int window);
+/**
+Internal use.
+**/
+
+void raydium_gui_label_draw(int w, int window);
+/**
+Internal use.
+**/
+
+void raydium_gui_edit_draw(int w, int window);
+/**
+Internal use.
+**/
+
+void raydium_gui_check_draw(int w, int window);
+/**
+Internal use.
+**/
+
+void raydium_gui_combo_draw(int w, int window);
+/**
+Internal use.
+**/
+
+void raydium_gui_window_draw(int window);
+/**
+Internal use.
+**/
+
+void raydium_gui_draw(void);
+/**
+Internal use. GUI drawing callback.
+**/
+
+int raydium_gui_button_read(int window, int widget, char *str);
+/**
+Internal use. Button read accessor (dummy).
+**/
+
+int raydium_gui_label_read(int window, int widget, char *str);
+/**
+Internal use. Label read accessor (dummy).
+**/
+
+int raydium_gui_track_read(int window, int widget, char *str);
+/**
+Internal use. Track read accessor.
+**/
+
+int raydium_gui_edit_read(int window, int widget, char *str);
+/**
+Internal use. Edit read accessor.
+**/
+
+int raydium_gui_check_read(int window, int widget, char *str);
+/**
+Internal use. Check read accessor.
+**/
+
+int raydium_gui_combo_read(int window, int widget, char *str);
+/**
+Internal use. Combo read accessor.
+**/
+
+void raydium_gui_show(void);
+/**
+Will show current built GUI.
+**/
+
+void raydium_gui_hide(void);
+/**
+Will hide current built GUI. This is the default state.
+**/
+
+char raydium_gui_isvisible(void);
+/**
+Will return current visibility of GUI.
+**/
+
+void raydium_gui_window_delete(int window);
+/**
+Will delete ##window##. No further access to widgets is possible.
+**/
+
+void raydium_gui_window_delete_name(char *window);
+/**
+Same as above, but using ##window##'s name.
+**/
+
+void raydium_gui_widget_sizes(GLfloat sizex, GLfloat sizey, GLfloat font_size);
+/**
+Each widget is created using 3 size: X size, Y size and font size. This
+function will allow you to set all sizes for a widget or a group of widget.
+Unit: percents (screen)
+**/
+
+int raydium_gui_window_create(char *name, GLfloat px, GLfloat py, GLfloat sizex, GLfloat sizey);
+/**
+Obviously, this function will create a new window. This window will take focus
+and overlap any previous window.
+##px## and ##py## for X and Y position on the screen, and ##sizex## and ##sizey##
+for sizes, obviously.
+Unit: percents (screen)
+**/
+
+int raydium_gui_internal_object_create(char *name, int window, char type, GLfloat px, GLfloat py, GLfloat sizex, GLfloat sizey, GLfloat font_size);
+/**
+Internal use.
+**/
+
+int raydium_gui_button_create(char *name, int window,  GLfloat px, GLfloat py, char *caption, void *OnClick);
+/**
+This function will create a new button, with ##name## and with ##window## for
+parent. 
+You need to provide a ##caption## ("title") and a OnClick callback function.
+This callback must follow this prototype:
+%%(c)void btnButtonClick(raydium_gui_Object *w)%%
+You can find ##raydium_gui_Object## structure declaration in ##raydium/gui.h##,
+if needed.
+
+Unit for position (##px## and ##py##): percents (**window**)
+**/
+
+int raydium_gui_button_create_simple(char *name, int window,  GLfloat px, GLfloat py, char *caption);
+/**
+Same as above, but no OnClick callback function is asked. This type of button 
+is "readable" thru ##raydium_gui_button_clicked##.
+**/
+
+
+int raydium_gui_label_create(char *name, int window,  GLfloat px, GLfloat py, char *caption, GLfloat r, GLfloat g, GLfloat b);
+/**
+This function will create a new label, with ##name## and with ##window## for
+parent. 
+You need to provide a ##caption## ("title") and an RGB color (0..1 interval)
+
+Unit for position (##px## and ##py##): percents (**window**)
+**/
+
+int raydium_gui_track_create(char *name, int window,  GLfloat px, GLfloat py, int min, int max, int current);
+/**
+This function will create a new trackbar, with ##name## and with ##window## for
+parent. 
+You need to provide a ##min## interger value, a ##max## and ##current## value.
+
+Unit for position (##px## and ##py##): percents (**window**)
+**/
+
+int raydium_gui_edit_create(char *name, int window,  GLfloat px, GLfloat py, char *default_text);
+/**
+This function will create a new edit box, with ##name## and with ##window## 
+for parent. 
+You may provide a default text (or an empty string), if needed. Unless all
+others Raydium's data, max string length is ##RAYDIUM_GUI_DATASIZE## and
+not ##RAYDIUM_MAX_NAME_LEN##, since this component may handle bigger strings.
+See ##raydium/gui.h## for more informations.
+
+Unit for position (##px## and ##py##): percents (**window**)
+**/
+
+int raydium_gui_check_create(char *name, int window,  GLfloat px, GLfloat py, char *caption, char checked);
+/**
+This function will create a new check box, with ##name## and with ##window## 
+for parent. 
+You need to provide a ##caption## ("title") and a boolean state (checked or not).
+
+Unit for position (##px## and ##py##): percents (**window**)
+**/
+
+int raydium_gui_combo_create(char *name, int window,  GLfloat px, GLfloat py, char *items, int current);
+/**
+This function will create a new edit box, with ##name## and with ##window## 
+for parent. 
+##items## is a string, using '\n' as a separator. It's allowed to create an
+empty item.
+##current## is the default selected item in ##items##. (first = 0)
+Unless all others Raydium's data, max string length is ##RAYDIUM_GUI_DATASIZE## 
+and not ##RAYDIUM_MAX_NAME_LEN##, since this component may handle bigger
+strings. See ##raydium/gui.h## for more informations.
+
+Unit for position (##px## and ##py##): percents (**window**)
+**/
+
+int raydium_gui_read(int window, int widget, char *str);
+/**
+Use this function to get ##widget##'s state (for ##window##).
+This function will always return this information thru two variable:
+an integer (returned value) and a string (##str##).
+This information is specific to ##widget##'s type (checked or not for a
+checkbox, current choice for a combo, current string for an edit box, ...)
+Please, note ##str## must be allocated before function call. This is also
+the case for PHP scripts :
+%%(php)
+$str=str_pad("",256); // "pre-alloc"
+$val=raydium_gui_read_name("main","track",$str);
+echo "value=$val, string='$str'";
+%%
+**/
+
+int raydium_gui_read_name(char *window, char *widget, char *str);
+/**
+Same as above, but ##window## and ##widget## are resolved thru names, and
+not numeric id.
+**/
+
+int raydium_gui_button_clicked(void);
+/**
+This function will return the id of the last clicked button,
+or -1 if none were clicked.
+The id is built like this : ##window * 1000 + widget_id##
+Usefull for PHP scripts, since it's not possible to create callback for
+buttons with RayPHP.
+**/
+
+#endif
Index: main.h
===================================================================
--- main.h	(revision 0)
+++ main.h	(revision 1)
@@ -0,0 +1,363 @@
+#define		HEADER_MAIN
+#include	"../main.h"
+
+/*=
+Introduction to Raydium
+100
+**/
+
+// About
+/**
+Well, first of all, let me talk about [[Raydium]] goals: this project 
+aims to be simple, easy to use, portable, and quite fast.
+
+[[Raydium]] is a C written abstract layer, on top of OpenGL, 
+[[GLU]] and [[GLUT]]: this means you can write an entire 3D 
+application without calling any OpenGL function. 
+Want to draw an object ? call the suitable [[Raydium]] function, 
+and all textures and vertices will be loaded, and your object drawn.
+Want to make an explosion ? Same thing: call the right function.
+Note that you can call OpenGL functions anyway, if necessary.
+
+About portability, I can say a few things: [[Raydium]] was initially 
+planned for linux only, but with an "clean" (nearly [[ANSI]]) code,
+and, in facts, we have been able to compile Raydium under VC6 (Windows)
+and mingw with a very few modifications.
+So you can expect a correct result on any system providing 
+OpenGL (at least 1.2), [[GLU]], [[GLUT]] and a C compiler.
+
+As we ([[CQFD Corp]].) needed a library for our own games, demos,
+and... and things like that, and as I was interested by OpenGL,
+I starts to write [[Raydium]].
+
+Raydium is perfect for outdoors spaces, integrating a landscape engine,
+with suitable physic, supports dynamic lighting, fog, blending, water and
+waves, terraforming, and more.
+
+This features list will probably grow up during Raydium developpement.
+
+You'll find, in this document, a list of many functions and possibilities 
+of [[Raydium]].
+
+After this short introduction, let's talk about the [[API]] itself, 
+starting with the main file (from the programmer's point of vue) 
+of [[Raydium]]: common.c
+**/
+
+
+// Defines
+/**
+As mentioned above, the file common.c is quite interesting, 
+for several reasons: first, as this file includes all others [[Raydium]]'s
+files, you can have an overview of the whole project, just by looking at this.
+
+It can also be used as a "quick help", since all variables are declared 
+here, and not in the corresponding files. I mean, for example, 
+that "##raydium_light_intensity...##" will be declared in common.c, 
+not in light.c . There's many reasons for using such "style",
+but you must only retain that it is simpler for you :)
+
+Ok, after this little disclaimer, we can have a look to the first part
+of our file.
+
+After usual #include (nothing interesting here), we find some #defines.
+
+===generic limits===
+
+The first #define block determine limits of your application,
+and here you are the actual values for basic defines:
+%%(c)
+#define RAYDIUM_MAX_VERTICES 500000
+#define RAYDIUM_MAX_TEXTURES 256
+#define RAYDIUM_MAX_LIGHTS 8
+#define RAYDIUM_MAX_NAME_LEN 255
+#define RAYDIUM_MAX_OBJECTS 1024
+%%
+
+- As you may expect, ##MAX_VERTICES## defines the amount of memory you'll
+waste with vertex tables. These tables will contain all loaded objects, 
+then remember each time you draw something (object), 
+[[Raydium]] loads it (if not already done). Currently, there is no "delete"
+mechanism implemented (except by deleting all objects). 
+Let me give you a scale: with an Athlon XP1900+, [[GeForce]] 3, 
+actual [[Raydium]] devel. version 0.31, with around 100 000 vertices, 
+losts of options (sky, blending, 2 lights, 15 textures, ...), 
+Raydium renders ~ 45 FPS. Beyond this, a very correct object uses less
+than 10 000 vertices. So 500 000 vertices, the actual default, 
+is quite large. It's also important to talk about memory: Linux is 
+very efficient on this point, and allocates only "really used" memory. 
+Under Linux, with the above scene, Raydium used about 20 MB (data only), 
+instead of "much more" (~ 5x). I haven't made any test about this under 
+Windows, but we can expect worse results.
+ 
+- There's nothing really important to say about ##MAX_TEXTURES##,
+since that doesn't influence the amount of memory used. You are not 
+limited to 8 bits values, but 256 seems very comfortable (and you must
+pay attention to the capacities of your 3D hardware !)
+ 
+- The next define, ##MAX_LIGHTS## is very important: OpenGL, for now 
+(version 1.3 and lower), impose 8 lights at least, and all current 
+hardware doesn't manage more. If this situation is likely to evolve, 
+we will move this #define to a variable, and will ask hardware for its 
+capacities at initialization, but, for the moment, do not exceed 8.
+ 
+- Next, ##NAME_LEN##, limits the maximum length of strings (textures and 
+objects names) used by Raydium. Default value should be perfect. 
+(avoid higher values, since it could slow down name searches)
+ 
+- ##MAX_OBJECTS## use the same mechanism as ##MAX_TEXTURES##, and addition 
+with the fact that hardware is not concerned, it can be ignored. 
+     
+===Options and parameters===
+     
+This is the next part of our #define section, I will not explain these
+constants here, but in respective sections, so you'll have just you to
+remember they're declared here.
+**/     
+
+// Basic vars
+/**
+
+This section aims to describe each variable [[Raydium]] use, one by one. 
+Some (most ?) of them are used internaly only, but you could need to access 
+it. Moreover, you'll better understand how Raydium works by looking at 
+these variables.
+
+===Keyboard input===
+
+Following variables can be found:
+
+##raydium_key_last## will always contains the last key (normal or special) 
+pressed down. You'll find a explanation about normal and special keys above.
+
+##raydium_key[]## hosts all special keys state. Currently, you must use 
+[[GLUT]] define's (Raydium aliases will come soon), limited to
+following keys:
+
+- ##GLUT_KEY_F1## to ##GLUT_KEY_F12##
+- ##GLUT_KEY_LEFT##, ##GLUT_KEY_RIGHT##, ##GLUT_KEY_UP##, ##GLUT_KEY_DOWN##
+- ##GLUT_KEY_PAGE_UP##, ##GLUT_KEY_PAGE_DOWN##
+- ##GLUT_KEY_HOME##, ##GLUT_KEY_END##, ##GLUT_KEY_INSERT##
+    
+These are "special" keys: they have 2 states. released (0), 
+and pressed (non zero). It means you can do something
+(move an object, turn on a light) **UNTIL** user stops to press the key. 
+"Normal" keys have a different behavior: you can do something **IF** user 
+press a key (exit from application if ESC is pressed, for example).
+You'll have no information about key's release.
+    
+A normal key is sent through ##raydium_key_last##, a special one through 
+##raydium_key[]## AND ##raydium_key_last##.
+    
+You must see ##raydium_key_last## as an "event", fired when the user press 
+a key (ANY key: special or not). When a normal key is pressed, you'll get
+the ASCII value + 1000 assigned to ##raydium_key_last##. (1027 for "ESC", for 
+example)
+    
+Here is a method to use special keys: 
+%%(c) if(raydium_key[GLUT_KEY_UP]) move_car(); %%
+    
+Yes, it's easy. You can also use 
+%%(c) if(raydium_key_last""==""GLUT_KEY_UP) explose(); %%
+for example, if you need to carry out a specific action.
+    
+It's ok for you ? use ##raydium_key[]## to keep the car moving until 
+user release UP key, or use ##raydium_key_last## to explode the car 
+when the user tries to start it :)
+    
+===Mouse input===
+    
+Easy.
+    
+You can get actual mouse position on the window (relative to window's
+position on screen, I mean) with ##raydium_mouse_x## and ##raydium_mouse_y##
+(GLuint), starting at (0,0) for upper left 
+(Warning: some [[GLUT]] implementations can give mouse position even 
+when mouse is out of the window ! Check boundaries before using these values).
+    
+Raydium use: 1 for left button, 2 for right button, and 3 for 
+middle button (0 for none) with ##raydium_mouse_clic## for the last clic 
+value. (generated one time per clic)
+    
+You can permanently get a button's state, up (0) or down (non zero), 
+using ##raydium_mouse_button[x]##, where x is 0 for left button, 1 for right 
+one, and 2 for middle button.
+    
+===Textures===
+    
+##raydium_texture_index## and ##raydium_texture_current## (GLuint) are used
+internaly to determine repectively how many textures are loaded,
+wich is the current one.
+    
+The next variable, ##raydium_texture_filter##, is very important. You can
+assign ##RAYDIUM_TEXTURE_FILTER_NONE## (default), ##RAYDIUM_TEXTURE_FILTER_BILINEAR##
+or ##RAYDIUM_TEXTURE_FILTER_TRILINEAR## (recommended).
+    
+Using no texture filter can gives you higher framerate on old 3D hardware,
+but this is quite ugly.
+    
+You can activate bilinear filtering without any framerate impact on
+most recent video cards, and get a much more attractive rendering.
+    
+Trilinear filtering uses Bilinear filtering and MipMaps. A MipMaped
+texture is a duplicated texture (3 times, with Raydium), but at different 
+sizes. A 512x512 texture will generate, for example, a (smoothed) 
+256x256 texture, and a (smoothed) 128x128 one. Your video card will 
+use these textures according to distance from POV (point of vue),
+reducing flickering effect.
+    
+This is the best filtering Raydium can use, for a great rendering quality.
+Good and recent 3D hardware can do trilinear filtering in a single pass, 
+so it must be the default setting for your application.
+    
+About ##raydium_texture_filter## itself: changing this variable will not modify
+the rendering, but the way to load textures. It means you can (for example)
+use trilinear only for landscape textures, and bilinear for others.
+It also means you must reload (erase) a texture to change it's filter.
+    
+Note that Raydium will never use trilinear filter with blended (transparent)
+textures, for good reasons :)
+    
+Let's talk quickly about next (internal) texture variables:
+##raydium_texture_blended[]## is a flag table, where each element is
+non zero for a blended (RGBA) texture, and 0 for an RGB one.
+    
+For Raydium, when a texture does not contain a "bitmap" (texture file, 
+for example), it contains a plain color, and this color is stored in 
+##raydium_texture_rgb[][4]## (4 is for RGBA, values between 0 and 1).
+You can load an rgb texture with "rgb" keyword. For example, instead of 
+loading "red.tga", you can load "rgb(0.8,0.1,0.1)".
+    
+##raydium_texture_name[]## table simply contains texture filenames.
+    
+Last thing, ##raydium_texture_to_replace##,
+can be used to erase an already loaded texture. 
+Set the variable to n, and load a new texture: texture number "n" will be
+replaced in memory.
+    
+===Projection===
+    
+Raydium supports 2 types of projection: ##RAYDIUM_PROJECTION_ORTHO##
+(orthographic) and ##RAYDIUM_PROJECTION_PERSPECTIVE##.
+
+First of all, let us point out what "projection" is. Using a "perspective" 
+projection, closest objects will looks larger than the orthers. It is 
+typically used in video games (since human eye runs like that), 
+by opposition to orthographic projection, wich is mostly used by 3D 
+modeling tools. The principle is simple, discover it by yourself :)
+    
+Raydium reads ##raydium_projection## to determine wich method to use. 
+Each projection is configured with ##raydium_projection_*## variables. 
+Some of these variables are used both by "perspective" and "orthographic" 
+projections.
+    
+Here is what common.c says:
+    
+%%(c)
+GLFLOAT RAYDIUM_PROJECTION_FOV; // PERSPECTIVE ONLY
+GLFLOAT RAYDIUM_PROJECTION_NEAR; // PERSPECTIVE & ORTHO
+GLFLOAT RAYDIUM_PROJECTION_FAR; // PERSPECTIVE & ORTHO
+GLFLOAT RAYDIUM_PROJECTION_LEFT; // ORTHO ONLY
+GLFLOAT RAYDIUM_PROJECTION_RIGHT; // ORTHO ONLY
+GLFLOAT RAYDIUM_PROJECTION_BOTTOM; // ORTHO ONLY
+GLFLOAT RAYDIUM_PROJECTION_TOP; // ORTHO ONLY
+%%
+    
+You've probably noticed that orthographic projection defines a "box" 
+with your screen: near, far, left, right, bottom. Everything out ouf 
+this box will never be displayed.
+    
+Perspective projection is based on FOV: Field Of Vision, given in degrees. 
+"near" and "far" are used for many things: Z-Buffer precision is affected, 
+and clipping too: as with "orthographic", nothing will be displayed beyond 
+"far", and fog, if enabled, will hide this "limit". This is right for "near",
+too, but without fog, obviously :)
+    
+Also remember that decreasing FOV will zoom in.
+    
+You must call ##raydium_window_view_update()## after any modification on one
+(or more) of these variables (see "Window Managment" section for more
+information)
+    
+===Frame size and color===
+    
+##raydium_window_tx## and ##raydium_window_ty## are read-only variables,
+providing you actual frame size.
+    
+##raydium_background_color[4]## is a RGBA table, and will be used for
+frame clearing, and fog color. You can change this variable, and call 
+respective update functions (frame and fog), or simply use 
+##raydium_background_color_change(GLfloat r, GLfloat g, GLfloat b, GLfloat a)##.
+    
+More informations in corresponding sections.
+    
+===Vertices===
+    
+Vertices data structure is distributed in 4 parts:
+    
+- ##raydium_vertex_*## : these tables will simply contains vertices coordinates
+
+- ##raydium_vertex_normal_*## : vertices normals. Raydium will maintain 
+two distinct normal tables, and this one will be used for calculations.
+
+- ##raydium_vertex_normal_visu_*## : the other normal table, used for 
+lighting. Smoothing "visu" normals will provides a better rendering, and Raydium includes 
+all necessary functions to automate this task.
+
+- ##raydium_vertex_texture_u##, ##*raydium_vertex_texture_v##, 
+##*raydium_vertex_texture## contains, for each vertex stored 
+in the vertices data structure, u and v mapping information, 
+and associated texture number. U and V are texture mapping coordinates. 
+	
+Raydium can automatically generates some of these data 
+(normals and uv coords, that is), Read "Vertices" section above 
+for more information.
+	
+PLEASE, do not write directly in these tables, use dedicated functions.
+	
+===Objects===
+	
+Objects are loaded in Vertices stream, identified by a "start" and an "end" 
+(##raydium_object_start[]## and ##raydium_object_end[]##) in this stream.
+An index is incremented each time you load an object 
+(##GLuint raydium_object_index##). Filename is also stored in 
+##raydium_object_name[][]##. Go to "Objects" section to know more.
+	
+===Lights===
+	
+First of all, ##raydium_light_enabled_tag## contains 0 when light is
+disabled, non-zero otherwise. This is a read-only variable, so use 
+suitable functions.
+	
+Currently, for Raydium, a light can have 3 states: on, off, or blinking.
+##raydium_light_internal_state[]## stores this.
+	
+Next comes all light's features: position, color, intensity. You can 
+modify directly these variables, and call update fonctions, 
+if needed (not recommended).
+	
+Next, ##raydium_light_blink_*## are used internaly for blinking lights, 
+setting lowest, higher light intensity, and blinking speed. 
+Do noy modify these variables, use suitable functions.
+	
+You should read the chapter dedicated to lights for more information.
+	
+===Fog===
+	
+Only one variable, here: ##raydium_fog_enabled_tag##, switching from zero 
+to non zero if fog is enabled. Do NOT use this variable to enable or 
+disable fog, but suitable functions, this variable is just a tag.
+	
+===Camera===
+	
+Since many calls to camera functions are done during one frame,
+Raydium must track if any call to these functions was already done, 
+using ##raydium_frame_first_camera_pass## boolean.
+	
+##raydium_camera_pushed##, also used as a boolean, stores stack state. 
+When you place your camera in the scene with Raydium, it pushes matrix 
+on top of the stack, so you can modify it (the matrix), placing an object
+for example, an restore it quickly after, by popping matrix off.
+
+**/
Index: particle2.h
===================================================================
--- particle2.h	(revision 0)
+++ particle2.h	(revision 1)
@@ -0,0 +1,183 @@
+#ifndef _PARTICLE__H
+#define _PARTICLE__H
+#include "../particle2.h"
+
+/*=
+Particle engine
+1400
+**/
+
+// Introduction
+/**
+This is the second version of Raydium's particle engine. This engine is build
+on top of a dedicated file format (.prt and .sprt files), describing most 
+(up to all, in facts) properties of generators.
+It probably better to start by an example (fountain.prt) :
+%%(c)
+// Simple blue fountain (change 'vector' if needed)
+ttl_generator=5;
+ttl_particles=1.5;
+ttl_particles_random=0;
+
+particles_per_second=200;
+
+texture="flare_nb.tga";
+
+size=0.1;
+size_inc_per_sec=0.1;
+
+gravity={0,0,-5};
+vector={0,0,4};
+vector_random={0.2,0.2,0.2};
+
+// RGBA
+color_start={0.6,0.6,1,0.5};
+color_start_random={0,0,0.2,0};
+color_end={1,1,1,0.1};
+
+// end of file.
+%%
+
+.prt files are readed using parsing functions (see appropriate chapter, if
+needed), and the list of all available properties can be found in particle2.c
+source file. A full toturial is also available on Raydium's Wiki.
+
+Once the particle file is written, you only need to load the file using the
+suitable function (see below). Some anchor are available to link generators to
+physic entities, if needed, as callbacks for a few events (one, for now).
+
+.sprt files are used to create a "snapshot" of particles, used for example by
+3D captures, and are not meant to be edited by hand.
+**/
+
+extern void raydium_particle_name_auto (char *prefix, char *dest);
+/**
+Will generate a unique string using ##prefix##. The string is created using
+space provided by ##dest##.
+You can use this function when building a new generator.
+**/
+
+extern void raydium_particle_init (void);
+/**
+Internal use.
+**/
+
+extern char raydium_particle_generator_isvalid (int g);
+/**
+Internal use, but you can call this function if you want to verify if a
+generator's id is valid (in bounds, and loaded).
+**/
+
+extern int raydium_particle_generator_find (char *name);
+/**
+Lookups a generator using is name. Returns -1 if ##name## is not found.
+**/
+
+extern int raydium_particle_find_free (void);
+/**
+Finds a free **particle** slot.
+**/
+
+extern void raydium_particle_generator_delete (int gen);
+/**
+Deletes a generator.
+**/
+
+extern void raydium_particle_generator_delete_name (char *gen);
+/**
+Same as above, but using generator's name.
+**/
+
+extern void raydium_particle_generator_enable (int gen, char enabled);
+/**
+Activate a disabled generator (see below).
+**/
+
+extern void raydium_particle_generator_enable_name (char *gen, char enable);
+/**
+Disable a generator (TTL is still decremented).
+**/
+
+extern void raydium_particle_preload (char *filename);
+/**
+Loads .prt file and associated textures into suitable caches.
+Call this function if you want to avoid (small) jerks caused by "live"
+loading a generator.
+**/
+
+extern void raydium_particle_generator_load_internal (int generator, FILE * fp, char *filename);
+/**
+Internal use.
+**/
+
+extern int raydium_particle_generator_load (char *filename, char *name);
+/**
+Loads generator from ##filename## as ##name##. This ##name## will be used for
+future references to this generator, as the returned interger id.
+**/
+
+extern void raydium_particle_generator_update (int g, GLfloat step);
+/**
+Internal use.
+**/
+
+extern void raydium_particle_update (int part, GLfloat step);
+/**
+Internal use.
+**/
+
+extern void raydium_particle_callback (void);
+/**
+Internal use.
+**/
+
+extern int raydium_particle_state_dump(char *filename);
+/**
+Dumped current particles to ##filename## (.sprt [static particles]).
+**/
+
+extern int raydium_particle_state_restore(char *filename);
+/**
+Append .sprt ##filename## to current scene.
+**/
+
+extern void raydium_particle_draw (raydium_particle_Particle * p, GLfloat ux, GLfloat uy, GLfloat uz, GLfloat rx, GLfloat ry, GLfloat rz);
+/**
+Internal use.
+**/
+
+extern void raydium_particle_draw_all (void);
+/**
+Internal use.
+**/
+
+extern void raydium_particle_generator_move (int gen, GLfloat * pos);
+/**
+Moves ##gen## generator to ##pos## position (3 * GLfloat array).
+**/
+
+extern void raydium_particle_generator_move_name (char *gen, GLfloat * pos);
+/**
+Same as above, but using generator's name.
+**/
+
+extern void raydium_particle_generator_move_name_3f (char *gen, GLfloat x, GLfloat y, GLfloat z);
+/**
+Same as above, using 3 different GLfloat values.
+**/
+
+extern void raydium_particle_generator_particles_OnDelete (int gen, void *OnDelete);
+/**
+Sets a callback for ##gen##, fired when any particle of this generator is
+deleted, providing a easy way to create "cascading" generators.
+The callback must respect the following prototype:
+%%(c) void cb(raydium_particle_Particle *) %%
+Do not free the provided particle.
+**/
+
+extern void raydium_particle_generator_particles_OnDelete_name (char *gen, void *OnDelete);
+/**
+Same as above, but using generator's name.
+**/
+
+#endif
Index: osd.h
===================================================================
--- osd.h	(revision 0)
+++ osd.h	(revision 1)
@@ -0,0 +1,205 @@
+#ifndef _OSD_H
+#define _OSD_H
+/*=
+OSD (On Screen Display)
+2900
+**/
+
+// Introduction
+/**
+Raydium provides some high level function for "On Screen Display", 
+as string drawing (2D and 3D), application's logo, mouse cursor, and other
+various 2D displaying tools.
+
+In most cases, these functions must be called after any other object
+drawing function, to avoid overlapping problems.
+
+Most functions will use a percentage system, and origin is at lower-left corner.
+**/
+
+
+extern void raydium_osd_color_change (GLfloat r, GLfloat g, GLfloat b);
+/**
+This function will change the font color for the next ##raydium_osd_printf*## 
+calls.
+As usual: 0 <= (##r##,##g## and ##b##) <= 1.
+**/
+
+extern void raydium_osd_alpha_change (GLfloat a);
+/**
+Same as above, but will change font transparency.
+**/
+
+extern void raydium_osd_color_rgba (GLfloat r, GLfloat g, GLfloat b, GLfloat a);
+/**
+This is a mix of ##raydium_osd_color_change## and ##raydium_osd_alpha_change##.
+**/
+
+extern void raydium_osd_color_ega (char hexa);
+/**
+This function will change font color with the corresponding 
+##hexa##decimal code (as a char: '0' to 'F') in the standard EGA palette.
+
+Here is this palette:
+""
+<div class="table" align="center">
+<table class="tableListing" summary=" " cellspacing="0" cellpadding="3" border="1">
+<tr class="wiki"><td class="wiki"> <b>Hexa</b> </td><td class="wiki"> <b>Color</b> </td></tr>
+<tr class="wiki"><td class="wiki"> 0 </td><td class="wiki"> Black </td></tr>
+<tr class="wiki"><td class="wiki"> 1 </td><td class="wiki"> Blue </td></tr>
+<tr class="wiki"><td class="wiki"> 2 </td><td class="wiki"> Green </td></tr>
+<tr class="wiki"><td class="wiki"> 3 </td><td class="wiki"> Cyan </td></tr>
+<tr class="wiki"><td class="wiki"> 4 </td><td class="wiki"> Red </td></tr>
+<tr class="wiki"><td class="wiki"> 5 </td><td class="wiki"> Purple </td></tr>
+<tr class="wiki"><td class="wiki"> 6 </td><td class="wiki"> Brown </td></tr>
+<tr class="wiki"><td class="wiki"> 7 </td><td class="wiki"> White </td></tr>
+<tr class="wiki"><td class="wiki"> 8 </td><td class="wiki"> Grey </td></tr>
+<tr class="wiki"><td class="wiki"> 9 </td><td class="wiki"> Light Blue </td></tr>
+<tr class="wiki"><td class="wiki"> A </td><td class="wiki"> Light Green </td></tr>
+<tr class="wiki"><td class="wiki"> B </td><td class="wiki"> Light Cyan </td></tr>
+<tr class="wiki"><td class="wiki"> C </td><td class="wiki"> Light Red </td></tr>
+<tr class="wiki"><td class="wiki"> D </td><td class="wiki"> Light Purple </td></tr>
+<tr class="wiki"><td class="wiki"> E </td><td class="wiki"> Light Yellow </td></tr>
+<tr class="wiki"><td class="wiki"> F </td><td class="wiki"> Light White </td></tr>
+</table>
+</div>
+""
+**/
+
+extern void raydium_osd_start (void);
+/**
+Mostly for internal uses. (will configure screen for OSD operations)
+**/
+
+extern void raydium_osd_stop (void);
+/**
+Mostly for internal uses. (see above)
+**/
+
+extern void raydium_osd_draw (int tex, GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
+/**
+Will draw ##tex## texture using (##x1##,##y1##) and (##x2##,##y2##) points.
+**/
+
+extern void raydium_osd_draw_name (char *tex, GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
+/**
+Same as above, but using texture filename.
+**/
+
+extern void raydium_osd_printf (GLfloat x, GLfloat y, GLfloat size, GLfloat spacer, char *texture, unsigned char *format, ...);
+/**
+This function is an OpenGL equivalent to the standard "printf" C function.
+
+- (##x##,##y##) is the position of the text's beginning, as a screen 
+percentage, with origin at lower left.
+
+- ##size## is the font size, using an arbitrary unit. This size is always 
+proportionnal to frame size (font size will grow up with screen size,
+in other words).
+
+- ##spacer## is the factor of spacing between 2 consecutive letters. With 
+standard fonts, 0.5 is a correct value (relatively condensed text).
+
+- ##texture## is obviously the texture filename to use (font*.tga are 
+often provided with Raydium distribution, and by R3S).
+
+- ##format## is the standard printf format string, followed by 
+corresponding arguments: ##"^9Player ^Fname is: %10s", player_name##
+This format can use '^' char to change color text, followed by a color, 
+indicated by a hexadecimal letter (EGA palette). See ##raydium_osd_color_ega##
+function, above.
+
+Here you are a simple example:
+
+%%(c)
+strcpy(version,"^Ctest 0.1^F");
+raydium_osd_printf(2,98,16,0.5,"font2.tga","- %3i FPS - tech demo %s for Raydium %s, CQFD Corp.",
+                   raydium_render_fps,version,raydium_version);
+%%
+**/
+
+extern void raydium_osd_printf_3D (GLfloat x, GLfloat y, GLfloat z, GLfloat size, GLfloat spacer, char *texture, unsigned char *format, ...);
+/**
+Same as above, but you can place your text in your application 3D space, 
+using ##x##, ##y## and ##z## values.
+**/
+
+extern void raydium_osd_logo (char *texture);
+/**
+Will draw a logo for the current frame with texture filename.
+For now, you've no control over rotation speed of the logo.
+**/
+
+extern void raydium_osd_cursor_set (char *texture, GLfloat xsize, GLfloat ysize);
+/**
+This function will set mouse cursor with texture filename and 
+with (##xsize##,##ysize##) size (percent of screen size).
+You should use a RGB**A** texture for better results.
+example:
+%%(c)
+raydium_osd_cursor_set("BOXcursor.tga",4,4);
+%%
+**/
+
+extern void raydium_osd_cursor_draw (void);
+/**
+Internal use.
+**/
+
+extern void raydium_osd_internal_vertex (GLfloat x, GLfloat y, GLfloat top);
+/**
+Internal use.
+**/
+
+extern void raydium_osd_network_stat_draw (GLfloat px, GLfloat py, GLfloat size);
+/**
+Will draw network stats (if available) in a box.
+%%(c) raydium_osd_network_stat_draw(5,30,20); %%
+**/
+
+extern void raydium_osd_mask (GLfloat * color4);
+/**
+Will draw a uniform mask using ##color4## (RGBA color) for this frame.
+**/
+
+extern void raydium_osd_fade_callback (void);
+/**
+Internal use.
+**/
+
+extern void raydium_osd_fade_init (void);
+/**
+Internal use.
+**/
+
+extern void raydium_osd_fade_from (GLfloat * from4, GLfloat * to4, GLfloat time_len, void *OnFadeEnd);
+/**
+This function will configure a fading mask from ##from4## color to ##to4##.
+This fade will last ##time_len## seconds, and will call ##OnFadeEnd## callback
+when finished.
+This callback signature must be ##void callback(void)##.
+
+A standard fade-to-black-and-restore example:
+%%(c)
+// back to normal rendering
+void restorefade(void)
+{
+   GLfloat from[4]={0,0,0,2};
+   GLfloat to[4]={0,0,0,0};
+   raydium_osd_fade_from(from,to,1,NULL);
+   // do things (like moving camera to another place, for example).
+}
+				
+...
+
+// If space key : fade to black
+if(raydium_key_last==1032)
+    {
+    GLfloat from[4]={0,0,0,0};
+    GLfloat to[4]={0,0,0,1};
+    raydium_osd_fade_from(from,to,0.3,restorefade);
+    }
+%%				 
+**/
+
+#endif
Index: clear.h
===================================================================
--- clear.h	(revision 0)
+++ clear.h	(revision 1)
@@ -0,0 +1,17 @@
+#ifndef _CLEAR_H
+#define _CLEAR_H
+/*=
+Frame clearing
+801
+**/
+
+extern void raydium_clear_frame (void);
+/**
+You need to call this function every frame to clear all hardware buffers.
+**/
+
+extern void raydium_clear_color_update (void);
+/**
+Will apply background color modification. Probably useless for you.
+**/
+#endif
Index: mouse.h
===================================================================
--- mouse.h	(revision 0)
+++ mouse.h	(revision 1)
@@ -0,0 +1,58 @@
+#ifndef _MOUSE_H
+#define _MOUSE_H
+/*=
+Mouse
+1100
+**/
+
+// Introduction
+/**
+Mouse API is almost explainded at the top of this guide, but here it 
+is some other usefull functions (macros, in facts)
+**/
+
+
+#define raydium_mouse_hide() glutSetCursor(GLUT_CURSOR_NONE);
+/**
+Hides mouse cursor.
+**/
+
+#define raydium_mouse_show() glutSetCursor(GLUT_CURSOR_LEFT_ARROW);
+/**
+Shows mouse cursor.
+**/
+
+#define raydium_mouse_move(x,y) glutWarpPointer((x),(y))
+/**
+Moves cursor to (##x##,##y##) position (in pixel).
+Example if you want to move cursor at window's center: 
+%%(c)raydium_mouse_move(raydium_window_tx/2, raydium_window_ty/2);%%
+**/
+
+char raydium_mouse_isvisible(void);
+/**
+Returns true or false (0 or 1), if the mouse is visible or not.
+See ##raydium_mouse_show()## and ##raydium_mouse_hide()## above.
+**/
+
+extern void raydium_mouse_init (void);
+/**
+Internal use.
+**/
+
+extern void raydium_mouse_click_callback (int but, int state, int x, int y);
+/**
+Internal callback.
+**/
+
+extern void raydium_mouse_move_callback (int x, int y);
+/**
+Internal callback.
+**/
+
+extern int raydium_mouse_button_pressed (int button);
+/**
+returns ##button## state. (See first part of this document)
+**/
+
+#endif
Index: key.h
===================================================================
--- key.h	(revision 0)
+++ key.h	(revision 1)
@@ -0,0 +1,36 @@
+#ifndef _KEY_H
+#define _KEY_H
+/*=
+Keyboard & keys
+1000
+**/
+
+// Introduction
+/*=
+Keyboard API is already described at the top of this guide,
+see section "keyboard input".
+**/
+
+extern void raydium_key_normal_callback (GLuint key, int x, int y);
+/**
+Internal callback.
+**/
+
+extern void raydium_key_special_callback (GLuint key, int x, int y);
+/**
+Internal callback.
+**/
+
+extern void raydium_key_special_up_callback (GLuint key, int x, int y);
+/**
+Internal callback.
+**/
+
+extern int raydium_key_pressed (GLuint key);
+/**
+Will return state of ##key## in the ##raydium_keys[]## array.
+This function is usefull to test keyboard from PHP, since RayPHP doest not
+support array for now.
+**/
+
+#endif
Index: normal.h
===================================================================
--- normal.h	(revision 0)
+++ normal.h	(revision 1)
@@ -0,0 +1,40 @@
+#ifndef _NORMAL_H
+#define _NORMAL_H
+
+/*=
+Normals
+1600
+**/
+
+// Introduction
+/**
+This file provides some usefull functions for normal generation and smoothing.
+You can find some more informations about normals at the top of this guide. 
+**/
+
+
+extern void raydium_normal_generate_lastest_triangle (int default_visu);
+/**
+Generate normal for the last created triangle (see ##raydium_vertex_index##)
+if ##default_visu## is true ( != 0 ), this function will restore "visu" 
+normals too.
+**/
+
+extern void raydium_normal_restore_all (void);
+/**
+This function restore visu normals with standard ones (##raydium_vertex_normal_*##)
+**/
+
+extern void raydium_normal_regenerate_all (void);
+/**
+This function will regenerate standard and visu normals for the whole 
+scene (ground, objects, ...).
+**/
+
+extern void raydium_normal_smooth_all (void);
+/**
+This function will smooth the whole scene, using adjacent vertices.
+Note this function can take a lot of time.
+**/
+
+#endif
Index: camera.h
===================================================================
--- camera.h	(revision 0)
+++ camera.h	(revision 1)
@@ -0,0 +1,173 @@
+#ifndef _CAMERA_H
+#define _CAMERA_H
+
+/*=
+Camera
+2200
+**/
+
+// Introduction
+/**
+Raydium provides camera management functions, allowing the coder to
+move camera with very simple functions, even for complex moves.
+You have to place your camera once per frame (not more, not less).
+
+"look_at" style functions can be affected by ##raydium_camera_look_at_roll##
+global variable, if needed.
+
+A few words about camera path: Take a look to a .cam file if you want to
+understand this simple file format, but you probably only need the ##cam.c##
+application, dedicated to camera path creation.
+
+Some camera functions are provided by physics module, see suitable chapter.
+**/
+
+
+extern void raydium_camera_vectors (GLfloat * res3);
+/**
+This function will return two vectors (2 * 3 * GLfloat), giving the camera 
+orientation (front vector and up vector). At this day, the up vector is 
+always the same as the world up vector, even if the camera is rotated 
+or upside down (and yes, this MUST be corrected :).
+
+Designed for internal uses, before all.
+**/
+
+extern void raydium_camera_internal_prepare(void);
+/**
+Internal use. (pre)
+**/
+
+extern void raydium_camera_internal (GLfloat x, GLfloat y, GLfloat z);
+/**
+Internal use. (post)
+**/
+
+extern void raydium_camera_place (GLfloat x, GLfloat y, GLfloat z, GLfloat lacet, GLfloat tangage, GLfloat roulis);
+/**
+Sets the camera at (x,y,z) position, and using (lacet,tangage,roulis) 
+as rotation angles.
+**/
+
+extern void raydium_camera_look_at (GLfloat x, GLfloat y, GLfloat z, GLfloat x_to, GLfloat y_to, GLfloat z_to);
+/**
+Sets the camera at (x,y,z) position, and looks at (x_to,y_to,z_to).
+**/
+
+extern void raydium_camera_replace (void);
+/**
+You'll need to reset camera position and orientation after each object drawing.
+If this is unclear to you, read the "example" section, below.
+
+You will need to make your own 3D transformations (GLRotate, GLTranslate, 
+...) to draw your objects, or you can use the following function.
+**/
+
+extern void raydium_camera_replace_go (GLfloat * pos, GLfloat * R);
+/**
+This function will replace the camera, as ##raydium_camera_replace()##,
+but will place "3D drawing cursor" at position ##pos## (3 GLfloat) with 
+rotation ##R## (4 GLfloat quaternion).
+
+No eulers (rotx, roty, rotz) version of this function is provided for now.. 
+Do you really need it ?
+**/
+
+// Example of camera use
+/**
+1. place camera
+2. move "drawing cursor" to object's place
+3. draw object
+4. reset camera to initial place (the one given at step 1)
+5. move "drawing cursor" to another object's place
+6. draw another object
+7. [...]
+
+Steps 4 and 5 can be done with raydium_camera_replace_go().
+**/
+
+void raydium_camera_rumble(GLfloat amplitude, GLfloat ampl_evo, GLfloat secs);
+/**
+Camera (any type) will rumble for ##secs## seconds, with ##amplitude## (radians).
+This ##amplitude## will be incremented of ##ampl_evo## every second (negative
+values are allowed).
+An ##amplitude## is always positive.
+**/
+
+extern void raydium_camera_smooth (GLfloat px, GLfloat py, GLfloat pz, GLfloat lx, GLfloat ly, GLfloat lz, GLfloat zoom, GLfloat roll, GLfloat step);
+/**
+Smooth style clone of ##raydium_camera_look_at##.
+Roll is given by ##roll## and not global variable ##raydium_camera_look_at_roll##
+as for regular look_at function.
+##zoom## is the requested FOV.
+Play with step to modify smoothing level of the movement. A good way to use
+this function is the following usage :
+%%(c) raydium_camera_smooth(cam[0],cam[1],cam[2],pos[1],-pos[2],pos[0],70,0,raydium_frame_time*3); %%
+**/
+
+extern void raydium_camera_path_init (int p);
+/**
+Internal use.
+**/
+
+extern void raydium_camera_path_init_all (void);
+/**
+Internal use.
+**/
+
+extern int raydium_camera_path_find (char *name);
+/**
+Lookups path's id using filename ##name##.
+This function will not try to load a camera path if it's not found, and
+will return -1.
+**/
+
+extern int raydium_camera_path_load (char *filename);
+/**
+Obvious : use this function to load a camera path.
+**/
+
+extern void raydium_camera_path_draw (int p);
+/**
+Draws ##p## camera path, as red lines. This must be done at each frame. 
+**/
+
+extern void raydium_camera_path_draw_name (char *path);
+/**
+Same as above, but using camera path's name.
+**/
+
+extern char raydium_camera_smooth_path (char *path, GLfloat step, GLfloat * x, GLfloat * y, GLfloat * z, GLfloat * zoom, GLfloat * roll);
+/**
+Returns the (##x,y,z##) point of the camera path for step ##step##, using
+provided ##zoom## (FOV) and ##roll## angle.
+It's important to note that ##step## is a float.
+Mostly for internal use.
+**/
+
+extern void raydium_camera_path_reset(void);
+/**
+Next smooth call will be instantaneous.
+**/
+
+extern void raydium_camera_smooth_path_to_pos (char *path, GLfloat lx, GLfloat ly, GLfloat lz, GLfloat path_step, GLfloat smooth_step);
+/**
+"Camera on path looking to a point"
+simple ##raydium_camera_smooth## version:
+Give a path name, a "look_at" point (##lx,ly,lz##), a current ##step##, and
+a ##smooth_step## time factor (see ##raydium_camera_smooth## example above).
+**/
+
+extern void raydium_camera_smooth_pos_to_path (GLfloat lx, GLfloat ly, GLfloat lz, char *path, GLfloat path_step, GLfloat smooth_step);
+/**
+"Camera on point looking at a path"
+Same style as previous function.
+**/
+
+extern void raydium_camera_smooth_path_to_path (char *path_from, GLfloat path_step_from, char *path_to, GLfloat path_step_to, GLfloat smooth_step);
+/**
+"Camera on a path looking at another path"
+Same style as previous functions.
+**/
+
+#endif
Index: misc.h
===================================================================
--- misc.h	(revision 0)
+++ misc.h	(revision 1)
@@ -0,0 +1,63 @@
+// This file is a footer for Raydium documention
+// No compilation is required.
+
+/*=
+Miscalleneous
+9000
+**/
+
+// License
+/**
+Raydium engine and provided applications are released under GPL version 2. 
+You can found the original text of this license here : 
+http://www.gnu.org/licenses/gpl.txt
+**/
+
+// About CQFD Corp Raydium Team
+/**
+Alphabetical order:
+batcox, Blue Prawn, Cocorobix, FlexH, Jimbo, manproc, Mildred, neub, RyLe,
+whisky, willou, Xfennec, Yoltie
+**/
+
+// Todo
+/**
+No particular order:
+- rendering core rewrite
+- self-running demo
+- (idea from RyLe) 'rayphp/' scripts integration into the binary (and why 
+not, a "PACK style" support).
+- more network stack optimisations ?
+- more and more and even more ODE features
+- doc for new features (physics, network, scripting, ...)
+- (idea from FlexH) ./configure.sh type script for dependencies check 
+and auto-configuration
+- better organisation of comp.sh and ocomp.sh files (separate options 
+and build process)
+
+Please, if you start working on a feature, remove it from the list (and 
+restore it if you failed)
+**/
+
+// Links
+/**
+http://raydium.cqfd-corp.org (Raydium home)
+http://wvs.cqfd-corp.org (Web Version System: public mini CVS like for Raydium)
+http://memak.cqfd-corp.org (MeMak forum: "a game using Raydium", french)
+http://www.cqfd-corp.org (CQFD homesite)
+mailto:cqfd@cqfd-corp.org
+mailto:xfennec@cqfd-corp.org
+**/
+
+// Greets
+/**
+**RyLe**: original implementation of sound.c (OpenAL core sound API)
+
+**BatcoX**: export of RayODE functions into RayPHP (reg_api.c) 
+and additional PHP wrappers (wrappers.c)
+
+**Mildred**: header and Makefile generator, dynamic version of 
+Raydium (.so and .a) for Linux.
+**/
+
+// The end !
Index: callback.h
===================================================================
--- callback.h	(revision 0)
+++ callback.h	(revision 1)
@@ -0,0 +1,34 @@
+#ifndef _CALLBACK_H
+#define _CALLBACK_H
+
+/*=
+Callbacks
+1500
+**/
+
+// Introduction
+/**
+This file contains many initializations, a few internal callbacks, but 
+will provides a very important function for end-user, wich will 
+gives user display function to Raydium: see below
+**/
+
+
+extern void raydium_callback_image (void);
+/**
+Internal use.
+**/
+
+extern void raydium_callback_set (void);
+/**
+Internal use.
+**/
+
+extern void raydium_callback (void (*loop));
+/**
+This function will loop over the provided display function, indefinitely.
+"loop" must be: 
+%%(c) void loop(void) %%
+**/
+
+#endif
Index: parser.h
===================================================================
--- parser.h	(revision 0)
+++ parser.h	(revision 1)
@@ -0,0 +1,94 @@
+#ifndef _PARSER_H
+#define _PARSER_H
+
+/*=
+Text file parsing
+3700
+**/
+
+// Introduction
+/**
+Raydium provides a set of functions dedicated to text files parsing. These
+files must follow a simple syntax:
+%%(c)
+// strings
+variable_s="string value";
+
+// float (or integer, i.e.)
+variable_f=10.5;
+
+// float array
+variable_a={1,2,10.5,};
+
+// raw data
+variable_r=[
+xxxxxxxx
+#  oo  #
+#      #
+#  oo  #
+xxxxxxxx
+];
+%%
+Semi-colon are purely esthetic.
+**/
+
+extern void raydium_parser_trim (char *org);
+/**
+Strip whitespace (or other characters) from the beginning and end of a string.
+So far, ' ', '\n' and ';' are deleted.
+**/
+
+extern char raydium_parser_isdata (char *str);
+/**
+Returns true (1) if ##str## contains data, false (0) otherwise (comments and
+blank lines).
+**/
+
+extern char raydium_parser_cut (char *str, char *part1, char *part2, char separator);
+/**
+This function will cut ##str## in two parts (##part1## and ##part2##) on
+##separator##. No memory allocation will be done by this functions.
+First occurence of ##separator## is used (left cut).
+Return true (1) if ##str## was cut.
+**/
+
+extern void raydium_parser_replace (char *str, char what, char with);
+/**
+Will replace all occurence of ##what## with ##with##.
+**/
+
+extern int raydium_parser_read (char *var, char *val_s, GLfloat *val_f, int *size, FILE *fp);
+/**
+Reads a new data line in ##fp##.
+##var## will contain variable name. You'll find associated value in ##val_s##
+if it's a string, or ##val_f## if it's a float (or a float array). In this last
+case, ##size## will return the number of elements if the array.
+%%(c)
+FILE *fp;
+int ret;
+char var[RAYDIUM_MAX_NAME_LEN];
+char val_s[RAYDIUM_MAX_NAME_LEN];
+GLfloat val_f[MY_ARRAY_SIZE];
+int size;
+
+fp=raydium_file_fopen("foobar.txt","rt");
+
+while( (ret=raydium_parser_read(var,val_s,val_f,&size,fp))!=RAYDIUM_PARSER_TYPE_EOF)
+    {
+    if(!strcasecmp(var,"foobar_variable"))
+        {
+        if(ret!=RAYDIUM_PARSER_TYPE_FLOAT || size!=2)
+            {
+	    raydium_log("error: foobar_variable is not float array");
+            continue;
+            }
+        memcpy(...);
+        }
+
+    ...
+
+    }
+%%
+**/
+
+#endif
Index: profile.h
===================================================================
--- profile.h	(revision 0)
+++ profile.h	(revision 1)
@@ -0,0 +1,29 @@
+#ifndef _PROFILE_H
+#define _PROFILE_H
+#ifdef DEBUG_PROFILE
+
+/*=
+Profiling (sort of ...)
+3500
+**/
+
+// Introduction
+/**
+You will find here a few functions for a **very simple** profiling.
+For anything else than a quick time measure, use real profiling tools.
+Note: Use only one "profiler" at a time.
+**/
+
+extern unsigned long raydium_profile_timer;
+extern void raydium_profile_start(void);
+/**
+Starts measure.
+**/
+
+extern void raydium_profile_end(char *tag);
+/**
+Stops measure and displays result using ##tag## string.
+**/
+
+#endif
+#endif
Index: texture.h
===================================================================
--- texture.h	(revision 0)
+++ texture.h	(revision 1)
@@ -0,0 +1,83 @@
+#ifndef _TEXTURE_H
+#define _TEXTURE_H
+/*=
+Textures
+1200
+**/
+
+// Introduction
+/**
+For now, Raydium only handles TGA uncompressed texture.
+As explainded in the first part of this guide, Raydium provides three 
+texture filters (none, bilinear, trilinear using MipMaps ).
+
+Texture sizes must be a power of two, 8 (alpha mask), 24 (RGB) or 32 (RGBA) bits.
+
+Raydium now supports materials with a simple "rgb(r,g,b)" string 
+as texture name, where r, g and b are 0 <= x <= 1 (floats).
+Texture clamping and multitexturing are supported by Raydium, but not
+documented here for now. If you're interested, have a look to source code, or
+take a look to the Wiki.
+
+Tips: "BOX_", ";", "|".
+**/
+
+
+extern char raydium_texture_size_is_correct (GLuint size);
+/**
+Returns true if ##size## is a correct texture size, depending of
+hardware capacities and "power of 2" constraint.
+**/
+
+extern GLuint raydium_texture_load_internal (char *filename, char *as);
+/**
+Internal use.
+**/
+
+extern GLuint raydium_texture_load (char *filename);
+/**
+Loads "filename" texture into hardware memory. Function results 
+texture index, but in most cases, you can identify later a texture 
+by his name, without providing his index, so you can probably ignore 
+this value.
+
+0 is returned if texture loading have failed.
+**/
+
+extern GLuint raydium_texture_load_erase (char *filename, GLuint to_replace);
+/**
+Same as above, but ##to_replace## texture (index) is erased with ##filename##.
+**/
+
+extern char raydium_texture_current_set (GLuint current);
+/**
+Switch active texture to "current" index. Mostly used for runtime object 
+creation:
+"set current texture, add vertices, set another texture, 
+add vertices, ... and save all to an objet" 
+(see below for vertices management).
+**/
+
+extern char raydium_texture_current_set_name (char *name);
+/**
+Same as above, but using texture name. This function will load ##name## 
+if not alread done.
+**/
+
+extern GLuint raydium_texture_find_by_name (char *name);
+/**
+Returns index for texture "name", and load it if not already done.
+**/
+
+extern void raydium_texture_filter_change (GLuint filter);
+/**
+
+This function will change all filters at anytime.
+Please note that this function will reload all textures and can be very slow.
+
+%%(c)
+// will switch all textures to bilinear filter.
+raydium_texture_filter_change(RAYDIUM_TEXTURE_FILTER_BILINEAR)%%
+**/
+
+#endif
Index: joy.h
===================================================================
--- joy.h	(revision 0)
+++ joy.h	(revision 1)
@@ -0,0 +1,62 @@
+#ifndef _JOY_H
+#define _JOY_H
+/*=
+Joysticks, pads and force feedback
+3100
+**/
+
+// Introduction
+/**
+Raydium supports Joysticks, joypads, steering wheels, force feedback devices, 
+keyboard emulation, for Linux only.
+
+Since API could change during Win32 integration, there is no particular 
+documentation about this subject.
+
+Interesting variables:
+%%(c)
+char raydium_joy_button[RAYDIUM_BUTTONS_MAX_BUTTONS];
+GLfloat raydium_joy_x;
+GLfloat raydium_joy_y;
+GLfloat raydium_joy_z;
+int raydium_joy;
+%%
+Buttons are booleans, joy x,y and z are -1 <= (x,y,z) <= 1 and 0 means "center".
+**/
+
+#define JS_EVENT_BUTTON         0x01    /* button pressed/released */
+#define JS_EVENT_AXIS           0x02    /* joystick moved */
+#define JS_EVENT_INIT           0x80    /* initial state of device */
+extern char number_of_axes, number_of_buttons;
+extern int raydium_joy_event_handle;
+#ifndef WIN32
+struct ff_effect effect_tremble;
+#endif
+extern struct ff_effect effect_tremble;
+extern char effect_tremble_state;
+extern clock_t last_event;
+extern void raydium_joy_init_vars (void);
+extern void raydium_joy_key_emul (void);
+/**
+Emulate keyboard (directional pad) with joy, if any.
+**/
+
+#ifndef WIN32
+extern int raydium_joy_process_event (struct js_event e);
+#endif
+extern void raydium_joy_callback (void);
+extern void raydium_joy_ff_autocenter (int perc);
+/**
+Set Force Feedback autocenter factor.
+**/
+
+extern void raydium_joy_init (void);
+extern void raydium_joy_close (void);
+extern void raydium_joy_ff (void);
+extern void raydium_joy_ff_tremble_set (GLfloat period, GLfloat force);
+/**
+Send tremble effect to Force Feedback device for a determined period, 
+at a particular force. (no units yet).
+**/
+
+#endif
Index: console.h
===================================================================
--- console.h	(revision 0)
+++ console.h	(revision 1)
@@ -0,0 +1,106 @@
+#ifndef _CONSOLE_H
+#define _CONSOLE_H
+/*=
+In-game console
+3000
+**/
+
+// Introduction
+/**
+This chapter introduce Raydium console, allowing applications to take 
+user keyboard input (game commands, chat, ...) and to send informations 
+to this console.
+The end user can call the console using "the key below esc". 
+
+By default, if PHP support is enabled, all user commands will be redirected
+to PHP engine. Each command will get his own context, don't expect to create
+anything else than "single line PHP scripts" with the console. See PHP chapter
+for more informations.
+The console allows the user to prefix command with the following characters:
+
+- ##/##: Non PHP command. The command will be sent to application (see
+##raydium_console_gets_callback##, below.
+
+- ##>##: Will launch argument as a PHP script (identical to ##include("...")##)
+
+- ##!##: Will launch argument as a sequence script
+
+Command history is saved to ##raydium_history## file when application exits.
+
+You can use a ##void prompt(char *)## callback to get user commands. Your
+callback must be registered thru ##raydium_console_gets_callback##:
+%%(c) raydium_console_gets_callback=prompt; %%
+
+This console provides auto-completion of register functions and variables.
+See the suitable chapter for more information.
+**/
+
+extern void raydium_console_init (void);
+/**
+Internal use.
+**/
+
+extern void raydium_console_history_save (void);
+/**
+Internal use (will flush console history to disk).
+You can call it by yourself if needed.
+**/
+
+extern int raydium_console_gets (char *where);
+/**
+**DISABLED**.
+Use ##raydium_console_gets_callback## function pointer instead.
+**/
+
+extern void raydium_console_history_previous (void);
+/**
+Internal use.
+**/
+
+extern void raydium_console_history_next (void);
+/**
+Internal use.
+**/
+
+extern void raydium_console_history_add (char *str);
+/**
+Internal use.
+**/
+
+extern void raydium_console_exec_script (char *file);
+/**
+Internal use.
+**/
+
+extern void raydium_console_exec_last_command (void);
+/**
+Internal use.
+**/
+
+extern void raydium_console_line_add (char *format, ...);
+/**
+Mostly reserved for internal use, but unless ##raydium_log##, this function will
+add the provided data only to ingame console, and not to "native" console.
+**/
+
+extern void raydium_console_event (void);
+/**
+Internal use. Will switch console up and down.
+**/
+
+extern void raydium_console_draw (void);
+/**
+Internal use.
+**/
+
+extern int raydium_console_internal_isalphanumuscore (char c);
+/**
+Internal use.
+**/
+
+extern void raydium_console_complete (char *str);
+/**
+Internal use.
+**/
+
+#endif
Index: init.h
===================================================================
--- init.h	(revision 0)
+++ init.h	(revision 1)
@@ -0,0 +1,80 @@
+#ifndef _INIT_H
+#define _INIT_H
+/*=
+Initialization
+2400
+**/
+
+// Introduction
+/**
+This file is mainly designed for internal uses, but there's anyway 
+some interesting functions. 
+**/
+
+extern int raydium_init_cli_option (char *option, char *value);
+/**
+This function will search command line ##option##.
+If this option is found, the functions stores any argument to ##value## and
+returns 1.
+The function will return 0 if ##option## is not found.
+
+Example (search for: ##--ground##)
+%%(c)
+char ground[RAYDIUM_MAX_NAME_LEN];
+if(raydium_init_cli_option("ground",model))
+    {
+    setground(model);
+    }
+%%
+**/
+
+extern int raydium_init_cli_option_default (char *option, char *value, char *default_value);
+/**
+Same as above, but allows you to provide a default value (##default##) if
+the ##option## is not found on command line.
+**/
+
+extern void raydium_init_lights (void);
+/**
+Internal use. Must be moved to light.c.
+**/
+
+extern void raydium_init_objects (void);
+/**
+Internal use. Must be moved to object.c.
+**/
+
+extern void raydium_init_key (void);
+/**
+Internal use. Must be moved to key.c.
+**/
+
+extern void raydium_init_reset (void);
+/**
+This function is supposed to reset the whole Raydium engine: 
+textures, vertices, lights, objects, ...
+Never tested yet, and probaly fails for many reasons when called more than
+one time.
+**/
+
+extern void raydium_init_engine (void);
+/**
+Internal use. **Never** call this function by yourself, it may cause
+huge memory leaks.
+**/
+
+extern void raydium_init_args (int argc, char **argv);
+/**
+You must use this function, wich send application arguments to Raydium 
+and external libs (GLUT, OpenAL, ...).
+This must be done **before** any other call to Raydium.
+Example:
+%%(c)
+int main(int argc, char **argv)
+{
+raydium_init_args(argc,argv);
+[...]
+%%
+**/
+
+#endif
Index: rayphp.h
===================================================================
--- rayphp.h	(revision 0)
+++ rayphp.h	(revision 1)
@@ -0,0 +1,29 @@
+#ifndef _RAYPHP_H
+#define _RAYPHP_H
+
+/*=
+RayPHP (internals)
+3600
+**/
+
+// Introduction
+/**
+Raydium also use RayPHP (Raydium/PHP interface) for its own needs.
+For PHP part of these functions, see "rayphp/" directory.
+So far, RayPHP is dedicated to R3S (Raydium Server Side Scripts) access.
+All this is mostly usefull for internal uses, since Raydium provides ##fopen##
+wrappers, thru ##raydium_file_fopen##.
+**/
+
+extern int raydium_rayphp_repository_file_get (char *path);
+/**
+Will contact R3S servers for downloading ##path## file.
+**/
+
+extern int raydium_rayphp_repository_file_put (char *path, int depends);
+/**
+Will contact R3S servers for uploading ##path## file. Set ##depends## to
+true (1) if you also want to upload dependencies, false (0) otherwise.
+**/
+
+#endif
Index: object.h
===================================================================
--- object.h	(revision 0)
+++ object.h	(revision 1)
@@ -0,0 +1,69 @@
+#ifndef _OBJECT_H
+#define _OBJECT_H
+/*=
+Objects
+2300
+**/
+
+// Introduction
+/**
+With the following functions, you can easily draw and manage
+mesh objects (.tri file).
+**/
+
+extern GLint raydium_object_find (char *name);
+/**
+Lookups an object by his ##name##. This function will return -1 if the
+object's not found, and will not try to load the .tri file.
+**/
+
+extern GLint raydium_object_find_load (char *name);
+/**
+Same as above (##raydium_object_load##), but will try to load object
+**/
+
+extern void raydium_object_reset (GLuint o);
+/**
+Internal use. Do not call.
+**/
+
+extern int raydium_object_load (char *filename);
+/**
+Load ##filename## as a .tri file, and returns corresponding id, or
+-1 in case of error.
+**/
+
+extern void raydium_object_draw (GLuint o);
+/**
+Draws ##o## (index) object, using current matrixes.
+**/
+
+extern void raydium_object_draw_name (char *name);
+/**
+Same as above, but you only have to provide object's ##name## (".tri file"). 
+If this object was not already loaded, this function will do it for you.
+**/
+
+extern void raydium_object_deform (GLuint obj, GLfloat ampl);
+/**
+Early devel state. Useless as is.
+**/
+
+extern void raydium_object_deform_name (char *name, GLfloat ampl);
+/**
+Early devel state. Useless as is.
+**/
+
+extern GLfloat raydium_object_find_dist_max (GLuint obj);
+/**
+This function will return will return the distance form (0,0,0) 
+to the farest point of ##obj## object.
+**/
+
+extern void raydium_object_find_axes_max (GLuint obj, GLfloat * tx, GLfloat * ty, GLfloat * tz);
+/**
+This function returns the (maximum) size of the bounding box 
+of ##obj## (relative to (0,0,0)).
+**/
+
+#endif
Index: sky.h
===================================================================
--- sky.h	(revision 0)
+++ sky.h	(revision 1)
@@ -0,0 +1,33 @@
+#ifndef _SKY_H
+#define _SKY_H
+
+/*=
+Sky and environement boxes
+1900
+**/
+
+// Introduction
+/**
+Skyboxes are mostly automated.
+
+For now, Raydium will use ##BOXfront.tga##, ##BOXback.tga##, ##BOXleft.tga##,
+##BOXright.tga##, ##BOXbottom.tga## and ##BOXtop.tga## and will draw a 
+skybox only if fog is disabled (this is not for technical reasons, 
+but only for realism, just think about it ;)... but you can force 
+skybox with fog using ##raydium_sky_force## if you really want).
+**/
+
+
+extern void raydium_sky_box_cache (void);
+/**
+As skybox texture are sometimes large files, you can pre-load skybox
+with this function. If you don't do it, Raydium will load textures 
+during the first frame of your application.
+**/
+
+extern void raydium_sky_box_render (GLfloat x, GLfloat y, GLfloat z);
+/**
+Internal use.
+**/
+
+#endif
Index: ode.h
===================================================================
--- ode.h	(revision 0)
+++ ode.h	(revision 1)
@@ -0,0 +1,197 @@
+#ifndef _ODE_H
+#define _ODE_H
+#include "../ode.h"
+extern void raydium_ode_name_auto (char *prefix, char *dest);
+extern void raydium_ode_init_object (int i);
+extern void raydium_ode_init_element (int i);
+extern void raydium_ode_init_joint (int i);
+extern void raydium_ode_init_motor (int i);
+extern void raydium_ode_init_explosion (int e);
+extern void raydium_ode_init (void);
+extern char raydium_ode_object_isvalid (int i);
+extern char raydium_ode_element_isvalid (int i);
+extern char raydium_ode_joint_isvalid (int i);
+extern char raydium_ode_motor_isvalid (int i);
+extern char raydium_ode_explosion_isvalid (int i);
+extern void raydium_ode_ground_dTriArrayCallback (dGeomID TriMesh, dGeomID RefObject, const int *TriIndices, int TriCount);
+extern int raydium_ode_ground_dTriCallback (dGeomID TriMesh, dGeomID RefObject, int TriangleIndex);
+extern void raydium_ode_ground_set_name (char *name);
+extern int raydium_ode_object_find (char *name);
+extern int raydium_ode_element_find (char *name);
+extern int raydium_ode_joint_find (char *name);
+extern int raydium_ode_motor_find (char *name);
+extern int raydium_ode_explosion_find (char *name);
+extern int raydium_ode_object_create (char *name);
+extern char raydium_ode_object_rename (int o, char *newname);
+extern char raydium_ode_object_rename_name (char *o, char *newname);
+extern char raydium_ode_object_colliding (int o, char colliding);
+extern char raydium_ode_object_colliding_name (char *o, char colliding);
+extern void raydium_ode_object_linearvelocity_set (int o, dReal * vect);
+extern void raydium_ode_object_linearvelocity_set_name (char *o, dReal * vect);
+extern void raydium_ode_object_linearvelocity_set_name_3f (char *o, dReal vx, dReal vy, dReal vz);
+extern void raydium_ode_object_addforce (int o, dReal * vect);
+extern void raydium_ode_object_addforce_name (char *o, dReal * vect);
+extern void raydium_ode_object_addforce_name_3f (char *o, dReal vx, dReal vy, dReal vz);
+extern void raydium_ode_element_addforce (int e, dReal * vect);
+extern void raydium_ode_element_addforce_name (char *e, dReal * vect);
+extern void raydium_ode_element_addforce_name_3f (char *e, dReal vx, dReal vy, dReal vz);
+extern void raydium_ode_element_addtorque (int e, dReal * vect);
+extern void raydium_ode_element_addtorque_name (char *e, dReal * vect);
+extern void raydium_ode_element_addtorque_name_3f (char *e, dReal vx, dReal vy, dReal vz);
+extern char raydium_ode_element_material (int e, dReal erp, dReal cfm);
+extern char raydium_ode_element_material_name (char *name, dReal erp, dReal cfm);
+extern char raydium_ode_element_slip (int e, dReal slip);
+extern char raydium_ode_element_slip_name (char *e, dReal slip);
+extern char raydium_ode_element_rotfriction (int e, dReal rotfriction);
+extern char raydium_ode_element_rotfriction_name (char *e, dReal rotfriction);
+extern dReal *raydium_ode_element_linearvelocity_get (int e);
+extern dReal *raydium_ode_element_linearvelocity_get_name (char *e);
+extern void raydium_ode_element_OnBlow (int e, void *OnBlow);
+extern void raydium_ode_element_OnBlow_name (char *e, void *OnBlow);
+extern void raydium_ode_element_OnDelete (int e, void *OnDelete);
+extern void raydium_ode_element_OnDelete_name (char *e, void *OnDelete);
+extern void raydium_ode_element_gravity (int e, char enable);
+extern void raydium_ode_element_gravity_name (char *e, char enable);
+extern void raydium_ode_element_ttl_set (int e, int ttl);
+extern void raydium_ode_element_ttl_set_name (char *e, int ttl);
+extern char raydium_ode_element_aabb_get (int element, dReal * aabb);
+extern char raydium_ode_element_aabb_get_name (char *element, dReal * aabb);
+extern int raydium_ode_element_touched_get (int e);
+extern int raydium_ode_element_touched_get_name (char *e);
+extern char raydium_ode_element_player_set (int e, char isplayer);
+extern char raydium_ode_element_player_set_name (char *name, char isplayer);
+extern char raydium_ode_element_player_get (int e);
+extern char raydium_ode_element_player_get_name (char *name);
+extern char raydium_ode_element_player_angle (int e, dReal angle);
+extern char raydium_ode_element_player_angle_name (char *e, dReal angle);
+extern int raydium_ode_element_ground_texture_get (int e);
+extern int raydium_ode_element_ground_texture_get_name (char *e);
+extern int raydium_ode_element_object_get (int e);
+extern int raydium_ode_element_object_get_name (char *e);
+extern int raydium_ode_object_sphere_add (char *name, int group, dReal mass, dReal radius, char type, int tag, char *mesh);
+extern int raydium_ode_object_box_add (char *name, int group, dReal mass, dReal tx, dReal ty, dReal tz, char type, int tag, char *mesh);
+extern int raydium_ode_element_fix (char *name, int *elem, int nelems, char keepgeoms);
+extern void raydium_ode_element_unfix (int e);
+extern void raydium_ode_element_move (int elem, dReal * pos);
+extern void raydium_ode_element_move_3f(int elem, dReal x,dReal y, dReal z);
+extern void raydium_ode_element_move_name (char *name, dReal * pos);
+extern void raydium_ode_element_move_name_3f (char *name, dReal x, dReal y, dReal z);
+extern void raydium_ode_element_rotate (int elem, dReal * rot);
+extern void raydium_ode_element_rotate_3f (int elem, dReal rx, dReal ry, dReal rz);
+extern void raydium_ode_element_rotate_name (char *name, dReal * rot);
+extern void raydium_ode_element_rotateq (int elem, dReal * rot);
+extern void raydium_ode_element_rotateq_name (char *name, dQuaternion rot);
+extern void raydium_ode_element_rotate_name_3f (char *name, dReal rx, dReal ry, dReal rz);
+extern void raydium_ode_object_rotate(int obj, dReal *rot);
+extern void raydium_ode_object_rotate_name(char *obj, dReal *rot);
+extern void raydium_ode_object_rotate_name_3f(char *obj, dReal rx, dReal ry, dReal rz);
+extern void raydium_ode_element_rotate_direction (int elem, char Force0OrVel1);
+extern void raydium_ode_element_rotate_direction_name (char *e, char Force0OrVel1);
+extern void raydium_ode_element_data_set (int e, void *data);
+extern void raydium_ode_element_data_set_name (char *e, void *data);
+extern void *raydium_ode_element_data_get (int e);
+extern void *raydium_ode_element_data_get_name (char *e);
+extern int raydium_ode_element_tag_get (int e);
+extern int raydium_ode_element_tag_get_name (char *e);
+extern void raydium_ode_object_move (int obj, dReal * pos);
+extern void raydium_ode_object_move_name (char *name, dReal * pos);
+extern void raydium_ode_object_move_name_3f (char *name, dReal x, dReal y, dReal z);
+extern void raydium_ode_object_rotateq (int obj, dReal * rot);
+extern void raydium_ode_object_rotateq_name (char *obj, dReal * rot);
+extern void raydium_ode_joint_suspension (int j, dReal erp, dReal cfm);
+extern void raydium_ode_joint_suspension_name (char *j, dReal erp, dReal cfm);
+extern int raydium_ode_joint_attach_hinge2 (char *name, int elem1, int elem2, dReal axe1x, dReal axe1y, dReal axe1z, dReal axe2x, dReal axe2y, dReal axe2z);
+extern int raydium_ode_joint_attach_hinge2_name (char *name, char *elem1, char *elem2, dReal axe1x, dReal axe1y, dReal axe1z, dReal axe2x, dReal axe2y, dReal axe2z);
+extern int raydium_ode_joint_attach_universal (char *name, int elem1, int elem2, dReal posx, dReal posy, dReal posz, dReal axe1x, dReal axe1y, dReal axe1z, dReal axe2x, dReal axe2y, dReal axe2z);
+extern int raydium_ode_joint_attach_universal_name (char *name, char *elem1, char *elem2, dReal posx, dReal posy, dReal posz, dReal axe1x, dReal axe1y, dReal axe1z, dReal axe2x, dReal axe2y, dReal axe2z);
+extern int raydium_ode_joint_attach_hinge (char *name, int elem1, int elem2, dReal posx, dReal posy, dReal posz, dReal axe1x, dReal axe1y, dReal axe1z);
+extern int raydium_ode_joint_attach_hinge_name (char *name, char *elem1, char *elem2, dReal posx, dReal posy, dReal posz, dReal axe1x, dReal axe1y, dReal axe1z);
+extern int raydium_ode_joint_attach_fixed (char *name, int elem1, int elem2);
+extern int raydium_ode_joint_attach_fixed_name (char *name, char *elem1, char *elem2);
+extern void raydium_ode_joint_hinge_limits (int j, dReal lo, dReal hi);
+extern void raydium_ode_joint_hinge_limits_name (char *j, dReal lo, dReal hi);
+extern void raydium_ode_joint_universal_limits (int j, dReal lo1, dReal hi1, dReal lo2, dReal hi2);
+extern void raydium_ode_joint_universal_limits_name (char *j, dReal lo1, dReal hi1, dReal lo2, dReal hi2);
+extern void raydium_ode_joint_hinge2_block (int j, char block);
+extern void raydium_ode_joint_hinge2_block_name (char *name, char block);
+extern void raydium_ode_joint_delete_callback (int j, void (*f) (int));
+extern void raydium_ode_joint_delete_callback_name (char *name, void (*f) (int));
+extern void raydium_ode_joint_break_force (int j, dReal maxforce);
+extern void raydium_ode_joint_break_force_name (char *name, dReal maxforce);
+extern void raydium_ode_joint_elements_get (int j, int *e1, int *e2);
+extern void raydium_ode_joint_elements_get_name (char *j, int *e1, int *e2);
+extern void raydium_ode_motor_update_joints_data_internal (int j);
+extern void raydium_ode_motor_speed (int j, dReal force);
+extern void raydium_ode_motor_speed_name (char *name, dReal force);
+extern void raydium_ode_motor_power_max (int j, dReal power);
+extern void raydium_ode_motor_power_max_name (char *name, dReal power);
+extern void raydium_ode_motor_angle (int j, dReal angle);
+extern void raydium_ode_motor_angle_name (char *motor, dReal angle);
+extern void raydium_ode_motor_gears_set (int m, dReal * gears, int n_gears);
+extern void raydium_ode_motor_gears_set_name (char *m, dReal * gears, int n_gears);
+extern void raydium_ode_motor_gear_change (int m, int gear);
+extern void raydium_ode_motor_gear_change_name (char *m, int gear);
+extern dReal *raydium_ode_element_pos_get (int j);
+extern dReal *raydium_ode_element_pos_get_name (char *name);
+extern char raydium_ode_element_rotq_get (int j, dQuaternion res);
+extern char raydium_ode_element_rotq_get_name (char *name, dQuaternion res);
+extern char raydium_ode_element_rot_get (int e, dReal * rx, dReal * ry, dReal * rz);
+extern char raydium_ode_element_rot_get_name (char *e, dReal * rx, dReal * ry, dReal * rz);
+extern void raydium_ode_element_sound_update (int e, int source);
+extern void raydium_ode_element_sound_update_name (char *e, int source);
+extern void raydium_ode_element_RelPointPos (int e, dReal px, dReal py, dReal pz, dReal * res);
+extern void raydium_ode_element_RelPointPos_name (char *e, dReal px, dReal py, dReal pz, dReal * res);
+extern int raydium_ode_motor_create (char *name, int obj, char type);
+extern void raydium_ode_motor_attach (int motor, int joint, int joint_axe);
+extern void raydium_ode_motor_attach_name (char *motor, char *joint, int joint_axe);
+extern dReal raydium_ode_motor_speed_get (int m, int gears);
+extern dReal raydium_ode_motor_speed_get_name (char *name, int gears);
+extern void raydium_ode_motor_rocket_set (int m, int element, dReal x, dReal y, dReal z);
+extern void raydium_ode_motor_rocket_set_name (char *motor, char *element, dReal x, dReal y, dReal z);
+extern void raydium_ode_motor_rocket_orientation (int m, dReal rx, dReal ry, dReal rz);
+extern void raydium_ode_motor_rocket_orientation_name (char *name, dReal rx, dReal ry, dReal rz);
+extern void raydium_ode_motor_rocket_playermovement (int m, char isplayermovement);
+extern void raydium_ode_motor_rocket_playermovement_name (char *m, char isplayermovement);
+extern char raydium_ode_motor_delete (int e);
+extern char raydium_ode_motor_delete_name (char *name);
+extern char raydium_ode_joint_delete (int joint);
+extern char raydium_ode_joint_delete_name (char *name);
+extern char raydium_ode_element_delete (int e, char deletejoints);
+extern char raydium_ode_element_delete_name (char *name, char deletejoints);
+extern char raydium_ode_object_delete (int obj);
+extern char raydium_ode_object_delete_name (char *name);
+extern char raydium_ode_explosion_delete (int e);
+extern char raydium_ode_element_moveto (int element, int object, char deletejoints);
+extern char raydium_ode_element_moveto_name (char *element, char *object, char deletejoints);
+extern void raydium_ode_joint_break (int j);
+extern char raydium_ode_launcher (int element, int from_element, dReal * rot, dReal force);
+extern char raydium_ode_launcher_name (char *element, char *from_element, dReal * rot, dReal force);
+extern char raydium_ode_launcher_name_3f (char *element, char *from_element, dReal rx, dReal ry, dReal rz, dReal force);
+extern char raydium_ode_launcher_simple (int element, int from_element, dReal * lrot, dReal force);
+extern char raydium_ode_launcher_simple_name (char *element, char *from_element, dReal * rot, dReal force);
+extern char raydium_ode_launcher_simple_name_3f (char *element, char *from_element, dReal rx, dReal ry, dReal rz, dReal force);
+extern void raydium_ode_explosion_blow (dReal radius, dReal max_force, dReal * pos);
+extern void raydium_ode_explosion_blow_3f (dReal radius, dReal max_force, dReal px, dReal py, dReal pz);
+extern int raydium_ode_explosion_create (char *name, dReal final_radius, dReal propag, dReal * pos);
+extern void raydium_ode_element_camera_inboard (int e, dReal px, dReal py, dReal pz, dReal lookx, dReal looky, dReal lookz);
+extern void raydium_ode_element_camera_inboard_name (char *name, dReal px, dReal py, dReal pz, dReal lookx, dReal looky, dReal lookz);
+extern void raydium_ode_draw_all (char names);
+extern void raydium_ode_near_callback (void *data, dGeomID o1, dGeomID o2);
+extern void raydium_ode_callback (void);
+extern void raydium_ode_time_change (GLfloat perc);
+extern void raydium_ode_element_particle (int elem, char *filename);
+extern void raydium_ode_element_particle_name (char *elem, char *filename);
+extern void raydium_ode_element_particle_offset (int elem, char *filename, dReal * offset);
+extern void raydium_ode_element_particle_offset_name (char *elem, char *filename, dReal * offset);
+extern void raydium_ode_element_particle_offset_name_3f (char *elem, char *filename, dReal ox, dReal oy, dReal oz);
+extern void raydium_ode_element_particle_point (int elem, char *filename);
+extern void raydium_ode_element_particle_point_name (char *elem, char *filename);
+extern void raydium_camera_smooth_path_to_element (char *path, int element, GLfloat path_step, GLfloat smooth_step);
+extern void raydium_camera_smooth_path_to_element_name (char *path, char *element, GLfloat path_step, GLfloat smooth_step);
+extern void raydium_camera_smooth_element_to_path_offset (int element, GLfloat offset_x, GLfloat offset_y, GLfloat offset_z, char *path, GLfloat path_step, GLfloat smooth_step);
+extern void raydium_camera_smooth_element_to_path_offset_name (char *element, GLfloat offset_x, GLfloat offset_y, GLfloat offset_z, char *path, GLfloat path_step, GLfloat smooth_step);
+extern void raydium_camera_smooth_element_to_path_name (char *element, char *path, GLfloat path_step, GLfloat smooth_step);
+extern int raydium_ode_capture_3d(char *filename);
+extern int raydium_ode_orphans_check(void);
+#include "ode_net.h"
+#endif
Index: light.h
===================================================================
--- light.h	(revision 0)
+++ light.h	(revision 1)
@@ -0,0 +1,106 @@
+#ifndef _LIGHT_H
+#define _LIGHT_H
+/*=
+Lights
+900
+**/
+
+// Introduction to Raydium light system
+/**
+When we starts Raydium development, the main idea was to use native OpenGL
+lights, and not lightmaps or another method.
+
+This method (native lights) provides 8 simultaneous movable lights, 
+and is quite effective with recent OpenGL hardware.
+
+You can modify intensity, position, color, you can turn on any light at 
+any time, make them blinking... Mixing all theses features can result 
+many effects, as realtime sunset, flashing lights for cars, explosions, ...
+
+Usage is very easy: no need to create lights, just turn them on. 
+
+See also: LightMaps
+**/
+
+extern void raydium_light_enable (void);
+/**
+Obvious.
+**/
+
+extern void raydium_light_disable (void);
+/**
+Obvious.
+**/
+
+extern GLuint raydium_light_to_GL_light (GLuint l);
+/**
+Probably useless for end user. (internal uses)
+**/
+
+extern void raydium_light_on (GLuint l);
+/**
+Turns ##l## light on ( 0 <= l <= RAYDIUM_MAX_LIGHTS )
+**/
+
+extern void raydium_light_off (GLuint l);
+/**
+Turns ##l## light off
+**/
+
+extern void raydium_light_switch (GLuint l);
+/**
+Will swith ##l## light state (from "on" to "off", for example).
+**/
+
+extern void raydium_light_update_position (GLuint l);
+/**
+Updates ##raydium_light_position[l]## array changes to hardware.
+This function is now used internaly by Raydium,
+so you have no reasons to call it by yourself.
+**/
+
+extern void raydium_light_update_position_all (void);
+/**
+See above.
+**/
+
+extern void raydium_light_update_intensity (GLuint l);
+/**
+See above.
+**/
+
+extern void raydium_light_update_all (GLuint l);
+/**
+See above.
+**/
+
+extern void raydium_light_move (GLuint l, GLfloat * vect);
+/**
+Moves light to position ##vect## for light ##l## (vect is GLfloat[4]: x,y,z,dummy).
+
+Just move your lights before camera placement, or your changes 
+will be applied to the next frame only.
+**/
+
+extern void raydium_light_reset (GLuint l);
+/**
+This function will restore all defaults for ##l## light.
+**/
+
+extern void raydium_light_blink_internal_update (GLuint l);
+/**
+Useless for end-user.
+**/
+
+extern void raydium_light_blink_start (GLuint l, int fpc);
+/**
+Makes ##l## light blinking at ##fpc## (frames per cycle) rate.
+This function will use timecalls soon ("fpc" -> "hertz")
+**/
+
+extern void raydium_light_callback (void);
+/**
+Useless for end-user.
+**/
+
+#endif
Index: vertex.h
===================================================================
--- vertex.h	(revision 0)
+++ vertex.h	(revision 1)
@@ -0,0 +1,32 @@
+#ifndef _VERTEX_H
+#define _VERTEX_H
+
+/*=
+vertices
+1700
+**/
+
+// Introduction
+/**
+You can create objets at runtime, if needed, using the following functions.
+Each of theses functions adds only one vertex so, obviously, you need to 
+call three time the same function to add one triangle. 
+**/
+
+
+extern void raydium_vertex_add (GLfloat x, GLfloat y, GLfloat z);
+/**
+Adds a vertex at (##x,y,z##).
+**/
+
+extern void raydium_vertex_uv_add (GLfloat x, GLfloat y, GLfloat z, GLfloat u, GLfloat v);
+/**
+Same as above, but providing texture mapping informations with ##u## and ##v##.
+**/
+
+extern void raydium_vertex_uv_normals_add (GLfloat x, GLfloat y, GLfloat z, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat u, GLfloat v);
+/**
+Same as above, giving vertex's normal with (##nx,ny,nz##).
+**/
+
+#endif
Index: background.h
===================================================================
--- background.h	(revision 0)
+++ background.h	(revision 1)
@@ -0,0 +1,14 @@
+#ifndef _BACKGROUND_H
+#define _BACKGROUND_H
+/*=
+Background
+800
+**/
+
+extern void raydium_background_color_change (GLfloat r, GLfloat g, GLfloat b, GLfloat a);
+/**
+Will change ##raydium_background_color## array and apply this modification.
+(will update fog color, obviously).
+**/
+
+#endif
Index: register.h
===================================================================
--- register.h	(revision 0)
+++ register.h	(revision 1)
@@ -0,0 +1,73 @@
+#ifndef _REGISTER_H
+#define _REGISTER_H
+
+/*=
+Data registration
+3400
+**/
+
+// Introduction
+/**
+Raydium supports scripting, for example using PHP in the current implementation.
+All ##raydium_register_*## functions are provided as a "bridge" between
+your applications and PHP scripts, allowing you to "export" native variables 
+and functions to PHP scripts.
+For more informations, see PHP chapters.
+**/
+
+extern int raydium_register_find_name (char *name);
+/**
+Lookups a **variable** by ##name##. Search is not possible (yet) for
+registered functions.
+Mostly used internally.
+**/
+
+extern char raydium_register_name_isvalid (char *name);
+/**
+Tests ##name##, and returns his viability as a boolean.
+Accepted intervals for variables and functions: [a-z], [A-Z] and '_'
+Numerics are not allowed.
+**/
+
+extern int raydium_register_variable (void *addr, int type, char *name);
+/**
+Will register a new variable. You must provide variable's address (##addr##), 
+##type## and ##name##.
+Current available types are: ##RAYDIUM_REGISTER_INT##, ##RAYDIUM_REGISTER_FLOAT##,
+and ##RAYDIUM_REGISTER_STR##.
+**/
+
+extern int raydium_register_variable_const_f(float val, char *name);
+/**
+Will register a new ##float## constant.
+**/
+
+extern int raydium_register_variable_const_i(int val, char *name);
+/**
+Will register a new ##int## constant.
+**/
+
+extern void raydium_register_variable_unregister_last (void);
+/**
+Variable are registered on a stack. As you may want to create "temporary"
+variables (usefull for building script's arguments, for example), this function
+allows you to unregister last registered variable. Multiple calls are possible.
+**/
+
+extern int raydium_register_modifiy (char *var, char *args);
+/**
+Deprecated.
+**/
+
+extern void raydium_register_function (void *addr, char *name);
+/**
+Will register a function. You only need to provide an address (##addr##)
+and a name.
+**/
+
+extern void raydium_register_dump (void);
+/**
+Will dump to console all registered variables and functions.
+**/
+
+#endif
Index: trigo.h
===================================================================
--- trigo.h	(revision 0)
+++ trigo.h	(revision 1)
@@ -0,0 +1,71 @@
+#ifndef _TRIGO_H
+#define _TRIGO_H
+
+/*=
+Maths
+200
+*/
+
+// Little introduction to trigo.c
+/**
+This section is mostly designed for internal uses, but provides some
+usefull maths functions.
+**/
+
+extern GLfloat raydium_trigo_cos (GLfloat i);
+/**
+Obvious (degrees)
+**/
+
+extern GLfloat raydium_trigo_sin (GLfloat i);
+/**
+Obvious (degrees)
+**/
+
+extern GLfloat raydium_trigo_cos_inv (GLfloat i);
+/**
+Obvious (degrees)
+**/
+
+extern GLfloat raydium_trigo_sin_inv (GLfloat i);
+/**
+Obvious (degrees)
+**/
+
+#define raydium_trigo_abs(a) ( (a) < (0) ? (-a) : (a) )
+/**
+Obvious
+**/
+
+#define raydium_trigo_min(a,b) ( (a) < (b) ? (a) : (b) )
+/**
+Obvious
+**/
+
+#define raydium_trigo_max(a,b) ( (a) > (b) ? (a) : (b) )
+/**
+Obvious
+**/
+
+#define raydium_trigo_isfloat(a) ( (!isnan(a) && !isinf(a)) ? 1 : 0)
+/**
+Test two cases : "Not a Number" and "Infinite"
+**/
+
+extern void raydium_trigo_rotate (GLfloat * p, GLfloat rx, GLfloat ry, GLfloat rz, GLfloat * res);
+/**
+Rotate p (GLfloat * 3) by (rx,ry,rx) angles (degrees).
+Result is stored in res (GLfloat * 3)
+**/
+
+extern void raydium_trigo_pos_to_matrix (GLfloat * pos, GLfloat * m);
+/**
+Generates a ODE style matrix (16 Glfloat) from pos (GLfloat * 3)
+**/
+
+extern void raydium_trigo_pos_get_modelview (GLfloat * res);
+/**
+Stores the current OpenGL MODELVIEW matrix in res (16 GLfloat)
+**/
+
+#endif
Index: php.h
===================================================================
--- php.h	(revision 0)
+++ php.h	(revision 1)
@@ -0,0 +1,57 @@
+#ifndef _PHP_H
+#define _PHP_H
+// PHP support for Raydium
+// Known bug: recursive Ray/PHP calls are fatal (segfault in zend core).
+
+#include "../php_wrappers.c"
+// use this macro when registering your functions
+#define C2PHP ZEND_FN
+
+
+// Dirty globals... (needed for WIN32 PHP support)
+#ifdef ZTS
+extern zend_compiler_globals *compiler_globals;
+extern zend_executor_globals *executor_globals;
+extern php_core_globals *core_globals;
+extern sapi_globals_struct *sapi_globals;
+extern void ***tsrm_ls;
+#endif
+extern int raydium_init_cli_option (char *option, char *value);;
+// { // Unrecognized
+//   return SAPI_HEADER_SENT_SUCCESSFULLY; // Unrecognized
+// } // Unrecognized
+// { // Unrecognized
+// } // Unrecognized
+// { // Unrecognized
+//   return SUCCESS; // Unrecognized
+// } // Unrecognized
+extern void raydium_php_error (int type, const char *msg, ...);
+extern int raydium_php_uwrite (const char *str, uint str_length TSRMLS_DC);
+//   "RayHandler", // Unrecognized
+//   "Raydium PHP Handler", // Unrecognized
+//   php_dummy, // Unrecognized
+//   php_dummy, // Unrecognized
+//   NULL, // Unrecognized
+//   NULL, // Unrecognized
+//   raydium_php_uwrite, // Unrecognized
+//   NULL, // Unrecognized
+//   NULL, // Unrecognized
+//   NULL, // Unrecognized
+//   raydium_php_error, // Unrecognized
+//   NULL, // Unrecognized
+//   sapi_raydium_send_headers, // Unrecognized
+//   sapi_raydium_send_header, // Unrecognized
+//   NULL, // Unrecognized
+//   NULL, // Unrecognized
+//   NULL, // Unrecognized
+//   NULL, // Unrecognized
+//   NULL, // Unrecognized
+//   NULL, // Unrecognized
+//   NULL, // Unrecognized
+//   STANDARD_SAPI_MODULE_PROPERTIES // Unrecognized
+// }; // Unrecognized
+extern void raydium_php_init_request (char *filename);
+extern int raydium_php_exec (char *name);
+extern void raydium_php_close (void);
+extern void raydium_php_init (void);
+#endif
Index: sound.h
===================================================================
--- sound.h	(revision 0)
+++ sound.h	(revision 1)
@@ -0,0 +1,249 @@
+#ifndef _SOUND_H
+#define _SOUND_H
+/*=
+Sound and music
+2600
+**/
+
+// Introduction
+/**
+The Raydium sound API is pretty easy to use and there's only need to use a 
+few functions to make your program ouput sounds or music.
+
+On top of this, there are a bunch of functions to modify the sound behavior.
+
+Raydium uses OpenAL and OggVorbis? for its sounds and musics, for a basic 
+use of our sound API you only need to know one thing: OpenAL uses buffers 
+for its sounds and you need to be able to address the sounds separately.
+For this we use ALuint in our code. Each buffer is associated to a source,
+we have an array of all available sources and then, you only need to have 
+a simple int that acts as an index in this array. See below for more
+informations.
+
+Music is readed thru libogg, streamed from disk. If you want to play an
+OGG audio track, the only thing you've to do is to call the suitable function.
+You can use ##raydium_sound_music_eof_callback## if needed. This event is
+fired when sound track ends, allowing you to switch to another file.
+Prototype for this callback is ##int callback(char *new_track)##, allowing
+you to do something like ##strcpy(new_track,"foobar.ogg"); return 1;##.
+Return 0 if you do not want to switch to another audio file (this will stops
+music playback).
+
+This document is not an alternative to OpenAL papers, and only provides
+informations about Raydium's interface to OpenAL.
+See specifications here: http://www.openal.org/documentation.html
+**/
+
+extern void raydium_sound_verify (char *caller);
+/**
+This functions checks if any error occured during last OpenAL operation.
+You don't have to call this function by yourself, since every function of
+this API will do it.
+**/
+
+extern int raydium_sound_Array3IsValid(ALfloat *a);
+/**
+Since OpenAL is very sensitive to malformed values, this function is used
+internally to check consistency of provided ALfloat arrays.
+**/
+
+extern void raydium_sound_InitSource (int src);
+/**
+Internal use.
+**/
+
+extern int raydium_sound_LoadWav (const char *fname);
+/**
+This function tries to load the ##fname## wav file into a buffer, if 
+successful, it returns the source id, else 0.
+**/
+
+extern int raydium_sound_SourceVerify (int src);
+/**
+Internal id checks.
+**/
+
+extern int raydium_sound_SetSourceLoop (int src, char loop);
+/**
+Modifies the ##loop## property of the ##src## source (loops if loop is non-zero, 
+default value for a source is "true").
+Returns 0 if ok, -1 if error.
+**/
+
+extern int raydium_sound_GetSourcePitch (int src, ALfloat * p);
+/**
+Returns current pitch for ##src## source.
+**/
+
+extern int raydium_sound_SetSourcePitch (int src, ALfloat p);
+/**
+Sets pitch for ##src## source.
+Current OpenAL spec is not clear about pitch's limits. Raydium will 
+clamp values to to ]0,2] interval.
+**/
+
+extern int raydium_sound_GetSourceGain (int src, ALfloat * g);
+/**
+Returns current gain ("volume") for ##src## source.
+**/
+
+extern int raydium_sound_SetSourceGain (int src, ALfloat g);
+/**
+Sets gain ("volume") for ##src## source.
+Current OpenAL spec is not clear about pitch's limits. Raydium do not allows
+negative values, but no upper limit is set.
+Warning: some OpenAL implementations will provide strange gain curves. More
+work is needed on this issue.
+**/
+
+extern int raydium_sound_SetSourcePos (int src, ALfloat Pos[]);
+/**
+Sets 3D position of ##src## source.
+##Pos## is a 3 * ALfloat array.
+**/
+
+extern int raydium_sound_SetSourcePosCamera(int src);
+/**
+Sets 3D position of ##src## source on the current camera position.
+**/
+
+extern int raydium_sound_GetSourcePos (int src, ALfloat * Pos[]);
+/**
+Returns current 3D position of ##src## source.
+##Pos## is a 3 * ALfloat array.
+**/
+
+extern int raydium_sound_SetSourceDir (int src, ALfloat Dir[]);
+/**
+Sets 3D direction of ##src## source.
+##Dir## is a 3 * ALfloat array.
+**/
+
+extern int raydium_sound_GetSourceDir (int src, ALfloat * Dir[]);
+/**
+Returns current 3D direction of ##src## source.
+##Dir## is a 3 * ALfloat array.
+**/
+
+extern int raydium_sound_SetSourceVel (int src, ALfloat Vel[]);
+/**
+Sets 3D velocity of ##src## source.
+##Vel## is a 3 * ALfloat array.
+**/
+
+extern int raydium_sound_GetSourceVel (int src, ALfloat * Vel[]);
+/**
+Returns current 3D velocity of ##src## source.
+##Vel## is a 3 * ALfloat array.
+**/
+
+extern void raydium_sound_SetListenerPos (ALfloat Pos[]);
+/**
+Sets 3D position of listener.
+This is done automatically by Raydium, each frame, using camera informations
+##Pos## is a 3 * ALfloat array.
+**/
+
+extern void raydium_sound_GetListenerPos (ALfloat * Pos[]);
+/**
+Returns current 3D position of listener.
+##Pos## is a 3 * ALfloat array.
+**/
+
+extern void raydium_sound_SetListenerOr (ALfloat Or[]);
+/**
+Sets 3D orientation of listener.
+This is done automatically by Raydium, each frame, using camera informations
+##Or## is a 3 * ALfloat array.
+**/
+
+extern void raydium_sound_GetListenerOr (ALfloat * Or[]);
+/**
+Returns current 3D orientation of listener.
+##Or## is a 3 * ALfloat array.
+**/
+
+extern void raydium_sound_SetListenerVel (ALfloat Vel[]);
+/**
+Sets 3D velocity of Listener.
+##Vel## is a 3 * ALfloat array.
+**/
+
+extern void raydium_sound_GetListenerVel (ALfloat * Vel[]);
+/**
+Returns current 3D velocity of Listener.
+##Vel## is a 3 * ALfloat array.
+**/
+
+extern void raydium_sound_init (void);
+/**
+Internal use.
+**/
+
+extern int raydium_sound_SourcePlay (int src);
+/**
+Plays the ##src## source.
+If ##src## was already in "play" state, the buffer is rewinded.
+Returns 0 if ok, -1 if error.
+**/
+
+extern int raydium_sound_SourceStop (int src);
+/**
+Stops the ##src## source.
+Returns 0 if ok, -1 if error.
+**/
+
+extern int raydium_sound_SourcePause (int src);
+/**
+Will pause the ##src## source.
+Returns 0 if ok, -1 if error.
+**/
+
+extern int raydium_sound_SourceUnpause (int src);
+/**
+##src## will restart playback after being paused.
+Returns 0 if ok, -1 if error.
+**/
+
+extern void raydium_sound_close (void);
+/**
+Internal use.
+**/
+
+extern int BufferData (ALuint buffer, OggVorbis_File * file, vorbis_info * ogginfo);
+extern void raydium_sound_internal_cleanstreambuffs (void);
+extern int StartMusic (ALuint musicsource, ALuint * buffers, OggVorbis_File * file, vorbis_info * ogginfo);
+extern int raydium_sound_load_music (char *fname);
+/**
+Opens fname **OGG** music file and prepairs Raydium for playing it.
+The music will be automatically played after a call to this function.
+This function will use R3S (data repositories) if needed.
+To switch to another audio track, simply call again this function.
+Send ##NULL## or an empty string to cancel music playback.
+Returns 0 if ok, -1 if error
+
+See also ##raydium_sound_music_eof_callback## at the top of this chapter.
+**/
+
+extern void raydium_sound_music_callback (void);
+/**
+Internal use.
+**/
+
+extern void raydium_sound_callback (void);
+/**
+Internal use.
+**/
+
+// Example
+/**
+%%(c)
+int sound;
+sound=raydium_sound_LoadWav("explo.wav");
+raydium_sound_SetSourceLoop(sound,0);
+[...]
+if(explosion) raydium_sound_SourcePlay(sound);
+%%
+**/
+
+#endif
Index: network.h
===================================================================
--- network.h	(revision 0)
+++ network.h	(revision 1)
@@ -0,0 +1,396 @@
+#ifndef _NETWORK_H
+#define _NETWORK_H
+/*=
+Network
+2800
+**/
+
+// Bases of Raydium's networking API
+/**
+Raydium supports networking via UDP/IP, providing high level functions 
+for multiplayer game development.
+Raydium servers are limited to 256 clients for now.
+
+You will find in network.c a set of functions and vars dedicated to 
+networked games: players names, event callbacks, UDP sockets, 
+broadcasts, ... 
+All this is ready to use. As it's not done in the introduction of this 
+guide, We will explain here some variables defined in common.c.
+
+%%(c)
+#define RAYDIUM_NETWORK_PORT          29104
+#define RAYDIUM_NETWORK_PACKET_SIZE   230
+#define RAYDIUM_NETWORK_TIMEOUT       5
+#define RAYDIUM_NETWORK_PACKET_OFFSET 4
+#define RAYDIUM_NETWORK_MAX_CLIENTS   8
+#define RAYDIUM_NETWORK_MODE_NONE     0
+#define RAYDIUM_NETWORK_MODE_CLIENT   1
+#define RAYDIUM_NETWORK_MODE_SERVER   2
+%%
+
+Here, we can find network port declaration (Raydium will use only one 
+port, allowing easy port forwarding management, if needed), default timeout 
+(unit: second), and the three mode possible for a Raydium application.
+
+But there is also two other very important defines: packet size 
+(unit: byte) and max number of clients.. This is important because 
+Raydium uses UDP sockets, and UDP sockets required fixed 
+length packets, and as you need to set packet size as small as possible 
+(for obvious speed reasons), you must calculate you maximum 
+information packet size (players position, for example), multiply 
+it by ##RAYDIUM_NETWORK_MAX_CLIENTS##,and add ##RAYDIUM_NETWORK_PACKET_OFFSET##
+wich represent the required header of the packet.
+
+It's more easy than it seems, look:
+//
+My game will support 8 players.
+I will send players state with 3 floats (x,y,z).
+My packet size must be: 8*3*sizeof(float)+RAYDIUM_NETWORK_PACKET_OFFSET = 100 bytes.
+//
+Please, do not change packet offset size, since Raydium will use it
+for packet header.
+
+%%(c)
+#define RAYDIUM_NETWORK_DATA_OK     1
+#define RAYDIUM_NETWORK_DATA_NONE   0
+#define RAYDIUM_NETWORK_DATA_ERROR -1
+%%
+
+This three defines are used as network functions result:
+
+%%(c)
+if(raydium_network_read_flushed(&id,&type,buff)==RAYDIUM_NETWORK_DATA_OK)
+{
+...
+%%
+
+%%(c) #define RAYDIUM_NETWORK_PACKET_BASE 20 %%
+
+In most network functions, you will find a "type" argument, used to 
+determine packet goal. This type is 8 bits long (256 possible values), 
+but Raydium is already using some of them. So you can use 
+##RAYDIUM_NETWORK_PACKET_BASE## as a base for your own types:
+
+%%(c)
+#define NORMAL_DATA RAYDIUM_NETWORK_PACKET_BASE
+#define BALL_TAKEN (NORMAL_DATA+1)
+#define SCORE_INFO (NORMAL_DATA+2)
+#define HORN (NORMAL_DATA+3)
+...
+%%
+
+===Variables:===
+
+Your own player id (0<= id < RAYDIUM_NETWORK_MAX_CLIENTS),
+read only: ##int raydium_network_uid;##
+Special value "-1" means that you're not connected (see below).
+
+Current network mode (none, client, server),
+read only: ##char raydium_network_mode;##
+
+Boolean used to determine client state (connected or not), read only:
+##char raydium_network_client[RAYDIUM_NETWORK_MAX_CLIENTS];##
+
+example: 
+%%(c)
+if(raydium_network_client[4])
+    draw_player(4);
+%%
+
+Can be used by a server to send data to his clients. Read only:
+##struct sockaddr raydium_network_client_addr[RAYDIUM_NETWORK_MAX_CLIENTS];##
+
+Players names, read only:
+##char raydium_network_name[RAYDIUM_NETWORK_MAX_CLIENTS][RAYDIUM_MAX_NAME_LEN];##
+
+##OnConnect## and ##OnDisconnect## events (server only):
+##void * raydium_network_on_connect;
+void * raydium_network_on_disconnect;##
+
+You can place your owns callbacks (##void(int)##) on these events, as in 
+this example:
+
+%%(c)
+void new_client(int client)
+{
+raydium_log("New player: %s", raydium_network_nameclient);
+}
+
+...
+
+int main(int argc, char **argv)
+{
+...
+raydium_network_on_connect=new_client;
+...
+%%
+**/
+
+// Reliablility versus Speed
+/**
+As explained above, Raydium is using UDP network packets, and as 
+you may know, UDP is not a reliable protocol, aiming speed before all.
+This system is interesting for sending non-sensible data, as player positions,
+for example.
+But Raydium's can handle more important data, using some of methods of TCP
+protocol, as Timeouts, ACK, resending, ...
+This TCP style packets are available thru "Netcalls".
+**/
+
+// High level API: "Netcalls" and "Propags"
+/**
+Netcalls provides you a good way to handle network exchanges using
+callbacks functions, like a simple RPC system.
+The idea is simple, built over the notion of "type". See suitable functions for
+more information about this system.
+
+Another available mechanism is called Propags, and allows you to "share"
+variables over the network (scores, game state, ...) in a very few steps.
+You only need to "create" a type, and link a variable to it (any C type or
+structure is allowed). After each modification of this (local copy of the) 
+variable, just call ##raydium_network_propag_refresh*## and that's it. If 
+any other client (or the server) is applying a modification to this "type", 
+your local copy is automatically updated.
+**/
+
+extern int raydium_network_propag_find (int type);
+/**
+Lookups a "propag" by his ##type##. Returns -1 is no propag is found.
+**/
+
+extern void raydium_network_propag_recv (int type, char *buff);
+/**
+Internal callback for "propag" receiving.
+**/
+
+extern void raydium_network_propag_refresh_id (int i);
+/**
+Will refresh a propag by his ##id##.
+**/
+
+extern void raydium_network_propag_refresh (int type);
+/**
+Will refresh a propag by his ##type##.
+**/
+
+extern void raydium_network_propag_refresh_all (void);
+/**
+Will refresh all propags
+**/
+
+extern int raydium_network_propag_add (int type, void *data, int size);
+/**
+This function will "register" a new propag. You need to provide the address
+of your variable/structure (##data##), ans its ##size##. A dedicated ##type##
+is also required (see at the top of this chapter).
+**/
+
+extern void raydium_network_queue_element_init (raydium_network_Tcp * e);
+/**
+Internal use. (TCP style packets)
+**/
+
+extern unsigned short raydium_network_queue_tcpid_gen (void);
+/**
+Internal use. (TCP style packets)
+**/
+
+extern void raydium_network_queue_tcpid_known_add (int tcpid, int player);
+/**
+Internal use. (TCP style packets)
+**/
+
+extern char raydium_network_queue_tcpid_known (unsigned short tcpid, unsigned short player);
+/**
+Internal use. (TCP style packets)
+**/
+
+extern char raydium_network_queue_is_tcpid (int type);
+/**
+Internal use. (TCP style packets)
+**/
+
+extern void raydium_network_queue_element_add (char *packet, struct sockaddr *to);
+/**
+Internal use. (TCP style packets)
+**/
+
+extern unsigned long *raydium_network_internal_find_delay_addr (int player);
+/**
+Internal use. (TCP style packets)
+**/
+
+extern void raydium_network_queue_check_time (void);
+/**
+Internal use. (TCP style packets)
+**/
+
+extern void raydium_network_queue_ack_send (unsigned short tcpid, struct sockaddr *to);
+/**
+Internal use. (TCP style packets)
+**/
+
+extern void raydium_network_queue_ack_recv (int type, char *buff);
+/**
+Internal use. (TCP style packets)
+**/
+
+extern void raydium_network_player_name (char *str);
+/**
+This function will returns the current player name.
+Raydium will ask the OS for "current logged user", but player name may
+be provided thru ##--name## command line argument.
+**/
+
+extern char raydium_network_set_socket_block (int block);
+/**
+This function will sets ##block## (true or false) status to the network stack.
+A blocking socket will wait indefinitely an incoming packet. A non blocking one
+will return "no data" instead.
+You've almost no reason to call this function by yourself.
+**/
+
+extern char raydium_network_netcall_add (void *ptr, int type, char tcp);
+/**
+This function will register a new Network Callback ("netcall").
+With Raydium, you can read the main data stream with 
+##raydium_network_read_flushed()##, and configure netcalls on random 
+events (using packet type).
+
+Netcalls signature is: ##void(int type, char *buff)##
+
+As you may configure the same callback function for multiples packet types,
+this type is passed to your function, with the temporary ##buff## buffer.
+You can extract from field from packet if needed.
+
+If you sets the ##tcp## flag to true (1), your packet will use "TCP style"
+network protocol (see a the top of this chapter).
+**/
+
+extern void raydium_network_netcall_exec (int type, char *buff);
+/**
+Internal callback for "netcall" receiving.
+**/
+
+extern char raydium_network_timeout_check (void);
+/**
+Internal use.
+**/
+
+extern char raydium_network_init (void);
+/**
+Nothing interesting unless you're creating a console server (using the
+##RAYDIUM_NETWORK_ONLY## directive), since in this case you must do all
+inits by yourself...
+example :
+%%(c)
+#define RAYDIUM_NETWORK_ONLY
+#include "raydium/index.c"
+
+...
+
+int main(int argc, char **argv)
+{
+setbuf(stdout,NULL);
+signal(SIGINT,quit);
+raydium_php_init(); // only if you need PHP support
+raydium_network_init();
+raydium_network_server_create();
+...
+%%
+**/
+
+extern void raydium_network_write (struct sockaddr *to, int from, char type, char *buff);
+/**
+Obviously, this function will send data.
+If you're a client, you don't need to determine to field, as the only 
+destination is the server, so you can use ##NULL##, for example. If you're 
+a server, you can use ##raydium_network_client_addr[]## array.
+
+As a client, ##from## argument is generally your own uid (##raydium_network_uid##),
+but you can use any other player number if needed.
+As a server, ##from## field is useless, since you are the only machine able 
+to send data to clients.
+
+As you may expect, ##type## field is used to determine packet's type.
+You can use any (8 bits) value greater or equal to ##RAYDIUM_NETWORK_PACKET_BASE##.
+
+Finally, ##buff## is a pointer to data's buffer. This buffer 
+must be ##RAYDIUM_NETWORK_PACKET_SIZE## long, and can be cleared 
+or re-used after this call.
+**/
+
+extern void raydium_network_broadcast (char type, char *buff);
+/**
+Sends data over network.
+Obviously, from network point of vue, only a server can broadcast 
+(to his clients).
+
+When a client needs to broadcast (from the game point of vue) some 
+informations (his own position, for example), he must send this information
+to server, and the server will broadcast it.
+
+This function uses the same arguments as previous one, except ##to## and 
+##from##, not needed here.
+**/
+
+extern char raydium_network_read (int *id, char *type, char *buff);
+/**
+Reads next packet from network (FIFO) stack.
+This function uses the same arguments as previous ones, and returns 
+data availability: ##RAYDIUM_NETWORK_DATA_OK##, ##RAYDIUM_NETWORK_DATA_NONE##
+or ##RAYDIUM_NETWORK_DATA_ERROR##.
+**/
+
+extern char raydium_network_read_flushed (int *id, char *type, char *buff);
+/**
+Reads last packet from network stack.
+All previous packets will be ignored, only the newest packet will
+be read (if any).
+
+As you may miss some important informations, you can use netcalls 
+(see above) if you want to capture packets with a particular 
+type, even with flushed reading.
+**/
+
+extern char raydium_network_server_create (void);
+/**
+Will transform you application into a server, accepting new clients 
+instantaneously.
+See also the ##RAYDIUM_NETWORK_ONLY## directive if you want to create console
+servers.
+**/
+
+extern char raydium_network_client_connect_to (char *server);
+/**
+This function will try to connect your application to ##server## (hostname or 
+ip address).
+WARNING: For now, this call could be endless ! (server failure while connecting).
+This function will succed returning 1 or 0 otherwise.
+You are connected instantaneously, and you must start sending data 
+before server timeout (defined by ##RAYDIUM_NETWORK_TIMEOUT##).
+You player number can be found with ##raydium_network_uid## variable, 
+as said before.
+**/
+
+extern char raydium_server_accept_new (struct sockaddr *from, char *name);
+/**
+Internal server callback for new clients.
+**/
+
+extern void raydium_network_close (void);
+/**
+Obvious. Raydium will do it for you, anyway.
+**/
+
+extern void raydium_network_internal_server_delays_dump (void);
+/**
+Dumps "TCP Style" timeouts for all clients to console.
+**/
+
+extern void raydium_network_internal_dump (void);
+/**
+Dumps various stats about network stack to console.
+**/
+
+#endif
Index: timecall.h
===================================================================
--- timecall.h	(revision 0)
+++ timecall.h	(revision 1)
@@ -0,0 +1,146 @@
+#ifndef _TIMECALL_H
+#define _TIMECALL_H
+/*=
+Timecalls
+2700
+**/
+
+// Concept
+/**
+As you may already know, in a real time application (as a game), you need 
+to control in-game time evolution.
+For example, you cannot increment a car position by 1 at each frame since 
+it will generate an irregular scrolling (a frame is never rendered within 
+the same time as the previous or the next one).
+
+Raydium supports timecalls, wich are a great solution for this problem. 
+Usage is very simple: write a simple function, and ask Raydium to call it 
+at the desired rate.
+**/
+
+// Constraints
+/**
+There is an important risk with timecalls: infinite loops.
+If a callback is long, it may take more CPU time than he would, as in this
+very simple example:
+
+foo() is a function, taking 200 ms for his own execution. If you ask for 
+a 6 Hz execution, Raydium will execute foo() six times on the first frame, 
+taking 1200 ms. On the next frame, Raydium will need to execute foo() 7 
+times (the asked 6 times, and one more for the 200 ms lost during the last 
+frame), taking 1400 ms, so 8 times will be needed for the next frame, then 9, ...
+
+So you need to create callbacks as short as possible, since long callbacks 
+may cause a game freeze on slower machines than yours. (1 FPS syndrom)
+**/
+
+// Hardware devices and methods
+/**
+Raydium must use a very accurate system timer, and will try many methods:
+##/dev/rtc## , ##gettimeofday()## (Linux only) and 
+##QueryPerformanceCounter## for win32.
+
+##gettimeofday()## will use a CPU counter and is extremely accurate. 
+It's far the best method. (0.001 ms accuracy is possible)
+
+##/dev/rtc## is quite good, and Raydium will try to configure RTC at 
+##RAYDIUM_TIMECALL_FREQ_PREFERED## rate (8192 Hz by default), but may 
+require a "##/proc/sys/dev/rtc/max-user-freq##" modification:
+##echo 8192 > /proc/sys/dev/rtc/max-user-freq##
+
+You may want to look at common.c for interesting defines about timecalls. 
+**/
+
+#ifdef WIN32
+#define __GETTIMEOFDAY_USEC 1000
+#else
+#define __GETTIMEOFDAY_USEC 1000000
+#endif
+extern void raydium_timecall_raydium (GLfloat step);
+/**
+Internal Raydium callback.
+**/
+
+#ifdef WIN32
+extern float raydium_timecall_internal_w32_detect_modulo(int div);
+/**
+Internal, WIN32 only: Returns timer resolution for ##div## divisor.
+**/
+
+extern int raydium_timecall_internal_w32_divmodulo_find(void);
+/**
+Internal, WIN32 only: Detects the best timer divisor for the current CPU.
+**/
+
+#endif
+extern unsigned long raydium_timecall_devrtc_clock (void);
+/**
+Internal, Linux only: Reads and return RTC clock.
+**/
+
+extern unsigned long raydium_timecall_clock (void);
+/**
+Returns current "time".
+**/
+
+extern char raydium_timecall_devrtc_rate_change (unsigned long new);
+/**
+Internal, Linux only: Modifies RTC clock rate.
+**/
+
+extern void raydium_timecall_devrtc_close (void);
+/**
+Internal, Linux only: Will close RTC clock.
+**/
+
+extern unsigned long raydium_timecall_devrtc_init (void);
+/**
+Internal, Linux only: Will open RTC clock.
+**/
+
+extern int raydium_timecall_detect_frequency (void);
+/**
+Internal: This function will find the best timer available for current
+platform, and adjust properties to your hardware (rate, divisor, ...).
+**/
+
+extern void raydium_timecall_init (void);
+/**
+Internal use.
+**/
+
+
+extern int raydium_timecall_add (void *funct, GLint hz);
+/**
+There is two sort of timecalls with Raydium:
+
+1. Standard ones:
+%%(c)
+raydium_timecall_add(function,800);
+%%
+##void function(void)## will be called 800 times per second.
+
+2. Elastic timed ones:
+%%(c)
+raydium_timecall_add(function,-80);
+%%
+##void function(float step)## will be called for each frame, with a 
+"##step## factor" as argument. In the above example, a 160 Hz game will call 
+function with step = 0.5, but step = 2.0 for a 40 Hz game.
+
+A standard timecall will use ##void(void)## function and a positive ##hertz##
+argument, as an elasitc one will use ##void(float)## and negative ##hertz## argument.
+**/
+
+extern void raydium_timecall_freq_change (int callback, GLint hz);
+/**
+This function changes the ##callback## frequency. See above for possibles
+values of ##hz## (negative and positive values).
+**/
+
+extern void raydium_timecall_callback (void);
+/**
+Internal use (frame fired callback).
+**/
+
+#endif
Index: capture.h
===================================================================
--- capture.h	(revision 0)
+++ capture.h	(revision 1)
@@ -0,0 +1,26 @@
+#ifndef _CAPTURE_H
+#define _CAPTURE_H
+/*=
+Capture (2D)
+700
+**/
+
+// Quickview
+/**
+Captures are made in TGA format (without RLE compression) and saved into
+the current directory.
+This function may fail (garbage in resulting capture) if frame size if 
+not "standard", mostly after a window resize.
+**/
+
+extern void raydium_capture_frame(char *filename);
+/**
+Capture current frame to ##filename##.
+**/
+
+extern void raydium_capture_frame_auto(void);
+/**
+Same as above, but to an auto-generated filename (raycap*).
+**/
+
+#endif
Index: reg_api.h
===================================================================
--- reg_api.h	(revision 0)
+++ reg_api.h	(revision 1)
@@ -0,0 +1,6 @@
+#ifndef _REGAPI_H
+#define _REGAPI_H
+
+void raydium_register_api(void);
+
+#endif
Index: window.h
===================================================================
--- window.h	(revision 0)
+++ window.h	(revision 1)
@@ -0,0 +1,52 @@
+#ifndef _WINDOW_H
+#define _WINDOW_H
+/*=
+Window management
+600
+**/
+
+// Introduction
+/**
+Some important functions, used for window creation and managment.
+**/
+
+extern void raydium_window_close (void);
+/**
+This function is called by Raydium, do not use.
+**/
+
+extern void raydium_window_create (GLuint tx, GLuint ty, char rendering, char *name);
+/**
+You must call this function once in your program, with following arguments:
+
+1. ##tx##, ##ty##: window size, in pixel
+2. ##rendering##: window mode: ##RAYDIUM_RENDERING_*## (NONE, WINDOW, FULLSCREEN)
+3. ##name##: window's name
+
+Raydium is using GLUT for window management, and GLUT fullscreen is not 
+the same between various implementations, and can fail, 
+so use a standard window size (640x480, 800x600, ...) for fullscreen mode.
+
+Note that user can force fullscreen using ##--fullscreen## on the command line.
+**/
+
+extern void raydium_window_resize_callback (GLsizei Width, GLsizei Height);
+/**
+This function is automaticaly called during a window resize, 
+and resize OpenGL rendering space.
+
+There is almost no reason to call this function by yourself.
+**/
+
+extern void raydium_window_view_update (void);
+/**
+If you've changed 3D window size (clipping: raydium_projection_*),
+apply to hardware with this fonction. 
+**/
+
+extern void raydium_window_view_perspective(GLfloat fov, GLfloat fnear, GLfloat ffar);
+/**
+All-in-one function: sets all "perspective" variables, and updates.
+**/
+
+#endif
Index: fog.h
===================================================================
--- fog.h	(revision 0)
+++ fog.h	(revision 1)
@@ -0,0 +1,42 @@
+#ifndef _FOG_H
+#define _FOG_H
+/*=
+Fog
+500
+**/
+
+// Introduction
+/**
+Fog is usefull for two major reasons:
+
+1. Realism: Just try, and you'll understand: 
+amazing depth impression, no ?
+
+2. Speed: For a correct fog effect (i'm talking 
+about estetic aspect), you must bring near_clipping to a closer value,
+reducing the overall number of triangles displayed at the same time. 
+**/
+
+extern void raydium_fog_enable (void);
+/**
+Obvious
+**/
+
+extern void raydium_fog_disable (void);
+/**
+Obvious
+**/
+
+extern void raydium_fog_color_update (void);
+/**
+If you have modified ##raydium_background_color## array, you must 
+call this function, applying the specified color to hardware.
+See also: ##raydium_background_color_change##
+**/
+
+extern void raydium_fog_mode (void);
+/**
+Do not use. Instable prototype.
+**/
+
+#endif
Index: internal.h
===================================================================
--- internal.h	(revision 0)
+++ internal.h	(revision 1)
@@ -0,0 +1,26 @@
+#ifndef _INTERNAL_H
+#define _INTERNAL_H
+
+/*=
+"Internal" informations access
+2000
+**/
+
+extern void raydium_internal_dump (void);
+/**
+This function is now systematically called by Raydium at application's exit,
+displaying some informations about loaded textures, objects, registered data,
+network statistics.
+**/
+
+extern void raydium_internal_dump_matrix (int n);
+/**
+Dumps matrix to console.
+##n## values are:
+%%
+0 for GL_PROJECTION_MATRIX
+1 for GL_MODELVIEW_MATRIX
+%%
+**/
+
+#endif