#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"

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 | |
| SIO2 * | sio2 |
| The global SIO2 handle. | |
| #define BT_NO_PROFILE |
| #define SIO2_ARCHIVE_TYPE 9 |
Referenced by sio2ResourceDispatchStream().
| #define SIO2_BUFFER_OFFSET | ( | i | ) | ( ( char * )NULL + i ) |
Referenced by sio2FontPrint(), sio2ObjectBindVBO(), and sio2WidgetRender().
| #define SIO2_CLAMP | ( | x, | |||
| low, | |||||
| high | ) | ( ( x > high ) ? high : ( ( x < low ) ? low : x ) ) |
| #define SIO2_DEG_TO_RAD 0.017453f |
Referenced by sio2Rotate3D(), sio2TransformRotateX(), and sio2TransformRotateZ().
| #define SIO2_LAMP_MAX 8 |
Referenced by sio2LampReset(), and sio2ResourceRender().
| #define SIO2_MAX_CHAR 32 |
| #define SIO2_MAX_PATH 256 |
Referenced by sio2Error(), sio2FontPrint(), sio2ImageLoad(), sio2ResourceOpen(), sio2StreamOpen(), sio2StreamParse(), and sio2UrlDownload().
| #define SIO2_PI 3.141593f |
Referenced by sio2DrawWireSphere(), sio2Perspective(), and sio2TransformGetRotFromMatrix().
| #define SIO2_PI_2 SIO2_PI * 0.5f |
Referenced by sio2DrawWireSphere().
| #define SIO2_RAD_TO_DEG 57.29577f |
Referenced by sio2DotProductToDeg(), sio2DrawWireSphere(), sio2GetAngleX(), and sio2GetAngleZ().
| #define SIO2_SOUND_BUFFER 4 |
Referenced by sio2SoundBufferFree(), sio2SoundBufferGenId(), sio2SoundGenId(), and sio2SoundUpdateStream().
| #define SIO2_SOUND_BUFFER_SIZE 8092 |
Referenced by sio2SoundBufferGenId(), and sio2SoundBufferStream().
| #define SIO2_THREAD_TIMEOUT 1 |
Referenced by sio2ThreadCreate(), sio2ThreadFree(), and sio2ThreadRun().
| #define SIO2_VIDEO_BUFFER 2 |
Referenced by sio2VideoFree(), sio2VideoLoad(), and sio2VideoQueueBuffers().
| #define SIO2_VIDEO_BUFFER_BITS 3 |
Referenced by sio2VideoBufferStream(), and sio2VideoGetImage().
| #define SIO2_VIDEO_BUFFER_SIZE 8092 |
Referenced by sio2VideoBufferStream(), and sio2VideoLoad().
| 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().

Helper function to check if there's a OpenAL error.
References SIO2_MAX_CHAR, and sio2StringCpy().
Referenced by sio2InitAL(), sio2ResetListener(), sio2ResourceSetAmbientVolume(), sio2ResourceSetFxVolume(), sio2ShutdownAL(), sio2SoundBufferFree(), sio2SoundBufferGenId(), sio2SoundBufferStream(), sio2SoundFree(), sio2SoundGenId(), sio2SoundPause(), sio2SoundPlay(), sio2SoundRewind(), sio2SoundSetDefault(), sio2SoundSetFx(), sio2SoundSetSpeed(), sio2SoundSetVolume(), sio2SoundStop(), sio2SoundUpdateState(), sio2SoundUpdateStream(), and sio2UpdateListener().

Helper function to check if there's a OpenGL error.
References SIO2_MAX_CHAR, and sio2StringCpy().

| 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().

| void sio2InitGL | ( | void | ) |
Initialize the SIO2 default OpenGL machine state.
References SIO2::_SIO2state, SIO2_CULL_FACE, SIO2_DEPTH_TEST, SIO2_VERTEX_ARRAY, and sio2StateEnable().

| void sio2InitLUA | ( | void | ) |
Initialize a new LUA virtual machine.
References SIO2::_lua_State, SIO2_MAX_CHAR, sio2StringCpy(), sio2StringLen(), and sio2StringToUpper().

| 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] |
Referenced by sio2InitAL(), sio2SoundBufferFree(), and sio2SoundBufferGenId().
| 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] |
| 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().

| void sio2ResetLUA | ( | void | ) |
Reset the LUA virtual machine to its default state.
References SIO2::_lua_State, and sio2ShutdownLUA().

| 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().

| void sio2ShutdownLUA | ( | void | ) |
| void sio2ShutdownWidget | ( | void | ) |
Shutdown the widget system. Basically flushing the widget template VBO.
References SIO2::wid.
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().
1.5.6