utils/glcaps.c
author Ethan Lee <flibitijibibo@flibitijibibo.com>
Tue, 07 Jul 2020 17:44:32 -0400
changeset 1278 be0f548f321f
parent 1135 780e3e4b1d4a
permissions -rw-r--r--
spirv: Fix bogus detection of PSIZE0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
269
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     1
#ifdef _WINDOWS
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     2
#define WIN32_LEAN_AND_MEAN 1
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     3
#include <windows.h>
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     4
#endif
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     5
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     6
#include <stdio.h>
272
951e5cecbd99 Patched to compile on Mac OS X.
Ryan C. Gordon <icculus@icculus.org>
parents: 271
diff changeset
     7
#define GL_GLEXT_LEGACY 1
269
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     8
#include "GL/gl.h"
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     9
#include "GL/glext.h"
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    10
#include "SDL.h"
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    11
277
49a6571cac6d Patched to compile on older (?) GL headers.
Ryan C. Gordon <icculus@icculus.org>
parents: 275
diff changeset
    12
#ifndef WINGDIAPI
49a6571cac6d Patched to compile on older (?) GL headers.
Ryan C. Gordon <icculus@icculus.org>
parents: 275
diff changeset
    13
#define WINGDIAPI
49a6571cac6d Patched to compile on older (?) GL headers.
Ryan C. Gordon <icculus@icculus.org>
parents: 275
diff changeset
    14
#endif
49a6571cac6d Patched to compile on older (?) GL headers.
Ryan C. Gordon <icculus@icculus.org>
parents: 275
diff changeset
    15
275
cd25ba040c5e Whoops, glGetIntegerv() returns void. Cut-and-paste error!
Ryan C. Gordon <icculus@icculus.org>
parents: 274
diff changeset
    16
typedef WINGDIAPI void (APIENTRYP PFNGLGETINTEGERVPROC) (GLenum pname, GLint *params);
269
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    17
typedef WINGDIAPI const GLubyte * (APIENTRYP PFNGLGETSTRINGPROC) (GLenum name);
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    18
271
a9f0f4a1d9a9 Research on GL_EXT_bindable_uniform for future experimentation.
Ryan C. Gordon <icculus@icculus.org>
parents: 269
diff changeset
    19
#ifndef GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT
a9f0f4a1d9a9 Research on GL_EXT_bindable_uniform for future experimentation.
Ryan C. Gordon <icculus@icculus.org>
parents: 269
diff changeset
    20
#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2
a9f0f4a1d9a9 Research on GL_EXT_bindable_uniform for future experimentation.
Ryan C. Gordon <icculus@icculus.org>
parents: 269
diff changeset
    21
#endif
a9f0f4a1d9a9 Research on GL_EXT_bindable_uniform for future experimentation.
Ryan C. Gordon <icculus@icculus.org>
parents: 269
diff changeset
    22
#ifndef GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT
a9f0f4a1d9a9 Research on GL_EXT_bindable_uniform for future experimentation.
Ryan C. Gordon <icculus@icculus.org>
parents: 269
diff changeset
    23
#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3
a9f0f4a1d9a9 Research on GL_EXT_bindable_uniform for future experimentation.
Ryan C. Gordon <icculus@icculus.org>
parents: 269
diff changeset
    24
#endif
a9f0f4a1d9a9 Research on GL_EXT_bindable_uniform for future experimentation.
Ryan C. Gordon <icculus@icculus.org>
parents: 269
diff changeset
    25
#ifndef GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT
a9f0f4a1d9a9 Research on GL_EXT_bindable_uniform for future experimentation.
Ryan C. Gordon <icculus@icculus.org>
parents: 269
diff changeset
    26
#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4
a9f0f4a1d9a9 Research on GL_EXT_bindable_uniform for future experimentation.
Ryan C. Gordon <icculus@icculus.org>
parents: 269
diff changeset
    27
#endif
a9f0f4a1d9a9 Research on GL_EXT_bindable_uniform for future experimentation.
Ryan C. Gordon <icculus@icculus.org>
parents: 269
diff changeset
    28
