We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4172 - Android app crashes when touch the screen
Summary: Android app crashes when touch the screen
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: 2.0.8
Hardware: ARM Android (All)
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-22 12:14 UTC by wuhao
Modified: 2019-08-22 08:16 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wuhao 2018-05-22 12:14:35 UTC
int main(int argc, char *argv[])
{
    SDL_Window* window = 0;
    SDL_GLContext gl = 0;

    if(0 != SDL_Init(SDL_INIT_VIDEO))
    {
      fprintf(stderr,"\nUnable to initialize SDL: %s\n",SDL_GetError());
      return 1;
    }

    //printing a string
    const char *s = "This is on stl :: string";
    SDL_Log("%s \n", s);

    Graphics* graphics;
    graphics = new Graphics();

    SDL_LogSetAllPriority(SDL_LOG_PRIORITY_VERBOSE);

    SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION,2);
    SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER,1);

    SDL_DisplayMode mode;
    SDL_GetDisplayMode(0,0,&mode);
    int width = mode.w;
    int height = mode.h;

    SDL_Log("Width = %d, Heigh = %d. \n",width,height);

    SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL,1);
    SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER,1);
    SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE,24);

    window = SDL_CreateWindow("COLORED SCREEN",0,0,width,height,SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN | SDL_WINDOW_RESIZABLE);

    if(window == 0)
    {
        SDL_Log("Failed to create window.");
        SDL_Quit();
        return 1;
    }

gl = SDL_GL_CreateContext(window);

    /*Main Render Loop*/
    Uint8 done = 0;
    SDL_Event event;
    int count = 0;
    while(!done)
    {
        /*Check for events*/
        while(SDL_PollEvent(&event))
        {
            if(event.type == SDL_QUIT || event.type == SDL_KEYDOWN || event.type == SDL_FINGERDOWN)
            {
                done = 1;
            }
        }

        SDL_Log("%d\n",count++);

        graphics->update();

        SDL_GL_SwapWindow(window);
        SDL_Delay(1000);
    }

    exit(0);
}

when I touch the screen, it log error "D/SDL/ERROR: ERROR: NumPoints = 0"
Comment 1 Sylvain 2019-08-22 08:16:53 UTC
Fixed in: https://hg.libsdl.org/SDL/rev/1e4d6b83f946

remove logging Gesture error "NumPoints = 0"
- not necessary when app isn't recording gesture.
- happen when gesture path has less than 2 different points