a question block me! about "CGPoint a = [[CCDirector sharedDirector] convertToGL:[touch previousLocationInView:touch.view]];"

hello everybody:

i meet this question:

CGPoint a = [[CCDirector sharedDirector] convertToGL:[touch previousLocationInView:touch.view]];
CGPoint b = [[CCDirector sharedDirector] convertToGL:[touch locationInView:touch.view]];

i use c*+ instead:
so i write in this:
CCPoint a = touch~~>locationInView);
a = CCDirector::sharedDirector~~>convertToGL;
CCPoint b = touch~~>previousLocationInView);
b = CCDirector::sharedDirector~~>convertToGL;

did it right?
i find a bug in my code, when i use the prerious code , i am right,
but when i use the second code, i am wrong?
can anybody tell me?

this the entir code,
"
~~ ccTouchBegan:touch withEvent:event
{
isDragging = YES;
return TRUE;
}
~~ ccTouchMoved:touch withEvent:event
{
CGPoint a = convertToGL:];
CGPoint b = convertToGL:];
CGPoint nowPosition = ;
nowPosition.y*= ( b.y - a.y );
[scrollLayer setPosition:nowPosition];
}

~~ccTouchEnded:touch withEvent:event
{
isDragging = NO;
}
~~(void) ccTouchCancelled:(UITouch *)touch withEvent:(UIEvent *)event
{
}

"

and i translate it to cocos2d-x

void Social::registerWithTouchDispatcher()
{
CCTouchDispatcher::sharedDispatcher()>addTargetedDelegate;
}
bool Social::ccTouchBegan
{
isDragging = true;
return true;
}
void Social::ccTouchEnded
{
isDragging = false;
}
void Social::ccTouchCancelled
{
}
void Social::ccTouchMoved
{
CCPoint a = touch
>locationInView(touch~~>view);
CCDirector::sharedDirector~~>convertToGL;
CCPoint b = touch~~>previousLocationInView);
CCDirector::sharedDirector~~>convertToGL;
CCPoint newpos = scrollLayer~~>getPosition;
newpos.y += ;
scrollLayer~~>setPosition(newpos);
}

want somebody help me. :slight_smile:
thanks.

i have got it… it ’s mistake… i am sorry…:slight_smile: