···1515 $(SDL_GPU_DIR)/src/SDL_gpu_shapes.c \
1616 $(SDL_GPU_DIR)/src/renderer_GLES_1.c \
1717 $(SDL_GPU_DIR)/src/renderer_GLES_2.c \
1818+ $(SDL_GPU_DIR)/src/renderer_GLES_3.c \
1819 $(STB_IMAGE_DIR)/stb_image.c \
1920 $(STB_IMAGE_DIR)/stb_image_write.c
202121222223LOCAL_CFLAGS += -DSDL_GPU_DISABLE_OPENGL -DSTBI_FAILURE_USERMSG -O3
2323-#LOCAL_LDLIBS += -llog -lGLESv1_CM
2424-LOCAL_LDLIBS += -llog -lGLESv2 -lGLESv1_CM
2424+2525+LOCAL_LDLIBS += -llog -lGLESv1_CM
2626+LOCAL_LDLIBS += -lGLESv2
2727+2828+# Disable GLES version 3 support for now, since some environments aren't set up for it yet
2929+# Enable it if you want it!
3030+LOCAL_CFLAGS += -DSDL_GPU_DISABLE_GLES_3
3131+#LOCAL_LDLIBS += -lGLESv3
25322633LOCAL_SHARED_LIBRARIES := SDL2
2734
+53-4
include/SDL_gpu.h
···362362363363 /*! Perspective and object viewing transforms. */
364364 GPU_Camera camera;
365365+ Uint8 use_camera;
365366366367 /*! Renderer context data. NULL if the target does not represent a window or rendering context. */
367368 GPU_Context* context;
···902903 * \return The old camera. */
903904DECLSPEC GPU_Camera SDLCALL GPU_SetCamera(GPU_Target* target, GPU_Camera* cam);
904905906906+/*! Enables or disables using the built-in camera matrix transforms. */
907907+DECLSPEC void SDLCALL GPU_EnableCamera(GPU_Target* target, Uint8 use_camera);
908908+909909+/*! Returns 1 if the camera transforms are enabled, 0 otherwise. */
910910+DECLSPEC Uint8 SDLCALL GPU_IsCameraEnabled(GPU_Target* target);
911911+905912/*! \return The RGBA color of a pixel. */
906913DECLSPEC SDL_Color SDLCALL GPU_GetPixel(GPU_Target* target, Sint16 x, Sint16 y);
907914···10871094/*! \ingroup Matrix
10881095 * @{ */
1089109610971097+// Basic vector operations (3D)
10981098+10991099+/*! Returns the magnitude (length) of the given vector. */
11001100+DECLSPEC float SDLCALL GPU_VectorLength(float* vec3);
11011101+11021102+/*! Modifies the given vector so that it has a new length of 1. */
11031103+DECLSPEC void SDLCALL GPU_VectorNormalize(float* vec3);
11041104+11051105+/*! Returns the dot product of two vectors. */
11061106+DECLSPEC float SDLCALL GPU_VectorDot(float* A, float* B);
11071107+11081108+/*! Performs the cross product of vectors A and B (result = A x B). Do not use A or B as 'result'. */
11091109+DECLSPEC void SDLCALL GPU_VectorCross(float* result, float* A, float* B);
11101110+11111111+/*! Overwrite 'result' vector with the values from vector A. */
11121112+DECLSPEC void SDLCALL GPU_VectorCopy(float* result, float* A);
11131113+11141114+/*! Multiplies the given matrix into the given vector (vec3 = matrix*vec3). */
11151115+DECLSPEC void SDLCALL GPU_VectorApplyMatrix(float* vec3, float* matrix_4x4);
11161116+11171117+1090111810911119// Basic matrix operations (4x4)
1092112010931093-/*! Copy matrix A to the given 'result' matrix. */
11211121+/*! Overwrite 'result' matrix with the values from matrix A. */
10941122DECLSPEC void SDLCALL GPU_MatrixCopy(float* result, const float* A);
1095112310961124/*! Fills 'result' matrix with the identity matrix. */
10971125DECLSPEC void SDLCALL GPU_MatrixIdentity(float* result);
1098112611271127+/*! Multiplies an orthographic projection matrix into the given matrix. */
11281128+DECLSPEC void SDLCALL GPU_MatrixOrtho(float* result, float left, float right, float bottom, float top, float near, float far);
11291129+11301130+/*! Multiplies a perspective projection matrix into the given matrix. */
11311131+DECLSPEC void SDLCALL GPU_MatrixFrustum(float* result, float left, float right, float bottom, float top, float near, float far);
11321132+11331133+/*! Multiplies a perspective projection matrix into the given matrix. */
11341134+DECLSPEC void SDLCALL GPU_MatrixPerspective(float* result, float fovy, float aspect, float zNear, float zFar);
11351135+11361136+/*! Multiplies a view matrix into the given matrix. */
11371137+DECLSPEC void SDLCALL GPU_MatrixLookAt(float* matrix, float eye_x, float eye_y, float eye_z, float target_x, float target_y, float target_z, float up_x, float up_y, float up_z);
11381138+11391139+/*! Adds a translation into the given matrix. */
11401140+DECLSPEC void SDLCALL GPU_MatrixTranslate(float* result, float x, float y, float z);
11411141+11421142+/*! Multiplies a scaling matrix into the given matrix. */
11431143+DECLSPEC void SDLCALL GPU_MatrixScale(float* result, float sx, float sy, float sz);
11441144+11451145+/*! Multiplies a rotation matrix into the given matrix. */
11461146+DECLSPEC void SDLCALL GPU_MatrixRotate(float* result, float degrees, float x, float y, float z);
11471147+10991148/*! Multiplies matrices A and B and stores the result in the given 'result' matrix (result = A*B). Do not use A or B as 'result'.
11001149 * \see GPU_MultiplyAndAssign
11011150*/
11021151DECLSPEC void SDLCALL GPU_Multiply4x4(float* result, float* A, float* B);
1103115211041104-/*! Multiplies matrices 'result' and A and stores the result in the given 'result' matrix (result = result * A). */
11051105-DECLSPEC void SDLCALL GPU_MultiplyAndAssign(float* result, float* A);
11531153+/*! Multiplies matrices 'result' and B and stores the result in the given 'result' matrix (result = result * B). */
11541154+DECLSPEC void SDLCALL GPU_MultiplyAndAssign(float* result, float* B);
110611551107115611081157// Matrix stack accessors
···11411190DECLSPEC void SDLCALL GPU_Ortho(float left, float right, float bottom, float top, float near, float far);
1142119111431192/*! Multiplies a perspective projection matrix into the current matrix. */
11441144-DECLSPEC void SDLCALL GPU_Frustum(float right, float left, float bottom, float top, float near, float far);
11931193+DECLSPEC void SDLCALL GPU_Frustum(float left, float right, float bottom, float top, float near, float far);
1145119411461195/*! Adds a translation into the current matrix. */
11471196DECLSPEC void SDLCALL GPU_Translate(float x, float y, float z);