資源簡(jiǎn)介
Qt編譯下的windows c++ opengl 工程模版
1.編譯環(huán)境QtCreator
2.編譯器mingw530_32
3.glad文件
4.glfw3.2.1的源文件,帶有mingw編譯的庫(kù)
修改:
1.增加VAO,VBO,SHADERPROGRAM 畫(huà)三角形
作者:紅模仿 QQ:21497936
日期:2017年12月24日
代碼片段和文件信息
/*
????OpenGL?loader?generated?by?glad?0.1.16a0?on?Sun?Dec?10?09:57:20?2017.
????Language/Generator:?C/C++
????Specification:?gl
????APIs:?gl=4.4
????Profile:?core
????Extensions:
????????
????Loader:?True
????Local?files:?False
????Omit?khrplatform:?False
????Commandline:
????????--profile=“core“?--api=“gl=4.4“?--generator=“c“?--spec=“gl“?--extensions=““
????Online:
????????http://glad.dav1d.de/#profile=core&language=c&specification=gl&loader=on&api=gl%3D4.4
*/
#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[]?=?{“l(fā)ibGL.so.1“?“l(fā)ibGL.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(void)?{
????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)?|
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????文件?????179221??2017-12-24?13:50??qtOpenGLDemo2\glad\include\glad\glad.h
?????文件??????10114??2017-12-10?09:57??qtOpenGLDemo2\glad\include\KHR\khrplatform.h
?????文件??????86951??2017-12-10?17:11??qtOpenGLDemo2\glad\src\glad.c
?????文件??????86951??2017-12-10?17:11??qtOpenGLDemo2\glad.c
?????文件????????438??2016-08-18?19:32??qtOpenGLDemo2\glfw-3.2.1\.appveyor.yml
?????文件??????13713??2016-08-18?19:32??qtOpenGLDemo2\glfw-3.2.1\.github\CONTRIBUTING.md
?????文件????????516??2016-08-18?19:32??qtOpenGLDemo2\glfw-3.2.1\.travis.yml
????..A..H.?????58880??2017-12-10?15:31??qtOpenGLDemo2\glfw-3.2.1\build\.vs\GLFW\v14\.suo
?????文件??????30343??2017-12-10?15:29??qtOpenGLDemo2\glfw-3.2.1\build\ALL_BUILD.vcxproj
?????文件????????298??2017-12-10?15:29??qtOpenGLDemo2\glfw-3.2.1\build\ALL_BUILD.vcxproj.filters
?????文件??????13066??2017-12-10?16:14??qtOpenGLDemo2\glfw-3.2.1\build\CMakeCache.txt
?????文件???????2106??2017-12-10?15:28??qtOpenGLDemo2\glfw-3.2.1\build\CMakeFiles\3.10.0\CMakeCCompiler.cmake
?????文件??????49152??2017-12-10?15:28??qtOpenGLDemo2\glfw-3.2.1\build\CMakeFiles\3.10.0\CMakeDetermineCompilerABI_C.bin
?????文件????????212??2017-12-10?15:28??qtOpenGLDemo2\glfw-3.2.1\build\CMakeFiles\3.10.0\CMakeRCCompiler.cmake
?????文件????????387??2017-12-10?15:28??qtOpenGLDemo2\glfw-3.2.1\build\CMakeFiles\3.10.0\CMakeSystem.cmake
?????文件??????18674??2017-12-10?15:28??qtOpenGLDemo2\glfw-3.2.1\build\CMakeFiles\3.10.0\CompilerIdC\CMakeCCompilerId.c
?????文件??????14848??2017-12-10?15:28??qtOpenGLDemo2\glfw-3.2.1\build\CMakeFiles\3.10.0\CompilerIdC\CompilerIdC.exe
?????文件???????2595??2017-12-10?15:28??qtOpenGLDemo2\glfw-3.2.1\build\CMakeFiles\3.10.0\CompilerIdC\CompilerIdC.vcxproj
?????文件???????1999??2017-12-10?15:28??qtOpenGLDemo2\glfw-3.2.1\build\CMakeFiles\3.10.0\CompilerIdC\Debug\CMakeCCompilerId.obj
?????文件????????702??2017-12-10?15:28??qtOpenGLDemo2\glfw-3.2.1\build\CMakeFiles\3.10.0\CompilerIdC\Debug\CompilerIdC.tlog\CL.command.1.tlog
?????文件????????598??2017-12-10?15:28??qtOpenGLDemo2\glfw-3.2.1\build\CMakeFiles\3.10.0\CompilerIdC\Debug\CompilerIdC.tlog\CL.read.1.tlog
?????文件????????420??2017-12-10?15:28??qtOpenGLDemo2\glfw-3.2.1\build\CMakeFiles\3.10.0\CompilerIdC\Debug\CompilerIdC.tlog\CL.write.1.tlog
?????文件????????244??2017-12-10?15:28??qtOpenGLDemo2\glfw-3.2.1\build\CMakeFiles\3.10.0\CompilerIdC\Debug\CompilerIdC.tlog\CompilerIdC.lastbuildstate
?????文件????????330??2017-12-10?15:44??qtOpenGLDemo2\glfw-3.2.1\build\CMakeFiles\3.10.0\CompilerIdC\Debug\CompilerIdC.tlog\li
?????文件????????330??2017-12-10?15:49??qtOpenGLDemo2\glfw-3.2.1\build\CMakeFiles\3.10.0\CompilerIdC\Debug\CompilerIdC.tlog\li
?????文件????????330??2017-12-10?15:58??qtOpenGLDemo2\glfw-3.2.1\build\CMakeFiles\3.10.0\CompilerIdC\Debug\CompilerIdC.tlog\li
?????文件????????330??2017-12-10?16:03??qtOpenGLDemo2\glfw-3.2.1\build\CMakeFiles\3.10.0\CompilerIdC\Debug\CompilerIdC.tlog\li
?????文件???????1626??2017-12-10?15:43??qtOpenGLDemo2\glfw-3.2.1\build\CMakeFiles\3.10.0\CompilerIdC\Debug\CompilerIdC.tlog\li
?????文件???????1396??2017-12-10?15:43??qtOpenGLDemo2\glfw-3.2.1\build\CMakeFiles\3.10.0\CompilerIdC\Debug\CompilerIdC.tlog\li
?????文件?????????28??2017-12-10?15:44??qtOpenGLDemo2\glfw-3.2.1\build\CMakeFiles\3.10.0\CompilerIdC\Debug\CompilerIdC.tlog\li
............此處省略1744個(gè)文件信息
評(píng)論
共有 條評(píng)論