src/render/opengles2/SDL_render_gles2.c
changeset 12159 f7398cb0e3bf
parent 12156 e5a666405750
child 12164 8b71c22d6714
equal deleted inserted replaced
12158:ee7f3955c9fb 12159:f7398cb0e3bf
  1879 
  1879 
  1880     data->glEnableVertexAttribArray(GLES2_ATTRIBUTE_CENTER);
  1880     data->glEnableVertexAttribArray(GLES2_ATTRIBUTE_CENTER);
  1881     data->glEnableVertexAttribArray(GLES2_ATTRIBUTE_ANGLE);
  1881     data->glEnableVertexAttribArray(GLES2_ATTRIBUTE_ANGLE);
  1882 
  1882 
  1883     radian_angle = PI * (360.0f - angle) / 180.f;
  1883     radian_angle = PI * (360.0f - angle) / 180.f;
  1884     fAngle[0] = fAngle[2] = fAngle[4] = fAngle[6] = (GLfloat)sin(radian_angle);
  1884     fAngle[0] = fAngle[2] = fAngle[4] = fAngle[6] = (GLfloat)SDL_sin(radian_angle);
  1885     /* render expects cos value - 1 (see GLES2_VertexSrc_Default_) */
  1885     /* render expects cos value - 1 (see GLES2_VertexSrc_Default_) */
  1886     fAngle[1] = fAngle[3] = fAngle[5] = fAngle[7] = (GLfloat)cos(radian_angle) - 1.0f;
  1886     fAngle[1] = fAngle[3] = fAngle[5] = fAngle[7] = (GLfloat)SDL_cos(radian_angle) - 1.0f;
  1887     /* Calculate the center of rotation */
  1887     /* Calculate the center of rotation */
  1888     translate[0] = translate[2] = translate[4] = translate[6] = (center->x + dstrect->x);
  1888     translate[0] = translate[2] = translate[4] = translate[6] = (center->x + dstrect->x);
  1889     translate[1] = translate[3] = translate[5] = translate[7] = (center->y + dstrect->y);
  1889     translate[1] = translate[3] = translate[5] = translate[7] = (center->y + dstrect->y);
  1890 
  1890 
  1891     /* Emit the textured quad */
  1891     /* Emit the textured quad */