Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7845843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:22:52+00:00 2026-06-02T17:22:52+00:00

About the app: Custom openGL map constructed by tiles with function of drawing overlays

  • 0

About the app: Custom openGL map constructed by tiles with function of drawing overlays on top of base map. The app is universal for both iPad and iPhone.
Some overlays are tile based, which are working totally fine. Some are made of circles, drawn at particular coordinates on the map. Where clicking on a circle opens a popover view with information about this particular point on the map. On iphone library WEPopover used to implement functionality similar to UIPopoverViewController.

The problem occurs only on iphone and only on device. when overlay consist of large amount of circles, opening popover view with info sometimes causes a blink in the overlay and eventually EXC_BAD_ACCESS crash on the line: glDrawArrays(GL_LINE_LOOP, 0, 360);
This only happens on iphone and never on ipad or simulator.

Little bit of code:

drawing black circles with white outline:

  for (int i = [pointsArray count]-1; i >= 0; i--) {
       int pinColor = 0xffff0000;

       static GLfloat vertices[720];

         for (int i = 0; i < 720; i += 2) {
         vertices[i]   = (cos(DEGREES_TO_RADIANS(i)) * scale * 1.5);
         vertices[i+1] = (sin(DEGREES_TO_RADIANS(i)) * scale * 1.5);
         }

        glVertexPointer(2, GL_FLOAT, 0, vertices);

        glEnableClientState(GL_VERTEX_ARRAY);
        glEnableClientState(GL_TEXTURE_COORD_ARRAY);
        glEnable(GL_BLEND);
        glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

        for (int dx = x0; dx <= x1; dx++)
        {
            glPushMatrix();

            GLubyte a = (pinColor >> 24) & 0xff;
            a = MIN((GLubyte) (opacity * 255), a);
            glColor4ub(0, 0, 0, a);

            GLfloat xx = point.x - centerX + dx * mapWidth;
            xx *= zoom;
            glTranslatef(xx, yy, 0);

            glDrawArrays(GL_TRIANGLE_FAN, 0, 360); <-----sometimes crash here

            int color = 0xffffffff;

            GLubyte n = (color >> 24) & 0xff;
            GLubyte r = (color >> 16) & 0xff;
            GLubyte g = (color >> 8) & 0xff;
            GLubyte b = (color >> 0) & 0xff;
            n = MIN((GLubyte) (opacity * 255), n);
            glColor4ub(r,g,b,n);

            glLineWidth(1);
            glDrawArrays(GL_LINE_LOOP, 0, 360); <------crash here
            glLineWidth(1);


            glPopMatrix();

        }

        glDisable(GL_BLEND);
        glDisableClientState(GL_VERTEX_ARRAY);
        glDisableClientState(GL_TEXTURE_COORD_ARRAY);

        glVertexPointer(2, GL_FLOAT, 0, 0);
  }

Opening popover on iphone:

    WEPopoverController *_popover = [[WEPopoverController alloc] initWithContentViewController:pointDetails];
            _popover.popoverContentSize = pointDetails.view.frame.size;

            if ([[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeLeft || [[UIDevice currentDevice] orientation] ==  UIDeviceOrientationLandscapeRight) 
            {

                CGRect myrect2 = CGRectMake(xx,yy, 1, 1);
                [_popover presentPopoverFromRect:myrect2 inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];

            } else {

                CGRect myrect2 = CGRectMake(xx, yy, 1, 1);
                [_popover presentPopoverFromRect:myrect2 inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
            }
            self.detailsPopIphone = _popover;
            [_popover release];    

every time you touch the screen (move scale the map, open popover) openGL map being re-rendered.

I will be happy to provide any additional information or code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T17:22:54+00:00Added an answer on June 2, 2026 at 5:22 pm

    Fixed this issue.
    The problem was that rendering of the openGL overlay an animation of the WEPopover were happening simultaneously, what was causing a conflict. Organizing the code the way that rendering and animation happens one after another fixed the problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am asked about custom app stores a lot by clients. Is it feasible
This is about an iPhone App using MKMapKit: I created a custom MKAnnotationView for
This is about an iPhone App using MKMapKit: I created a custom MKAnnotationView for
I've searching about using custom maps (for example: a campus university map) in the
I am just learning about app.config in respect of creating custom sections. I have
I am have a custom keyboard app, and I get this LogCat output about
I am making app about google documents. but I don't know How to save
We have about 7 app servers running .NET windows services that ping a single
The question is about Google App Engine Backend. How do I find out the
I have a question about my app submission to itunes. My app using 256

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.