| Summary: | Android app crashes when touch the screen | ||
|---|---|---|---|
| Product: | SDL | Reporter: | wuhao <gfphoenix> |
| Component: | events | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | sylvain.becker |
| Version: | 2.0.8 | ||
| Hardware: | ARM | ||
| OS: | Android (All) | ||
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 |
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"