user1160507
user1160507

Reputation:

cocos2d OpenGL error 0x0502 in -[EAGLView swapBuffers]

i have implemented GPUImage framework in my cocos2d project, The GPUImage framework is a BSD-licensed iOS library that lets you apply GPU-accelerated filters and other effects to images, live camera video, and movies.

When i call any one of GPUImage filter, am getting " cocos2d OpenGL error 0x0502 in -[EAGLView swapBuffers] " error.

Do you have any idea what might be the issue in that case?

Thanks and regards, Prakash.

Upvotes: 8

Views: 3897

Answers (2)

Ethan
Ethan

Reputation: 1

I happened to have the same problem. I found the following post useful: iOS and multiple OpenGL views

In my case, cocos2d files don't have necessary "setCurrentContext" commands ,so I added it into CCEAGLView-ios.mm. It solves my problem.

(void) layoutSubviews
{
[renderer_ resizeFromLayer:(CAEAGLLayer*)self.layer];
size_ = [renderer_ backingSize];

[EAGLContext setCurrentContext: context_];
cocos2d::Size size;
size.width = size_.width;
size.height = size_.height;

cocos2d::Director::getInstance()->drawScene();
}

Upvotes: 0

Abhinav
Abhinav

Reputation: 191

I dont know what your code is doing but what i had seen is that some time swap buffer problems come if their is change in orientation of application from the normal orientation.Try to print the size of main view before and after using your code.

Upvotes: 1

Related Questions