test/testdyngl.c
changeset 842 0eec9985767d
parent 839 7b255f0290da
child 847 0afe0e38e02c
equal deleted inserted replaced
841:d114cfaa0b0f 842:0eec9985767d
    87 	glfuncs f;
    87 	glfuncs f;
    88 	int i;
    88 	int i;
    89 	SDL_Event event;
    89 	SDL_Event event;
    90 	int done=0;
    90 	int done=0;
    91 	GLfloat pixels[NB_PIXELS*3];
    91 	GLfloat pixels[NB_PIXELS*3];
    92 	char default_gl_lib[]="/usr/lib/libGL.so";
    92 #ifdef _WIN32
    93 	char* current_gl_lib=default_gl_lib;
    93 	char *gl_library = "OpenGL32.DLL";
       
    94 #else
       
    95 	char *gl_library = "libGL.so.1";
       
    96 #endif
    94 	
    97 	
    95 	if (argc==2)
    98 	if (argv[1]) {
    96 	{
    99 		gl_library = argv[1];
    97 		current_gl_lib=argv[1];
       
    98 	}
   100 	}
    99 	
   101 	
   100 	if (SDL_Init(SDL_INIT_EVERYTHING)<0)
   102 	if (SDL_Init(SDL_INIT_VIDEO)<0)
   101 	{
   103 	{
   102 		printf("Unable to init SDL : %s\n",SDL_GetError());
   104 		printf("Unable to init SDL : %s\n",SDL_GetError());
   103 		exit(1);
   105 		exit(1);
   104 	}
   106 	}
   105 	
   107 	
   107 	{
   109 	{
   108 		printf("Unable to set GL attribute : %s\n",SDL_GetError());
   110 		printf("Unable to set GL attribute : %s\n",SDL_GetError());
   109 		exit(1);
   111 		exit(1);
   110 	}
   112 	}
   111 	
   113 	
   112 	if (SDL_GL_LoadLibrary(current_gl_lib)<0)
   114 	if (SDL_GL_LoadLibrary(gl_library)<0)
   113 	{
   115 	{
   114 		printf("Unable to dynamically open GL lib : %s\n",SDL_GetError());
   116 		printf("Unable to dynamically open GL lib : %s\n",SDL_GetError());
   115 		exit(1);
   117 		exit(1);
   116 	}
   118 	}
   117 
   119