Module ImportFrom alias ImportFrom alias alias alias Assign NameStore BinOpAdd BinOpMod NameLoad Dict Str Str Str Str Str Str Str Str Str Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore BinOpAdd BinOpAdd Str NameLoad Str Assign NameStore BinOpAdd Str NameLoad Assign NameStore Str Assign NameStore Str ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults body If BoolOpAnd UnaryOpNot AttributeLoad NameLoad attr CompareIn Str AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad For TupleStore NameStore NameStore NameStore ListLoad TupleLoad Str Str Str TupleLoad Str Str Str TupleLoad Str Str Str TupleLoad Str Str Str body If BoolOpAnd CompareIn NameLoad AttributeLoad NameLoad attr CompareNotIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad If BoolOpAnd UnaryOpNot AttributeLoad NameLoad attr CompareIn Str AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list decorator_list
N/A glad.lang.common.loader BaseLoader glad.lang.c.loader LOAD_OPENGL_DLL LOAD_OPENGL_DLL_H LOAD_OPENGL_GLAPI_H N/A _OPENGL_LOADER N/A N/A LOAD_OPENGL_DLL N/A pre init proc terminate static open_gl get_proc close_gl 
int gladLoadGL(void) {
    int status = 0;

    if(open_gl()) {
        status = gladLoadGLLoader(&get_proc);
        close_gl();
    }

    return status;
}
 N/A _OPENGL_HAS_EXT 
struct gladGLversionStruct GLVersion;

#if defined(GL_ES_VERSION_3_0) || defined(GL_VERSION_3_0)
#define _GLAD_IS_SOME_NEW_VERSION 1
#endif

static int max_loaded_major;
static int max_loaded_minor;

static const char *exts = NULL;
static int num_exts_i = 0;
static const char **exts_i = NULL;

static int get_exts(void) {
#ifdef _GLAD_IS_SOME_NEW_VERSION
    if(max_loaded_major < 3) {
#endif
        exts = (const char *)glGetString(GL_EXTENSIONS);
#ifdef _GLAD_IS_SOME_NEW_VERSION
    } else {
        int index;

        num_exts_i = 0;
        glGetIntegerv(GL_NUM_EXTENSIONS, &num_exts_i);
        if (num_exts_i > 0) {
            exts_i = (const char **)realloc((void *)exts_i, num_exts_i * sizeof *exts_i);
        }

        if (exts_i == NULL) {
            return 0;
        }

        for(index = 0; index < num_exts_i; index++) {
            exts_i[index] = (const char*)glGetStringi(GL_EXTENSIONS, index);
        }
    }
#endif
    return 1;
}

static void free_exts(void) {
    if (exts_i != NULL) {
        free((char **)exts_i);
        exts_i = NULL;
    }
}

static int has_ext(const char *ext) {
#ifdef _GLAD_IS_SOME_NEW_VERSION
    if(max_loaded_major < 3) {
#endif
        const char *extensions;
        const char *loc;
        const char *terminator;
        extensions = exts;
        if(extensions == NULL || ext == NULL) {
            return 0;
        }

        while(1) {
            loc = strstr(extensions, ext);
            if(loc == NULL) {
                return 0;
            }

            terminator = loc + strlen(ext);
            if((loc == extensions || *(loc - 1) == ' ') &&
                (*terminator == ' ' || *terminator == '\0')) {
                return 1;
            }
            extensions = terminator;
        }
#ifdef _GLAD_IS_SOME_NEW_VERSION
    } else {
        int index;

        for(index = 0; index < num_exts_i; index++) {
            const char *e = exts_i[index];

            if(strcmp(e, ext) == 0) {
                return 1;
            }
        }
    }
#endif

    return 0;
}
 N/A _OPENGL_HEADER_START 
#ifndef __glad_h_
#define __glad_h_
 N/A _OPENGL_HEADER_INCLUDE_ERROR 
#ifdef __{0}_h_
#error {1} header already included, remove this include, glad already provides it
#endif
#define __{0}_h_
 N/A _OPENGL_HEADER N/A N/A 
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
#include <windows.h>
#endif

