Xcode-iPhoneOS/Template/SDL iOS Application/main.c
changeset 5511 be843abc1f6c
parent 5412 279f6853c459
equal deleted inserted replaced
5510:55519e27e5d1 5511:be843abc1f6c
    22 
    22 
    23     Uint8 r, g, b;
    23     Uint8 r, g, b;
    24 
    24 
    25     /* Clear the screen */
    25     /* Clear the screen */
    26     SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
    26     SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
    27     SDL_SetRenderClear(renderer);
    27     SDL_RenderClear(renderer);
    28 
    28 
    29     /*  Come up with a random rectangle */
    29     /*  Come up with a random rectangle */
    30     SDL_Rect rect;
    30     SDL_Rect rect;
    31     rect.w = randomInt(64, 128);
    31     rect.w = randomInt(64, 128);
    32     rect.h = randomInt(64, 128);
    32     rect.h = randomInt(64, 128);
    72         printf("Could not initialize Window\n");
    72         printf("Could not initialize Window\n");
    73         return 1;
    73         return 1;
    74     }
    74     }
    75 
    75 
    76     renderer = SDL_CreateRenderer(window, -1, 0);
    76     renderer = SDL_CreateRenderer(window, -1, 0);
    77     if (renderer) {
    77     if (!renderer) {
    78         printf("Could not create renderer\n");
    78         printf("Could not create renderer\n");
    79         return 1;
    79         return 1;
    80     }
    80     }
    81 
    81 
    82     /* Enter render loop, waiting for user to quit */
    82     /* Enter render loop, waiting for user to quit */