#ifndef GL_MAX_BINDABLE_UNIFORM_SIZE_EXT
a9f0f4a1d9a9 Research on GL_EXT_bindable_uniform for future experimentation.
Ryan C. Gordon <icculus@icculus.org>
parents: 269
diff changeset
    29
#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED
a9f0f4a1d9a9 Research on GL_EXT_bindable_uniform for future experimentation.
Ryan C. Gordon <icculus@icculus.org>
parents: 269
diff changeset
    30
#endif
a9f0f4a1d9a9 Research on GL_EXT_bindable_uniform for future experimentation.
Ryan C. Gordon <icculus@icculus.org>
parents: 269
diff changeset
    31
1135
780e3e4b1d4a Support OpenGL 3.0 and later.
Ryan C. Gordon <icculus@icculus.org>
parents: 1134
diff changeset
    32
static int is_atleast_gl3(const char *str)
780e3e4b1d4a Support OpenGL 3.0 and later.
Ryan C. Gordon <icculus@icculus.org>
parents: 1134
diff changeset
    33
{
780e3e4b1d4a Support OpenGL 3.0 and later.
Ryan C. Gordon <icculus@icculus.org>
parents: 1134
diff changeset
    34
    int maj, min;
780e3e4b1d4a Support OpenGL 3.0 and later.
Ryan C. Gordon <icculus@icculus.org>
parents: 1134
diff changeset
    35
    sscanf(str, "%d.%d", &maj, &min);
780e3e4b1d4a Support OpenGL 3.0 and later.
Ryan C. Gordon <icculus@icculus.org>
parents: 1134
diff changeset
    36
    return ( ((maj << 16) | min) >= ((3 << 16) | 0) );
780e3e4b1d4a Support OpenGL 3.0 and later.
Ryan C. Gordon <icculus@icculus.org>
parents: 1134
diff changeset
    37
}
271
a9f0f4a1d9a9 Research on GL_EXT_bindable_uniform for future experimentation.
Ryan C. Gordon <icculus@icculus.org>
parents: 269
diff changeset
    38
