sio2.h File Reference

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <unistd.h>
#include <sys/sysctl.h>
#include <sys/time.h>
#include "btBulletDynamicsCommon.h"
#include "btSoftRigidDynamicsWorld.h"
#include "btSoftBodyRigidBodyCollisionConfiguration.h"
#include "btShapeHull.h"
#include "btSoftBody.h"
#include "btGImpactShape.h"
#include "btGImpactCollisionAlgorithm.h"
#include <OpenGLES/EAGL.h>
#include <OpenGLES/ES1/gl.h>
#include <OpenGLES/ES1/glext.h>
#include <OpenAL/al.h>
#include <OpenAL/alc.h>
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
#include "sio2_stream.h"
#include "sio2_string.h"
#include "sio2_script.h"
#include "sio2_vector.h"
#include "sio2_utils.h"
#include "sio2_state.h"
#include "sio2_mist.h"
#include "sio2_window.h"
#include "sio2_image.h"
#include "sio2_video.h"
#include "sio2_soundbuffer.h"
#include "sio2_sound.h"
#include "sio2_material.h"
#include "sio2_transform.h"
#include "sio2_widget.h"
#include "sio2_font.h"
#include "sio2_ipocurve.h"
#include "sio2_ipo.h"
#include "sio2_lamp.h"
#include "sio2_timer.h"
#include "sio2_particle.h"
#include "sio2_emitter.h"
#include "sio2_camera.h"
#include "sio2_frame.h"
#include "sio2_action.h"
#include "sio2_vertexgroup.h"
#include "sio2_thread.h"
#include "sio2_socket.h"
#include "sio2_url.h"
#include "sio2_object.h"
#include "sio2_constraint.h"
#include "sio2_physic.h"
#include "sio2_sensor.h"
#include "sio2_resource.h"
#include "sio2_cert.h"

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SIO2

Defines

#define SIO2_MAX_CHAR   32
#define SIO2_MAX_PATH   256
#define SIO2_PI   3.141593f
#define SIO2_PI_2   SIO2_PI * 0.5f
#define SIO2_DEG_TO_RAD   0.017453f
#define SIO2_RAD_TO_DEG   57.29577f
#define SIO2_ARCHIVE_TYPE   9
#define SIO2_LAMP_MAX   8
#define SIO2_SOUND_BUFFER   4
#define SIO2_SOUND_BUFFER_SIZE   8092
#define SIO2_VIDEO_BUFFER   2
#define SIO2_VIDEO_BUFFER_BITS   3
#define SIO2_VIDEO_BUFFER_SIZE   8092
#define SIO2_THREAD_TIMEOUT   1
#define SIO2_BUFFER_OFFSET(i)   ( ( char * )NULL + i )
#define SIO2_CLAMP(x, low, high)   ( ( x > high ) ? high : ( ( x < low ) ? low : x ) )
#define BT_NO_PROFILE

Functions

void sio2InitGL (void)
void sio2InitAL (void)
void sio2ShutdownAL (void)
void sio2InitLUA (void)
int sio2ExecLUA (char *)
void sio2ShutdownLUA (void)
void sio2ResetLUA (void)
void sio2InitWidget (void)
void sio2ShutdownWidget (void)
void sio2ErrorGL (const char *, const char *, unsigned int)
void sio2ErrorAL (const char *, const char *, unsigned int)
void sio2Error (const char *, const char *, unsigned int, const char *, const char *,...)
void sio2ResetState (void)
bool sio2PhysicContactCallback (btManifoldPoint &, const btCollisionObject *, int, int, const btCollisionObject *, int, int)
size_t sio2OggRead (void *, size_t, size_t, void *)
int sio2OggSeek (void *, ogg_int64_t, int)
static long sio2OggTell (void *_SIO2stream)
static int sio2OggClose (void *_SIO2stream)
static void sio2PngRead (png_structp _png_structp, png_bytep _png_bytep, png_size_t _png_size_t)

Variables

SIO2sio2
 The global SIO2 handle.


Define Documentation

#define BT_NO_PROFILE

