Draw a circle, trying to move it.
The
sfCircleShape_move function must move the object by the given offset. But the movement goes along the coordinates specified in the parameters of this function, or a generally incomprehensible result
sfCircleShape *circle = sfCircleShape_create();
sfCircleShape_setRadius(circle, 20 - 3);
sfCircleShape_setOutlineThickness(circle, 3);
sfCircleShape_setOutlineColor(circle, sfBlack);
sfCircleShape_setFillColor(circle, sfWhite);
sfVector2f CirclePosOld = {800 / 2, 600 / 2};
sfCircleShape_setPosition(circle, CirclePosOld) ;
sfVector2f CirclePosNew = { 50, 50 } ;
sfCircleShape_move(circle, CirclePosNew );
float fPosOld_x = CirclePosOld.x ;
float fPosNew_x = sfCircleShape_getPosition(circle).x ;
float fPosOld_y = CirclePosOld.y ;
float fPosNew_y = sfCircleShape_getPosition(circle).y ;
Result:
Works:
sfVector2f CirclePosOld = {800 / 2, 600 / 2};
sfCircleShape_setPosition(circle, CirclePosOld) ;
sfVector2f CirclePosNew = {CirclePosOld.x + 50, CirclePosOld.y + 50 } ;
sfCircleShape_setPosition(circle, CirclePosNew) ;
It feels like I'm the only one with the problems.