docs/README-winrt.md
changeset 9143 b664273a455c
parent 9141 8a6af8841969
child 9149 e910a192f68f
     1.1 --- a/docs/README-winrt.md	Sun Sep 14 19:44:53 2014 +0200
     1.2 +++ b/docs/README-winrt.md	Tue Sep 16 23:09:32 2014 +0200
     1.3 @@ -225,41 +225,39 @@
     1.4  source file, such as, "main.cpp".
     1.5  6. click on the Add button.  This will close the dialog, add the new file to 
     1.6  your project, and open the file in Visual C++'s text editor.
     1.7 -7. Copy and paste the following code into the new file (minus the , then save 
     1.8 -it.
     1.9 +7. Copy and paste the following code into the new file, then save it.
    1.10  
    1.11 -```
    1.12 -#include <SDL.h>
    1.13  
    1.14 -int main(int argc, char **argv)
    1.15 -{
    1.16 -    SDL_DisplayMode mode;
    1.17 -    SDL_Window * window = NULL;
    1.18 -    SDL_Renderer * renderer = NULL;
    1.19 -    SDL_Event evt;
    1.20 +    #include <SDL.h>
    1.21      
    1.22 -    if (SDL_Init(SDL_INIT_VIDEO) != 0) {
    1.23 -        return 1;
    1.24 -    }
    1.25 +    int main(int argc, char **argv)
    1.26 +    {
    1.27 +        SDL_DisplayMode mode;
    1.28 +        SDL_Window * window = NULL;
    1.29 +        SDL_Renderer * renderer = NULL;
    1.30 +        SDL_Event evt;
    1.31 +    
    1.32 +        if (SDL_Init(SDL_INIT_VIDEO) != 0) {
    1.33 +            return 1;
    1.34 +        }
    1.35      
    1.36 -    if (SDL_GetCurrentDisplayMode(0, &mode) != 0) {
    1.37 -        return 1;
    1.38 -    }
    1.39 +        if (SDL_GetCurrentDisplayMode(0, &mode) != 0) {
    1.40 +            return 1;
    1.41 +        }
    1.42      
    1.43 -    if (SDL_CreateWindowAndRenderer(mode.w, mode.h, SDL_WINDOW_FULLSCREEN, &window, &renderer) != 0) {
    1.44 -        return 1;
    1.45 -    }
    1.46 +        if (SDL_CreateWindowAndRenderer(mode.w, mode.h, SDL_WINDOW_FULLSCREEN, &window, &renderer) != 0) {
    1.47 +            return 1;
    1.48 +        }
    1.49      
    1.50 -    while (1) {
    1.51 -        while (SDL_PollEvent(&evt)) {
    1.52 +        while (1) {
    1.53 +            while (SDL_PollEvent(&evt)) {
    1.54 +            }
    1.55 +    
    1.56 +            SDL_SetRenderDrawColor(renderer, 0, 255, 0, 255);
    1.57 +            SDL_RenderClear(renderer);
    1.58 +            SDL_RenderPresent(renderer);
    1.59          }
    1.60 -        
    1.61 -        SDL_SetRenderDrawColor(renderer, 0, 255, 0, 255);
    1.62 -        SDL_RenderClear(renderer);
    1.63 -        SDL_RenderPresent(renderer);
    1.64      }
    1.65 -}
    1.66 -```
    1.67  
    1.68  
    1.69  #### 6.B. Adding code and assets ####