OpenGL error 0x0502 in -[CCSprite draw] 530

我的梦境 提交于 2020-01-05 08:12:32

问题


I am using cocos2d 2.0. Here on one scene where i load data in tableview i get error saying "OpenGL error 0x0502 in -[CCSprite draw] 530" in log window. App runs well

I searched and i realised there are some shader files missing. I have made sure all my files are there and compile sources are also up to date.

But on on link i got some solution saying Well I don't know which draw function to modify and whats wrong with my cocos2d files. Is there any way to solve this issue? Can this crash my app in the future?

My Code:

    -(id) init
    {

if( (self=[super init] )) {

    CGSize winSize = [CCDirector sharedDirector].winSize;
    tableView = [SWTableView viewWithDataSource:self size:winSize];

    tableView.direction = SWScrollViewDirectionVertical;
    tableView.position = ccp(0,0);
    tableView.delegate = self;
    tableView.verticalFillOrder = SWTableViewFillTopDown;
     [self addChild:tableView];
     }
     return self;
     }

    -(SWTableViewCell *)table:(SWTableView *)table cellAtIndex:(NSUInteger)idx {


     SWTableViewCell *cell = [table dequeueCell];
     if (!cell) {
     cell = [[MyCell new] autorelease];
     }

    CCMenuItemImage * listItemBtn =[CCMenuItemImage itemWithNormalImage:@"        listitem.png" selectedImage:@"listitem_sel.png" ];

     listItemBtn.position=ccp(270, 20);
     [cell addChild:listItemBtn];

     return cell;

     }

回答1:


Cocos2d 2.0 uses OpenGLES2.0, so do not use OpenGL immediate mode api in cocos2d 2.0.

Example:GLBegin(), GLLineWidth(), glDrawArrays() etc.



来源:https://stackoverflow.com/questions/15632690/opengl-error-0x0502-in-ccsprite-draw-530

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!