void glesRotated( double a, double b, double c, double d )
{
- Matrix m;
Quaternion q;
- q.RotationAxis({(float)b,(float)-c,(float)d}, a );
+ Matrix m, r;
+
+ q.RotationAxis({(float)b,(float)c,(float)-d}, a );
m.RotationQuaternion(q);
- matrixStack[curStack][matrixIndex[curStack]].Rotate(q);
+ r.Multiply(m, matrixStack[curStack][matrixIndex[curStack]]);
+ matrixStack[curStack][matrixIndex[curStack]] = r;
LoadCurMatrix();
}
void glesScaled( double a, double b, double c )
void glesMatrixMode(int mode)
{
- curStack = mode == GL_MODELVIEW ? 0 : mode == GL_PROJECTION ? 1 : 2;
+ curStack = (mode == GL_MODELVIEW) ? 0 : (mode == GL_PROJECTION) ? 1 : 2;
glMatrixMode(mode);
}
#endif
}
-void GLBufferData(int type, GLenum target, int size, const GLvoid *data, GLenum usage)
+public void GLVertexPointer(int numCoords, int glType, int stride, void *pointer, int numVertices)
+{
+#ifdef __ANDROID__
+ if(type == GL_DOUBLE)
+ glesVertexPointerd(numCoords, stride, pointer, numVertices);
+ else if(type == GL_UNSIGNED_INT)
+ glesVertexPointeri(numCoords, stride, pointer, numVertices);
+ else
+#endif
+ glVertexPointer(numCoords, glType, stride, pointer);
+}
+
+public void GLBufferData(int type, GLenum target, int size, const GLvoid *data, GLenum usage)
{
#ifdef __ANDROID__
if(type == GL_DOUBLE)
glBindTexture(GL_TEXTURE_2D, glBitmap);
glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, mipMaps ? GL_LINEAR_MIPMAP_LINEAR : GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, mipMaps ? GL_LINEAR_MIPMAP_LINEAR : GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
result = true;
- for(level = 0; result && (w > 1 || h > 1); level++, w >>= 1, h >>= 1)
+ for(level = 0; result && (w >= 1 || h >= 1); level++, w >>= 1, h >>= 1)
{
Bitmap mipMap;
+ if(!w) w = 1;
+ if(!h) h = 1;
if(bitmap.width != w || bitmap.height != h)
{
mipMap = Bitmap { };