utils/finderrors.c
changeset 904 5989f0d4185a
parent 901 a9f799b93150
child 956 7888858a6777
equal deleted inserted replaced
903:c5cb0a6381fe 904:5989f0d4185a
    16 
    16 
    17 #include "mojoshader.h"
    17 #include "mojoshader.h"
    18 
    18 
    19 #if FINDERRORS_COMPILE_SHADERS
    19 #if FINDERRORS_COMPILE_SHADERS
    20 #include "SDL.h"
    20 #include "SDL.h"
       
    21 static void *lookup(const char *fnname, void *unused)
       
    22 {
       
    23     (void) unused;
       
    24     return SDL_GL_GetProcAddress(fnname);
       
    25 } // lookup
    21 #endif
    26 #endif
    22 
    27 
    23 #ifdef _MSC_VER
    28 #ifdef _MSC_VER
    24 #define WIN32_LEAN_AND_MEAN 1
    29 #define WIN32_LEAN_AND_MEAN 1
    25 #include <windows.h>
    30 #include <windows.h>
   190 
   195 
   191         #if FINDERRORS_COMPILE_SHADERS
   196         #if FINDERRORS_COMPILE_SHADERS
   192         SDL_Init(SDL_INIT_VIDEO);
   197         SDL_Init(SDL_INIT_VIDEO);
   193         SDL_GL_LoadLibrary(NULL);
   198         SDL_GL_LoadLibrary(NULL);
   194         SDL_SetVideoMode(640, 480, 0, SDL_OPENGL);
   199         SDL_SetVideoMode(640, 480, 0, SDL_OPENGL);
   195         printf("Best profile is '%s'\n", MOJOSHADER_glBestProfile(SDL_GL_GetProcAddress));
   200         printf("Best profile is '%s'\n", MOJOSHADER_glBestProfile(lookup, 0));
   196         MOJOSHADER_glContext *ctx;
   201         MOJOSHADER_glContext *ctx;
   197         ctx = MOJOSHADER_glCreateContext(profile, SDL_GL_GetProcAddress, 0, 0, 0);
   202         ctx = MOJOSHADER_glCreateContext(profile, lookup, 0, 0, 0, 0);
   198         if (ctx == NULL)
   203         if (ctx == NULL)
   199         {
   204         {
   200             printf("MOJOSHADER_glCreateContext() fail: %s\n", MOJOSHADER_glGetError());
   205             printf("MOJOSHADER_glCreateContext() fail: %s\n", MOJOSHADER_glGetError());
   201             SDL_Quit();
   206             SDL_Quit();
   202             return 1;
   207             return 1;