0

glCheckError: 0501 在 /Users/mac/Documents/PhotoFrameApp/PhotoFrameApp/Debug.c:177 捕获

知道这个错误可能是什么吗?

这是一个调试错误,我尝试使用 Apple 的 GLImageProcessing 示例实现 OpenGL 以增加、降低 UIImage 的亮度、对比度等。该应用程序不会崩溃,但它也不起作用。

View 有一个 UITabbar 包含不同的效果,如亮度、对比度、色调等,以及一个用于增加或减少它们的 UISlider。

实现的代码是: -

int b, i;
tabBar.selectedItem = [tabBar.items objectAtIndex:0];
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGContextRef context = CGBitmapContextCreate(nil, 30, 30, 8, 0, colorSpace, kCGImageAlphaPremultipliedFirst);
CGImageRef theCGImage = imageCollage.image.CGImage;

// Draw with white round strokes
CGContextSetLineCap(context, kCGLineCapRound);
CGContextSetRGBStrokeColor(context, 1.0, 1.0, 1.0, 1.0);
CGContextSetRGBFillColor(context, 1.0, 1.0, 1.0, 1.0);
CGContextSetLineWidth(context, 2.0);

for (b = 0; b < NUM_BUTTONS; b++)
{
    CGContextClearRect(context, CGRectMake(0, 0, 30, 30));

    switch(b)
    {
        case BUTTON_BRIGHTNESS:
        {
            const CGFloat line[8*4] = {
                15.0, 6.0, 15.0, 4.0,
                15.0,24.0, 15.0,26.0,
                6.0,15.0,  4.0,15.0,
                24.0,15.0, 26.0,15.0,
                21.5,21.5, 23.0,23.0,
                8.5, 8.5,  7.0, 7.0,
                21.5, 8.5, 23.0, 7.0,
                8.5,21.5,  7.0,23.0,                    
            };

            // A circle with eight rays around it
            CGContextStrokeEllipseInRect(context, CGRectMake(10.5, 10.5, 9.0, 9.0));
            for (i = 0; i < 8; i++)
            {
                CGContextMoveToPoint(context, line[i*4+0], line[i*4+1]);
                CGContextAddLineToPoint(context, line[i*4+2], line[i*4+3]);
                CGContextStrokePath(context);                   
            }
            break;
        }
- (void)sliderAction:(id)sender{
// Redraw the view with the new settings
obj = [[EAGLView alloc]init];
[obj drawView];}

- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item{
// Recenter the slider (this application does not accumulate multiple filters)
//slider setValue:1.0 animated:YES];
// Redraw the view with the new settings
[obj drawView];}
4

0 回答 0