#ifndef APIENTRY
#define APIENTRY
#endif
#ifndef APIENTRYP
#define APIENTRYP APIENTRY *
#endif

#ifdef __cplusplus
extern "C" {
#endif

struct gladGLversionStruct {
    int major;
    int minor;
};

typedef void* (* GLADloadproc)(const char *name);
 LOAD_OPENGL_GLAPI_H 
GLAPI struct gladGLversionStruct GLVersion;
 N/A _OPENGL_HEADER_LOADER N/A 
GLAPI int gladLoadGL(void);
 LOAD_OPENGL_DLL_H N/A _OPENGL_HEADER_END 
#ifdef __cplusplus
}
#endif

#endif
 N/A _FIND_VERSION 
    /* Thank you @elmindreda
     * https://github.com/elmindreda/greg/blob/master/templates/greg.c.in#L176
     * https://github.com/glfw/glfw/blob/master/src/context.c#L36
     */
    int i, major, minor;

    const char* version;
    const char* prefixes[] = {
        "OpenGL ES-CM ",
        "OpenGL ES-CL ",
        "OpenGL ES ",
        NULL
    };

    version = (const char*) glGetString(GL_VERSION);
    if (!version) return;

    for (i = 0;  prefixes[i];  i++) {
        const size_t length = strlen(prefixes[i]);
        if (strncmp(version, prefixes[i], length) == 0) {
            version += length;
            break;
        }
    }

/* PR #18 */
#ifdef _MSC_VER
    sscanf_s(version, "%d.%d", &major, &minor);
#else
    sscanf(version, "%d.%d", &major, &minor);
#endif

    GLVersion.major = major; GLVersion.minor = minor;
    max_loaded_major = major; max_loaded_minor = minor;
 OpenGLCLoader N/A BaseLoader N/A write N/A N/A self fobj N/A N/A N/A N/A N/A N/A self disabled N/A gl N/A self apis N/A N/A N/A N/A fobj write _OPENGL_LOADER N/A write_begin_load N/A N/A self fobj N/A N/A N/A N/A N/A fobj write 	GLVersion.major = 0; GLVersion.minor = 0;
 N/A N/A N/A fobj write 	glGetString = (PFNGLGETSTRINGPROC)load("glGetString");
 N/A N/A N/A fobj write 	if(glGetString == NULL) return 0;
 N/A N/A N/A fobj write 	if(glGetString(GL_VERSION) == NULL) return 0;
 N/A write_end_load N/A N/A self fobj N/A N/A N/A N/A N/A fobj write 	return GLVersion.major != 0 || GLVersion.minor != 0;
 N/A write_find_core N/A N/A self fobj N/A N/A N/A N/A N/A fobj write _FIND_VERSION N/A write_find_core_end N/A N/A self fobj N/A N/A N/A N/A N/A fobj write _FIND_VERSION N/A write_has_ext N/A N/A self fobj N/A N/A N/A N/A N/A fobj write _OPENGL_HAS_EXT N/A write_header N/A N/A self fobj N/A N/A N/A N/A N/A fobj write _OPENGL_HEADER_START N/A written N/A set N/A N/A api hname name N/A N/A gl gl OpenGL N/A gles1 gl OpenGL ES 1 N/A gles2 gl2 OpenGL ES 2 N/A gles2 gl3 OpenGL ES 3 N/A N/A N/A N/A api N/A self apis N/A hname written N/A N/A N/A N/A fobj write N/A N/A _OPENGL_HEADER_INCLUDE_ERROR format hname name N/A N/A N/A written add hname N/A N/A N/A fobj write _OPENGL_HEADER N/A N/A N/A N/A self disabled N/A gl N/A self apis N/A N/A N/A N/A fobj write _OPENGL_HEADER_LOADER N/A write_header_end N/A N/A self fobj N/A N/A N/A N/A N/A fobj write _OPENGL_HEADER_END N/A N/A