iDev

cocos2d에서 implicit declaration of 'glColor4ub' is invalid in c99 해결방법

KraZYeom 2012. 6. 8. 08:38
반응형

opengl 함수는 아에 모르다보니 그냥 대충 구글링해서 코딩을 (작년에...)했었는데 

오늘 아침 cocos2d 1.0에서 2.0 으로 올리는 과정에서 또 뭔가 

implicit declaration of 'glColor4ub' is invalid in c99

워닝과 함께 화면상에서는 색깔이 표현이 안된다. 털썩. 

cocos2d 함수에 ccDrawColor4B(r, g, b, a); 이라는 훌륭한 메소드가 존재 한다.

수정후 잘되네..요. 

- (void) draw{

    glLineWidth(maxSize.height);

    glColor4ub(255, 255, 255, 255); 

// implicit declaration of 'glColor4ub' is invalid in c99

    ccDrawColor4B(255, 255, 255, 255);

    ccDrawLine(ccp(0, 0), ccp(1, 0));

    ccDrawLine(ccp(maxSize.width / 2 - 1, 0), ccp(maxSize.width / 2, 0 ));

    ccDrawLine(ccp(maxSize.width - 1, 0), ccp(maxSize.width, 0 ));

    

    CGFloat width = currentValue;

    glLineWidth(maxSize.height);

    ccDrawColor4B(0, 0, 255, 255);

    if (currentValue < 0)

        ccDrawLine(ccp(maxSize.width / 2 - 1, 0), ccp(width + maxSize.width / 2, 0));

    else

        ccDrawLine(ccp(maxSize.width / 2, 0), ccp(width + maxSize.width / 2, 0));

    

}


뭔가 오늘 아침은 1년전 삽질 했던것을 다시 재공사 하는 느낌... ㅠㅠ

언어란 안쓰면 다 잊어 버린다. 사람언어던 컴퓨터 언어든. 하루 10분이라도 정말 짧게라도 공부를 하면 잊지 않는다. 나같은 놈에게만 해당될지도. ㅠㅠ 



반응형