Referring to this question :OpenGL ES Fill Effect I am trying to do the samething , but I have Custom UIView , which contains different CGMutuablePath and only drawing is enabled in selected UIView.
I have used GLPaint, PaintingView class and used it as a custom class to even draw different paths, everthing is working fine. except that I need to fill those paths too. When he user want to use a bucket paint effect. As I am using defined CG closed paths, is it possible to fill those paths using EAGLContext . I have tried in many ways to fill it with CGContextRef , but it always end up with "Invalid context" , I guess its not possible to use 2 differnt context in single view.
Can any body help me with this problem? How can I fill my path using EAGLContext ?
It's a bit hard to grasp the problem here without any actual example of your code/app. However, it seems you're trying to fill a stroked path.
Firstly, I don't know why you're suggesting two contexts here? You're drawing
CGMutablePathsusing aCGContextbut you're trying to fill them usingEAGLContext? That's quite a far fetched solution to the problem.EAGLContextis OpenGL ES (usually 3d stuff) andCGContextis Quartz 2D. Unless you have specific reasons to do so, I wouldn't recommend mixing both contexts in a single view without proper application.You say you've tried everything to fill the paths? Which means you've already tried
CGContextEOFillPathandCGContextFillPath? Anyhow, this should work withCGMutablePaths: