资源简介
glad.h 现在没得免费的分了啊
代码片段和文件信息
/*
OpenGL loader generated by glad 0.1.14a0 on Tue Jun 20 13:29:43 2017.
Language/Generator: C/C++
Specification: gl
APIs: gl=4.5
Profile: core
Extensions:
Loader: True
Local files: False
Omit khrplatform: False
Commandline:
--profile=“core“ --api=“gl=4.5“ --generator=“c“ --spec=“gl“ --extensions=““
Online:
http://glad.dav1d.de/#profile=core&language=c&specification=gl&loader=on&api=gl%3D4.5
*/
#include
#include
#include
#include
static void* get_proc(const char *namez);
#ifdef _WIN32
#include
static HMODULE libGL;
typedef void* (APIENTRYP PFNWGLGETPROCADDRESSPROC_PRIVATE)(const char*);
static PFNWGLGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr;
static
int open_gl(void) {
libGL = LoadLibraryW(L“opengl32.dll“);
if(libGL != NULL) {
gladGetProcAddressPtr = (PFNWGLGETPROCADDRESSPROC_PRIVATE)GetProcAddress(
libGL “wglGetProcAddress“);
return gladGetProcAddressPtr != NULL;
}
return 0;
}
static
void close_gl(void) {
if(libGL != NULL) {
FreeLibrary(libGL);
libGL = NULL;
}
}
#else
#include
static void* libGL;
#ifndef __APPLE__
typedef void* (APIENTRYP PFNGLXGETPROCADDRESSPROC_PRIVATE)(const char*);
static PFNGLXGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr;
#endif
static
int open_gl(void) {
#ifdef __APPLE__
static const char *NAMES[] = {
“../frameworks/OpenGL.framework/OpenGL“
“/Library/frameworks/OpenGL.framework/OpenGL“
“/System/Library/frameworks/OpenGL.framework/OpenGL“
“/System/Library/frameworks/OpenGL.framework/Versions/Current/OpenGL“
};
#else
static const char *NAMES[] = {“libGL.so.1“ “libGL.so“};
#endif
unsigned int index = 0;
for(index = 0; index < (sizeof(NAMES) / sizeof(NAMES[0])); index++) {
libGL = dlopen(NAMES[index] RTLD_NOW | RTLD_GLOBAL);
if(libGL != NULL) {
#ifdef __APPLE__
return 1;
#else
gladGetProcAddressPtr = (PFNGLXGETPROCADDRESSPROC_PRIVATE)dlsym(libGL
“glXGetProcAddressARB“);
return gladGetProcAddressPtr != NULL;
#endif
}
}
return 0;
}
static
void close_gl() {
if(libGL != NULL) {
dlclose(libGL);
libGL = NULL;
}
}
#endif
static
void* get_proc(const char *namez) {
void* result = NULL;
if(libGL == NULL) return NULL;
#ifndef __APPLE__
if(gladGetProcAddressPtr != NULL) {
result = gladGetProcAddressPtr(namez);
}
#endif
if(result == NULL) {
#ifdef _WIN32
result = (void*)GetProcAddress(libGL namez);
#else
result = dlsym(libGL namez);
#endif
}
return result;
}
int gladLoadGL(void) {
int status = 0;
if(open_gl()) {
status = gladLoadGLLoader(&get_proc);
close_gl();
}
return status;
}
struct gladGLversionStruct GLVersion;
#if defined(GL_ES_VERSION_3_0) || de
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 210700 2017-06-20 13:29 glad\include\glad\glad.h
文件 10154 2017-06-20 13:29 glad\include\KHR\khrplatform.h
文件 105767 2017-06-20 13:29 glad\src\glad.c
目录 0 2017-06-20 19:30 glad\include\glad
目录 0 2017-06-20 19:29 glad\include\KHR
目录 0 2017-06-20 19:29 glad\include
目录 0 2017-06-20 19:29 glad\src
目录 0 2017-06-20 19:29 glad
----------- --------- ---------- ----- ----
326621 8
- 上一篇:Warshall算法(邻接矩阵到可达矩阵)
- 下一篇:进程互斥.并发.同步程序
评论
共有 条评论