Enhance Makefile, add pkg-config support

Improve the Makefile and add pkg-config support, so that a stand-
alone application only needs the sre pkg-config link flags,
corresponding to the version of SRE installed (which may vary
depending on SRE library configuration options and back-ends).

Signed-off-by: Harm Hanemaaijer <fgenfb@yahoo.com>
Fix erratic view change at start-up and window resizing

Fix bug that caused erratic camera view changes at start-up (after
changing mousing panning mode) and when resizing the window.

Signed-off-by: Harm Hanemaaijer <fgenfb@yahoo.com>
Add function to load mipmapped texture while skipping large levels

Add the sreCreateTextureLimitLevel() function to allow the mipmap
level that is actually used to be limited to a given size at the
texture level. Only the mipmaps levels in the allowable size range
are uploaded to the GPU. Previously, detail reduction only happened
in conjunction with global texture detail flags.

To facilitate this, sreTexture::Load() has been added. The
sreCreateTexture() functions are the preferred way to create
textures, while directly invoking the constructor is deprecated
for use applications.

Signed-off-by: Harm Hanemaaijer <fgenfb@yahoo.com>
Run ranlib on static libaries after building
Use flags parameter in sreTexture member functions
Fix compilation issue on Mali platform
Move the mipmaps selection code in the texture loading functions

Signed-off-by: Harm Hanemaaijer <fgenfb@yahoo.com>
Optimize shadow map matrices (use 4x3 matrix)

Optimize the shadow map matrix generation matrix for directional
lights to use a 4x3 matrix. The shadow map transformation matrix used
in lighting passes has also been optimized to use a 4x3 matrix.

Add a seperate shader for spotlight (projection) shadow map
generation.

Signed-off-by: Harm Hanemaaijer <fgenfb@yahoo.com>
Add SIMD optimizations

Add a set of SIMD-optimized functions, using SSE extensions on x86
processors, primarily used when calculation large amounts of
dot product and matrix multiplication.

The internal format of the MatrixTransform class (4x3 matrix) has
been changed to row-major for more efficient multiplication. Other
matrix types are still internally stored in column-major order.

Reorganize the silhouettte edge calculation code using class
functions and provide optional SIMD optimization.

The SIMD support level is configurable in Makfile.conf.

Some disappearing shadow bugs are visible in the current version
which may be due to bugs in matrix multiplication optimzations
or the changes to the MatrixTransform class.

Signed-off-by: Harm Hanemaaijer <fgenfb@yahoo.com>
Optimize AABB calculation with SIMD operations

Optimize AABB calculations by using SIMD instructions. Some
intersection tests, as well as AABB update functions are implemented
using SIMD optimizations. The new class sreBoundingVolumeAABB_SIMD
is introduced for this purpose.

The shadow caster and shadow receiver AABB region calculation before
shadow map generation is now optionally accelerated with SIMD. However,
at the time of the current commit shadow mapping for non-directional
lights is still non-functional (unrelated to the SIMD optimizations).

Signed-off-by: Harm Hanemaaijer <fgenfb@yahoo.com>
Fix and enable 4x4 by 4x3 SIMD matrix multiplication

4x4 by 4x3 matrix multiplication using SIMD now works and has been
enabled.

Add spotlight shadow map shaders to shadow map shader validation.

Signed-off-by: Harm Hanemaaijer <fgenfb@yahoo.com>
SIMD improvements and optimizations

Improve SIMD support by generalizing and add new functions.

Add SIMD-optimized functions for multiplication of a matrix
with a set of vertices.

Allow use of a vector load instruction instead of setting individual
components when initializing SIMD registers for calculations.

Signed-off-by: Harm Hanemaaijer <fgenfb@yahoo.com>
Fix SIMD matrix multiplication with vectors; add support for points

SIMD Matrix multiplication with array of vectors now works correctly.
Support the Point3D type with implicit w-coordinate of 1.0.

Signed-off-by: Harm Hanemaaijer <fgenfb@yahoo.com>
Improve SIMD support and use it more extensively

Extend and rationalize SIMD primitive functions, adding support for
double vectors, division, more versatilel load/store.

Add SIMD functions for calculating the dot product of an array of
vectors with a single constant vector, and optionally count the
number of negative dot products.

Use SIMD during geometry scissors region calculation (screen projection
calculation).

Use SIMD during frustum calculation.

Signed-off-by: Harm Hanemaaijer <fgenfb@yahoo.com>
Split off SIMD primitives header file and extend SIMD primitives

Split off the platform-specific SIMD primitive implementation into
sreSIMDPlatform.h and extend the amount of primitives supported,
with some support for new data types (such as double and int64).

sreSIMDPlaform.h can be used a unified SIMD interface seperately
from the SRE library. Some matrix multiplication primitives, as
well as various functions to calculate dot products are provided.

SRE-specific SIMD functions that operate of data types defined in
sreVectorMath.h, such as Vector3D, Matrix4D etc remain in sre_simd.h.

Signed-off-by: Harm Hanemaaijer <fgenfb@yahoo.com>
Provide both inline and non-inline SIMD library functions

Provide inline and non-inline definitions of each higher level
SIMD library function (matrix multiplication, dot products etc).
Non-inline definitions are seperated into sreSIMD.cpp.

The inline functions are marked with gcc's always_inline
attribute.

Signed-off-by: Harm Hanemaaijer <fgenfb@yahoo.com>
Move class for SIMD matrix multiplication into indepedent header

Move the class for SIMD matrix multiplication with one of more
vectors into sreSIMDPlatform.h in a way that is independent of SRE
or the vector types defined in sreVectorMath.h. In sre_simd.h,
a similar class for SRE vector types such as Vector4D a
derived from the corresponding class in sreSIMDPlatform.h

Signed-off-by: Harm Hanemaaijer <fgenfb@yahoo.com>
Fix library order in pkgconfig configuration

Signed-off-by: Harm Hanemaaijer <fgenfb@yahoo.com>
Add double-precision vector and matrix classes

Add double-precision versions of Vector3D, Point3D and Matrix3D
classes. Add new file sreDoubleMath.h.

Correct order of argument names for Matrix3d::Get.

Signed-off-by: Harm Hanemaaijer <fgenfb@yahoo.com>
Tweak physics control object velocity handling

Signed-off-by: Harm Hanemaaijer <fgenfb@yahoo.com>