#define SIO2_ARCHIVE_TYPE   9

#define SIO2_BUFFER_OFFSET (  )     ( ( char * )NULL + i )

#define SIO2_CLAMP ( x,
low,
high   )     ( ( x > high ) ? high : ( ( x < low ) ? low : x ) )

#define SIO2_DEG_TO_RAD   0.017453f

#define SIO2_LAMP_MAX   8

#define SIO2_MAX_CHAR   32

#define SIO2_MAX_PATH   256

#define SIO2_PI   3.141593f

#define SIO2_PI_2   SIO2_PI * 0.5f

Referenced by sio2DrawWireSphere().

#define SIO2_RAD_TO_DEG   57.29577f

#define SIO2_SOUND_BUFFER   4

#define SIO2_SOUND_BUFFER_SIZE   8092

#define SIO2_THREAD_TIMEOUT   1

#define SIO2_VIDEO_BUFFER   2

#define SIO2_VIDEO_BUFFER_BITS   3

#define SIO2_VIDEO_BUFFER_SIZE   8092


Function Documentation

void sio2Error ( const char _fname,
const char _funct,
unsigned int  _line,
const char _type,
const char _fmt,
  ... 
)

Helper function to create your own C/C++ error check.

References SIO2_MAX_PATH, and sio2StringLen().

Here is the call graph for this function:

void sio2ErrorAL ( const char _fname,
const char _funct,
unsigned int  _line 
)

void sio2ErrorGL ( const char _fname,
const char _funct,
unsigned int  _line 
)

Helper function to check if there's a OpenGL error.

References SIO2_MAX_CHAR, and sio2StringCpy().

Here is the call graph for this function:

int sio2ExecLUA ( char _code  ) 

Inject and execute some LUA code.

_code: Some valid LUA code.

return the error number if any.

References SIO2::_lua_State.

void sio2InitAL ( void   ) 

Initialize OpenAL.

References SIO2::_ov_callbacks, SIO2::context, SIO2::device, sio2ErrorAL(), sio2OggClose(), sio2OggRead(), sio2OggSeek(), and sio2OggTell().

Here is the call graph for this function:

void sio2InitGL ( void   ) 

Initialize the SIO2 default OpenGL machine state.

References SIO2::_SIO2state, SIO2_CULL_FACE, SIO2_DEPTH_TEST, SIO2_VERTEX_ARRAY, and sio2StateEnable().

Here is the call graph for this function:

void sio2InitLUA ( void   ) 

Initialize a new LUA virtual machine.

References SIO2::_lua_State, SIO2_MAX_CHAR, sio2StringCpy(), sio2StringLen(), and sio2StringToUpper().

Here is the call graph for this function:

void sio2InitWidget ( void   ) 

Initialize the widget system. Basically simply create 2 VBO of a centered quads and a bottom left aligned quad that will be reuse for every widget as a template.

References SIO2::wid.

static int sio2OggClose ( void *  _SIO2stream  )  [inline, static]

size_t sio2OggRead ( void *  _ptr,
size_t  _size,
size_t  _read,
void *  _SIO2stream 
)

The OGG read callback.

References SIO2stream::buf, SIO2stream::pos, and SIO2stream::size.

Referenced by sio2InitAL().

int sio2OggSeek ( void *  _SIO2stream,
ogg_int64_t  _offset,
int  _stride 
)

The OGG seek callback.

References SIO2stream::pos, and SIO2stream::size.

Referenced by sio2InitAL().

static long sio2OggTell ( void *  _SIO2stream  )  [inline, static]

References SIO2stream::pos.

Referenced by sio2InitAL().

bool sio2PhysicContactCallback ( btManifoldPoint &  cp,
const btCollisionObject *  colObj0,
int  partId0,
int  index0,
const btCollisionObject *  colObj1,
int  partId1,
int  index1 
)

Bullet Physic, collision callback. Usually initialize by SIO2sensor. But if you are not using sensor and want to override this function with your own, you can simply assign the gContactCallback yourself. Please take note that this can only be used for dynamic object, since static object will not add a contact point.