269
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    39
int main(int argc, char **argv)
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    40
{
1134
be31bd0ee0a2 Moved to SDL2.
Ryan C. Gordon <icculus@icculus.org>
parents: 588
diff changeset
    41
    int retval = 1;
269
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    42
    GLint val = 0;
412
4e275a0788f7 Added test for GLSL version string.
Ryan C. Gordon <icculus@icculus.org>
parents: 277
diff changeset
    43
    const char *str = NULL;
1134
be31bd0ee0a2 Moved to SDL2.
Ryan C. Gordon <icculus@icculus.org>
parents: 588
diff changeset
    44
    SDL_Window *sdlwindow = NULL;
269
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    45
1134
be31bd0ee0a2 Moved to SDL2.
Ryan C. Gordon <icculus@icculus.org>
parents: 588
diff changeset
    46
    if (SDL_Init(SDL_INIT_VIDEO) == -1)
be31bd0ee0a2 Moved to SDL2.
Ryan C. Gordon <icculus@icculus.org>
parents: 588
diff changeset
    47
        fprintf(stderr, "SDL_Init() error: %s\n", SDL_GetError());
be31bd0ee0a2 Moved to SDL2.
Ryan C. Gordon <icculus@icculus.org>
parents: 588
diff changeset
    48
    else if (SDL_GL_LoadLibrary(NULL) == -1)
be31bd0ee0a2 Moved to SDL2.
Ryan C. Gordon <icculus@icculus.org>
parents: 588
diff changeset
    49
        fprintf(stderr, "SDL_GL_LoadLibrary() error: %s\n", SDL_GetError());
be31bd0ee0a2 Moved to SDL2.
Ryan C. Gordon <icculus@icculus.org>
parents: 588
diff changeset
    50
    else if ((sdlwindow = SDL_CreateWindow(argv[0], SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_OPENGL)) == NULL)
be31bd0ee0a2 Moved to SDL2.
Ryan C. Gordon <icculus@icculus.org>
parents: 588
diff changeset
    51
        fprintf(stderr, "SDL_CreateWindow() error: %s\n", SDL_GetError());
be31bd0ee0a2 Moved to SDL2.
Ryan C. Gordon <icculus@icculus.org>
parents: 588
diff changeset
    52
    if (SDL_GL_CreateContext(sdlwindow) == NULL)
be31bd0ee0a2 Moved to SDL2.
Ryan C. Gordon <icculus@icculus.org>
parents: 588
diff changeset
    53
        fprintf(stderr, "SDL_GL_CreateContext() error: %s\n", SDL_GetError());
be31bd0ee0a2 Moved to SDL2.
Ryan C. Gordon <icculus@icculus.org>
parents: 588
diff changeset
    54
    else
be31bd0ee0a2 Moved to SDL2.
Ryan C. Gordon <icculus@icculus.org>
parents: 588
diff changeset
    55
        retval = 0;
be31bd0ee0a2 Moved to SDL2.
Ryan C. Gordon <icculus@icculus.org>
parents: 588
diff changeset
    56
be31bd0ee0a2 Moved to SDL2.
Ryan C. Gordon <icculus@icculus.org>
parents: 588
diff changeset
    57
    if (retval != 0)
be31bd0ee0a2 Moved to SDL2.
Ryan C. Gordon <icculus@icculus.org>
parents: 588
diff changeset
    58
    {
be31bd0ee0a2 Moved to SDL2.
Ryan C. Gordon <icculus@icculus.org>
parents: 588
diff changeset
    59
        SDL_Quit();
be31bd0ee0a2 Moved to SDL2.
Ryan C. Gordon <icculus@icculus.org>
parents: 588
diff changeset
    60
        return retval;
be31bd0ee0a2 Moved to SDL2.
Ryan C. Gordon <icculus@icculus.org>
parents: 588
diff changeset
    61
    } // if
269
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    62
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    63
    PFNGLGETSTRINGPROC pglGetString = (PFNGLGETSTRINGPROC) SDL_GL_GetProcAddress("glGetString");
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    64
    PFNGLGETINTEGERVPROC pglGetIntegerv = (PFNGLGETINTEGERVPROC) SDL_GL_GetProcAddress("glGetIntegerv");
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    65
    PFNGLGETPROGRAMIVARBPROC pglGetProgramivARB = (PFNGLGETPROGRAMIVARBPROC) SDL_GL_GetProcAddress("glGetProgramivARB");
1135
780e3e4b1d4a Support OpenGL 3.0 and later.
Ryan C. Gordon <icculus@icculus.org>
parents: 1134
diff changeset
    66
    PFNGLGETSTRINGIPROC pglGetStringi = (PFNGLGETSTRINGIPROC) SDL_GL_GetProcAddress("glGetStringi");
269
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    67
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    68
    printf("Basic strings...\n\n");
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    69
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    70
    #define getval(x) printf(#x ": %s\n", pglGetString(x))
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    71
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    72
    getval(GL_RENDERER);
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    73
    getval(GL_VERSION);
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    74
    getval(GL_VENDOR);
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    75
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    76
    #undef getval
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    77
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    78
    printf("\nExtensions...\n\n");
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    79
1135
780e3e4b1d4a Support OpenGL 3.0 and later.
Ryan C. Gordon <icculus@icculus.org>
parents: 1134
diff changeset
    80
    if (is_atleast_gl3((const char *) pglGetString(GL_VERSION)))
780e3e4b1d4a Support OpenGL 3.0 and later.
Ryan C. Gordon <icculus@icculus.org>
parents: 1134
diff changeset
    81
    {
780e3e4b1d4a Support OpenGL 3.0 and later.
Ryan C. Gordon <icculus@icculus.org>
parents: 1134
diff changeset
    82
        GLint i;
780e3e4b1d4a Support OpenGL 3.0 and later.
Ryan C. Gordon <icculus@icculus.org>
parents: 1134
diff changeset
    83
        GLint num_exts = 0;
780e3e4b1d4a Support OpenGL 3.0 and later.
Ryan C. Gordon <icculus@icculus.org>
parents: 1134
diff changeset
    84
        pglGetIntegerv(GL_NUM_EXTENSIONS, &num_exts);
780e3e4b1d4a Support OpenGL 3.0 and later.
Ryan C. Gordon <icculus@icculus.org>
parents: 1134
diff changeset
    85
        for (i = 0; i < num_exts; i++)
780e3e4b1d4a Support OpenGL 3.0 and later.
Ryan C. Gordon <icculus@icculus.org>
parents: 1134
diff changeset
    86
            printf("%s\n", (const char *) pglGetStringi(GL_EXTENSIONS, i));
780e3e4b1d4a Support OpenGL 3.0 and later.
Ryan C. Gordon <icculus@icculus.org>
parents: 1134
diff changeset
    87
    }
780e3e4b1d4a Support OpenGL 3.0 and later.
Ryan C. Gordon <icculus@icculus.org>
parents: 1134
diff changeset
    88
    else
269
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    89
    {
1135
780e3e4b1d4a Support OpenGL 3.0 and later.
Ryan C. Gordon <icculus@icculus.org>
parents: 1134
diff changeset
    90
        const GLubyte *ext = pglGetString(GL_EXTENSIONS);
780e3e4b1d4a Support OpenGL 3.0 and later.
Ryan C. Gordon <icculus@icculus.org>
parents: 1134
diff changeset
    91
        while (*ext)
780e3e4b1d4a Support OpenGL 3.0 and later.
Ryan C. Gordon <icculus@icculus.org>
parents: 1134
diff changeset
    92
        {
780e3e4b1d4a Support OpenGL 3.0 and later.
Ryan C. Gordon <icculus@icculus.org>
parents: 1134
diff changeset
    93
            fputc((*ext == ' ') ? '\n' : ((int) *ext), stdout);
780e3e4b1d4a Support OpenGL 3.0 and later.
Ryan C. Gordon <icculus@icculus.org>
parents: 1134
diff changeset
    94
            ext++;
780e3e4b1d4a Support OpenGL 3.0 and later.
Ryan C. Gordon <icculus@icculus.org>
parents: 1134
diff changeset
    95
        } // while
269
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    96
1135
780e3e4b1d4a Support OpenGL 3.0 and later.
Ryan C. Gordon <icculus@icculus.org>
parents: 1134
diff changeset
    97
        ext--;
780e3e4b1d4a Support OpenGL 3.0 and later.
Ryan C. Gordon <icculus@icculus.org>
parents: 1134
diff changeset
    98
        if (*ext != ' ')
780e3e4b1d4a Support OpenGL 3.0 and later.
Ryan C. Gordon <icculus@icculus.org>
parents: 1134
diff changeset
    99
            printf("\n");
780e3e4b1d4a Support OpenGL 3.0 and later.
Ryan C. Gordon <icculus@icculus.org>
parents: 1134
diff changeset
   100
    }
269
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   101
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   102
    printf("\nARB1 values...\n\n");
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   103
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   104
    if (pglGetProgramivARB == NULL)
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   105
        printf("  (unsupported.)\n");
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   106
    else
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   107
    {
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   108
        #define getval(x) \
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   109
            val = -1; \
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   110
            pglGetProgramivARB(GL_VERTEX_PROGRAM_ARB, x, &val); \
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   111
            printf(#x ": %d\n", (int) val);
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   112
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   113
        getval(GL_MAX_PROGRAM_INSTRUCTIONS_ARB);
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   114
        getval(GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB);
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   115
        getval(GL_MAX_PROGRAM_TEMPORARIES_ARB);
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   116
        getval(GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB);
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   117
        getval(GL_MAX_PROGRAM_PARAMETERS_ARB);
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   118
        getval(GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB);
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   119
        getval(GL_MAX_PROGRAM_ATTRIBS_ARB);
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   120
        getval(GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB);
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   121
        getval(GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB);
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   122
        getval(GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB);
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   123
        getval(GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB);
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   124
        getval(GL_MAX_PROGRAM_ENV_PARAMETERS_ARB);
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   125
        getval(GL_MAX_PROGRAM_PARAMETERS_ARB);
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   126
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   127
        #undef getval
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   128
    } // else
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   129
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   130
    printf("\nGLSL values...\n\n");
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   131
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   132
    #define getval(x) \
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   133
        val = -1; \
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   134
        pglGetIntegerv(x, &val); \
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   135
        printf(#x ": %d\n", (int) val);
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   136
412
4e275a0788f7 Added test for GLSL version string.
Ryan C. Gordon <icculus@icculus.org>
parents: 277
diff changeset
   137
    str = (const char *) pglGetString(GL_SHADING_LANGUAGE_VERSION_ARB);
4e275a0788f7 Added test for GLSL version string.
Ryan C. Gordon <icculus@icculus.org>
parents: 277
diff changeset
   138
    printf("GL_SHADING_LANGUAGE_VERSION_ARB: %s\n", str);
269
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   139
    getval(GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB);
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   140
    getval(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB);
274
857f2198d5a9 Removed tab characters from source.
Ryan C. Gordon <icculus@icculus.org>
parents: 273
diff changeset
   141
    getval(GL_MAX_VARYING_FLOATS_ARB);
857f2198d5a9 Removed tab characters from source.
Ryan C. Gordon <icculus@icculus.org>
parents: 273
diff changeset
   142
    getval(GL_MAX_VERTEX_ATTRIBS_ARB);
857f2198d5a9 Removed tab characters from source.
Ryan C. Gordon <icculus@icculus.org>
parents: 273
diff changeset
   143
    getval(GL_MAX_TEXTURE_IMAGE_UNITS_ARB);
857f2198d5a9 Removed tab characters from source.
Ryan C. Gordon <icculus@icculus.org>
parents: 273
diff changeset
   144
    getval(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB);
857f2198d5a9 Removed tab characters from source.
Ryan C. Gordon <icculus@icculus.org>
parents: 273
diff changeset
   145
    getval(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB);
857f2198d5a9 Removed tab characters from source.
Ryan C. Gordon <icculus@icculus.org>
parents: 273
diff changeset
   146
    getval(GL_MAX_TEXTURE_COORDS_ARB);
269
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   147
271
a9f0f4a1d9a9 Research on GL_EXT_bindable_uniform for future experimentation.
Ryan C. Gordon <icculus@icculus.org>
parents: 269
diff changeset
   148
    printf("\nGL_EXT_bindable_uniform values...\n\n");
a9f0f4a1d9a9 Research on GL_EXT_bindable_uniform for future experimentation.
Ryan C. Gordon <icculus@icculus.org>
parents: 269
diff changeset
   149
a9f0f4a1d9a9 Research on GL_EXT_bindable_uniform for future experimentation.
Ryan C. Gordon <icculus@icculus.org>
parents: 269
diff changeset
   150
    getval(GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT);
a9f0f4a1d9a9 Research on GL_EXT_bindable_uniform for future experimentation.
Ryan C. Gordon <icculus@icculus.org>
parents: 269
diff changeset
   151
    getval(GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT);
a9f0f4a1d9a9 Research on GL_EXT_bindable_uniform for future experimentation.
Ryan C. Gordon <icculus@icculus.org>
parents: 269
diff changeset
   152
    getval(GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT);
a9f0f4a1d9a9 Research on GL_EXT_bindable_uniform for future experimentation.
Ryan C. Gordon <icculus@icculus.org>
parents: 269
diff changeset
   153
    getval(GL_MAX_BINDABLE_UNIFORM_SIZE_EXT);
a9f0f4a1d9a9 Research on GL_EXT_bindable_uniform for future experimentation.
Ryan C. Gordon <icculus@icculus.org>
parents: 269
diff changeset
   154
269
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   155
    #undef getval
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   156
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   157
    SDL_Quit();
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   158
    printf("\n");
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   159
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   160
    return 0;
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   161
}
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   162
fbc4e1843809 Added glcaps.c ...
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
   163