OpenGL错误0x0502在 - [CCSprite draw] 530 [英] OpenGL error 0x0502 in -[CCSprite draw] 530

查看:706
本文介绍了OpenGL错误0x0502在 - [CCSprite draw] 530的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用cocos2d 2.0。这里在一个场景中,我加载数据在tableview我得到错误说
OpenGL错误0x0502在 - [CCSprite绘制] 530在日志窗口应用运行良好

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.

但是on链接我得到一些解决方案
我不知道我的cocos2d文件修改哪些绘图函数和什么错误。
有没有办法解决这个问题?

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?

我的代码:

    -(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;

     }


推荐答案

Cocos2d 2.0使用OpenGLES2.0,因此请不要使用OpenGL 即时模式 API cocos2d 2.0。

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

示例:GLBegin(),GLLineWidth(),glDrawArrays()等。

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

这篇关于OpenGL错误0x0502在 - [CCSprite draw] 530的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