1

cocos2d 2.0 を使用しています。ここで、テーブルビューにデータをロードするあるシーンで、ログウィンドウに「-[CCSprite draw] 530 の OpenGL エラー 0x0502」というエラーが表示されます。アプリはよく動く

検索したところ、いくつかのシェーダー ファイルが欠落していることに気付きました。すべてのファイルがそこにあり、コンパイル ソースも最新であることを確認しました。

しかし、リンク上で、 どの描画関数を変更すればよいかわからず、cocos2d ファイルの何が問題なのかという解決策が得られました。この問題を解決する方法はありますか? これにより、将来アプリがクラッシュする可能性はありますか?

私のコード:

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

     }
4

1 に答える 1

1

Cocos2d 2.0 は OpenGLES2.0 を使用するため、cocos2d 2.0 で OpenGL即時モードAPI を使用しないでください。

例:GLBegin()、GLLineWidth()、glDrawArrays()など。

于 2013-03-26T11:16:46.383 に答える