References SIO2sensor::_SIO2object0, SIO2sensor::_SIO2object1, SIO2::_SIO2resource, SIO2resource::_SIO2sensor, SIO2sensor::_SIO2sensorcontact, and SIO2resource::n_sensor.

Referenced by sio2SensorInitContact().

static void sio2PngRead ( png_structp  _png_structp,
png_bytep  _png_bytep,
png_size_t  _png_size_t 
) [inline, static]

References sio2StreamRead().

Referenced by sio2ImageLoadPNG().

Here is the call graph for this function:

void sio2ResetLUA ( void   ) 

Reset the LUA virtual machine to its default state.

References SIO2::_lua_State, and sio2ShutdownLUA().

Here is the call graph for this function:

void sio2ResetState ( void   ) 

Reset the SIO2 global variables to a default state. This function should be called everytime after you load stuff from a .SIO2 file.

References SIO2::_SIO2camera, SIO2::_SIO2constraint, SIO2::_SIO2font, SIO2::_SIO2image, SIO2::_SIO2ipo, SIO2::_SIO2ipocurve, SIO2::_SIO2lamp, SIO2::_SIO2material, SIO2::_SIO2object, SIO2::_SIO2vertexgroup, and SIO2_MATERIAL_MAX_CHANNEL.

void sio2ShutdownAL ( void   ) 

Shutdown OpenAL.

References SIO2::context, SIO2::device, and sio2ErrorAL().

Here is the call graph for this function:

void sio2ShutdownLUA ( void   ) 

References SIO2::_lua_State.

Referenced by sio2ResetLUA().

void sio2ShutdownWidget ( void   ) 

Shutdown the widget system. Basically flushing the widget template VBO.

References SIO2::wid.


Variable Documentation

The global SIO2 handle.

Referenced by sio2ActionFree(), sio2ActionInit(), sio2ActionLoad(), sio2CameraFree(), sio2CameraInit(), sio2CameraLoad(), sio2ConstraintFree(), sio2ConstraintInit(), sio2ConstraintLoad(), sio2EmitterFree(), sio2EmitterInit(), sio2EmitterRender(), sio2EmitterReset(), sio2FontFree(), sio2FontInit(), sio2FontPrint(), sio2FontReset(), sio2GetElapsedTime(), sio2ImageFree(), sio2ImageGenId(), sio2ImageInit(), sio2IpoFree(), sio2IpoInit(), sio2IpoLoad(), sio2LampDisableLighting(), sio2LampEnableLighting(), sio2LampFree(), sio2LampInit(), sio2LampLoad(), sio2LampRender(), sio2LampReset(), sio2MaterialFree(), sio2MaterialInit(), sio2MaterialLoad(), sio2MaterialRender(), sio2MaterialReset(), sio2MistFree(), sio2MistInit(), sio2MistRender(), sio2MistReset(), sio2ObjectBindVBO(), sio2ObjectFree(), sio2ObjectInit(), sio2ObjectLoad(), sio2ObjectRender(), sio2ObjectReset(), sio2PhysicFree(), sio2PhysicInit(), sio2ResourceBindAllSounds(), sio2ResourceDispatchStream(), sio2ResourceOpen(), sio2ResourceUnload(), sio2ScriptCompile(), sio2ScriptFree(), sio2ScriptGetError(), sio2ScriptInit(), sio2SensorFree(), sio2SensorInitCollision(), sio2SensorInitContact(), sio2SensorInitDistance(), sio2SensorInitRay(), sio2SoundBufferFree(), sio2SoundBufferGenId(), sio2SoundBufferInit(), sio2SoundFree(), sio2SoundInit(), sio2StreamOpen(), sio2TimerFree(), sio2TimerInit(), sio2UrlFree(), sio2UrlInit(), sio2VertexGroupRender(), sio2VideoFree(), sio2VideoInit(), sio2WidgetDebug(), sio2WidgetFree(), sio2WidgetInit(), and sio2WidgetRender().


Generated on Thu Mar 4 15:41:42 2010 for SIO2 Engine by  doxygen 1.5.6