utils/availableprofiles.c
changeset 1134 be31bd0ee0a2
parent 1117 f6712bf72c19
equal deleted inserted replaced
1133:eb1eb43987b3 1134:be31bd0ee0a2
    52     printf("Compiled against changeset %s\n", MOJOSHADER_CHANGESET);
    52     printf("Compiled against changeset %s\n", MOJOSHADER_CHANGESET);
    53     printf("Linked against changeset %s\n", MOJOSHADER_changeset());
    53     printf("Linked against changeset %s\n", MOJOSHADER_changeset());
    54     printf("\n");
    54     printf("\n");
    55     #endif
    55     #endif
    56 
    56 
       
    57     SDL_Window *sdlwindow = NULL;
    57     if (SDL_Init(SDL_INIT_VIDEO) == -1)
    58     if (SDL_Init(SDL_INIT_VIDEO) == -1)
    58         fprintf(stderr, "SDL_Init(SDL_INIT_VIDEO) error: %s\n", SDL_GetError());
    59         fprintf(stderr, "SDL_Init() error: %s\n", SDL_GetError());
       
    60     else if (SDL_GL_LoadLibrary(NULL) == -1)
       
    61         fprintf(stderr, "SDL_GL_LoadLibrary() error: %s\n", SDL_GetError());
       
    62     else if ((sdlwindow = SDL_CreateWindow(argv[0], SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_OPENGL)) == NULL)
       
    63         fprintf(stderr, "SDL_CreateWindow() error: %s\n", SDL_GetError());
       
    64     else if (SDL_GL_CreateContext(sdlwindow) == NULL)
       
    65         fprintf(stderr, "SDL_GL_CreateContext() error: %s\n", SDL_GetError());
    59     else
    66     else
    60     {
    67         retval = check_available();
    61         SDL_GL_LoadLibrary(NULL);
       
    62         if (SDL_SetVideoMode(640, 480, 0, SDL_OPENGL) == NULL)
       
    63             fprintf(stderr, "SDL_SetVideoMode() error: %s\n", SDL_GetError());
       
    64         else
       
    65             retval = check_available();
       
    66         SDL_Quit();
       
    67     } // else
       
    68 
    68 
       
    69     SDL_Quit();
    69     return retval;
    70     return retval;
    70 } // main
    71 } // main
    71 
    72 
    72 // end of availableprofiles.c ...
    73 // end of availableprofiles.c ...
    73 
    74