/*
OpenGL loader generated by glad 0.1.29 on Tue Apr 2 10:34:48 2019.
Language/Generator: C/C++
Specification: gl
APIs: gl=3.3
Profile: compatibility
Extensions:
Loader: True
Local files: False
Omit khrplatform: False
Reproducible: False
Commandline:
--profile="compatibility" --api="gl=3.3" --generator="c" --spec="gl" --extensions=""
Online:
https://glad.dav1d.de/#profile=compatibility&language=c&specification=gl&loader=on&api=gl%3D3.3
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <glad/glad.h>
static void* get_proc(const char *namez);
#if defined(_WIN32) || defined(__CYGWIN__)
#include <windows.h>
static HMODULE libGL;
typedef void* (APIENTRYP PFNWGLGETPROCADDRESSPROC_PRIVATE)(const char*);
static PFNWGLGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr;
#ifdef _MSC_VER
#ifdef __has_include
#if __has_include(<winapifamily.h>)
#define HAVE_WINAPIFAMILY 1
#endif
#elif _MSC_VER >= 1700 && !_USING_V110_SDK71_
#define HAVE_WINAPIFAMILY 1
#endif
#endif
#ifdef HAVE_WINAPIFAMILY
#include <winapifamily.h>
#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
#define IS_UWP 1
#endif
#endif
static
int open_gl(void) {
#ifndef IS_UWP
libGL = LoadLibraryW(L"opengl32.dll");
if(libGL != NULL) {
void (* tmp)(void);
tmp = (void(*)(void)) GetProcAddress(libGL, "wglGetProcAddress");
gladGetProcAddressPtr = (PFNWGLGETPROCADDRESSPROC_PRIVATE) tmp;
return gladGetProcAddressPtr != NULL;
}
#endif
return 0;
}
static
void close_gl(void) {
if(libGL != NULL) {
FreeLibrary((HMODULE) libGL);
libGL = NULL;
}
}
#else
#include <dlfcn.h>
static void* libGL;
#if !defined(__APPLE__) && !defined(__HAIKU__)
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) {
#if defined(__APPLE__) || defined(__HAIKU__)
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;
#if !defined(__APPLE__) && !defined(__HAIKU__)
if(gladGetProcAddressPtr != NULL) {
result = gladGetProcAddressPtr(namez);
}
#endif
if(result == NULL) {
#if defined(_WIN32) || defined(__CYGWIN__)
result = (void*)GetProcAddress((HMODULE) 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 = { 0, 0 };
#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 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 {
unsigned int index;
num_exts_i = 0;
glGetIntegerv(GL_NUM_EXTENSIONS, &num_exts_i);
if (num_exts_i > 0) {
exts_i = (char **)malloc((size_t)num_exts_i * (sizeof *exts_i));
}
if (exts_i == NULL) {
return 0;
}
for(index = 0; index < (unsigned)num_exts_i; index++) {
const char *gl_str_tmp = (const char*)glGetStringi(GL_EXTENSIONS, index);
size_t len = strlen(gl_str_tmp);
char *local_str = (char*)malloc((len+1) * sizeof(char));
if(local_str != NULL) {
memcpy(local_str, gl_str_tmp, (len+1) * sizeof(char));
}
exts_i[index] = local_str;
}
}
#endif
return 1;
}
static void free_exts(void) {
if (exts_i != NULL) {
int index;
for(index = 0; index < num_exts_i; index++) {
free((char *)exts_i[index]);
}
free((void *)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;
if(exts_i == NULL) return 0;
for(index = 0; index < num_exts_i; index++) {
const char *e = exts_i[index];
if(exts_i[index] != NULL && strcmp(e, ext) == 0) {
return 1;
}
}
}
#endif
return 0;
}
int GLAD_GL_VERSION_1_0 = 0;
int GLAD_GL_VERSION_1_1 = 0;
int GLAD_GL_VERSION_1_2 = 0;
int GLAD_GL_VERSION_1_3 = 0;
int GLAD_GL_VERSION_1_4 = 0;
int GLAD_GL_VERSION_1_5 = 0;
int GLAD_GL_VERSION_2_0 = 0;
int GLAD_GL_VERSION_2_1 = 0;
int GLAD_GL_VERSION_3_0 = 0;
int GLAD_GL_VERSION_3_1 = 0;
int GLAD_GL_VERSION_3_2 = 0;
int GLAD_GL_VERSION_3_3 = 0;
PFNGLACCUMPROC glad_glAccum = NULL;
PFNGLACTIVETEXTUREPROC glad_glActiveTexture = NULL;
PFNGLALPHAFUNCPROC glad_glAlphaFunc = NULL;
PFNGLARETEXTURESRESIDENTPROC glad_glAreTexturesResident = NULL;
PFNGLARRAYELEMENTPROC glad_glArrayElement = NULL;
PFNGLATTACHSHADERPROC glad_glAttachShader = NULL;
PFNGLBEGINPROC glad_glBegin = NULL;
PFNGLBEGINCONDITIONALRENDERPROC glad_glBeginConditionalRender = NULL;
PFNGLBEGINQUERYPROC glad_glBeginQuery = NULL;
PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback = NULL;
PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation = NULL;
PFNGLBINDBUFFERPROC glad_glBindBuffer = NULL;
PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase = NULL;
PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange = NULL;
PFNGLBINDFRAGDATALOCATIONPROC glad_glBindFragDataLocation = NULL;
PFNGLBINDFRAGDATALOCATIONINDEXEDPROC glad_glBindFragDataLocationIndexed = NULL;
PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer = NULL;
PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer = NULL;
PFNGLBINDSAMPLERPROC glad_glBindSampler = NULL;
PFNGLBINDTEXTUREPROC glad_glBindTexture = NULL;
PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray = NULL;
PFNGLBITMAPPROC glad_glBitmap = NULL;
PFNGLBLENDCOLORPROC glad_glBlendColor = NULL;
PFNGLBLENDEQUATIONPROC glad_glBlendEquation = NULL;
PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate = NULL;
PFNGLBLENDFUNCPROC glad_glBlendFunc = NULL;
PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate = NULL;
PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
【作品名称】:基于C++和OpenGL实现的模仿我的世界的图形学小Demo。实现了包括地形自动生成,方块消除和放置功能 【适用人群】:适用于希望学习不同技术领域的小白或进阶学习者。可作为毕设项目、课程设计、大作业、工程实训或初期项目立项。 【项目介绍】: 本项目是基于C++(c11)、OpenGL和GLFW实现的模仿我的世界的图形学小Demo。实现了包括随机地形生成,方块消除和放置功能。 代码使用方式 项目基于windows开发,项目代码位于MineCraftDemo文件夹中,可以直接使用visual studio 2015加载。 全局参数设置 全局参数位于WorldInfo.h&WorldInfo.cpp中,会影响运行性能的参数如下: 参数名 说明 备注 renderChunkRadius 渲染半径 设置的越大可见范围越广,但可能会造成卡顿。默认为2,建议设置为1 useLight 是否开启光照明 默认开 【资源声明】:本资源作为“参考资料”而不是“定制需求”,代码只能作为参考,不能完全复制照搬。需要有一定的基础看懂代码,自行调试代码并解决报错,能自行添加功能修改代码。
资源推荐
资源详情
资源评论
收起资源包目录
基于C++和OpenGL实现的模仿我的世界的图形学小Demo 实现了包括地形自动生成,方块消除和放置功能 (1266个子文件)
MyOpenGL.bsc 8.37MB
glad.c 98KB
clew.c 15KB
sat.cl 55KB
satClipHullContacts.cl 55KB
primitiveContacts.cl 36KB
satConcave.cl 32KB
parallelLinearBvh.cl 28KB
RadixSort32Kernels.cl 26KB
solverUtils.cl 24KB
jointSolver.cl 24KB
solverSetup2.cl 12KB
solveFriction.cl 12KB
solveContact.cl 12KB
sap.cl 10KB
rayCastKernels.cl 9KB
batchingKernels.cl 8KB
mpr.cl 8KB
bvhTraversal.cl 8KB
gridBroadphase.cl 6KB
solverSetup.cl 6KB
batchingKernelsNew.cl 5KB
PrefixScanFloat4Kernels.cl 4KB
PrefixScanKernels.cl 4KB
CopyKernels.cl 3KB
FillKernels.cl 3KB
BoundSearchKernels.cl 3KB
integrateKernel.cl 1KB
updateAabbsKernel.cl 591B
b3Serializer.cpp 199KB
b3ConvexHullContact.cpp 149KB
btSerializer64.cpp 126KB
btSerializer.cpp 126KB
btSoftBody.cpp 117KB
btSequentialImpulseConstraintSolver.cpp 81KB
btMultiBody.cpp 76KB
b3PgsJacobiSolver.cpp 70KB
btMultiBodyConstraintSolver.cpp 70KB
btCollisionWorld.cpp 62KB
btSequentialImpulseConstraintSolverMt.cpp 58KB
btVector3.cpp 56KB
btDantzigLCP.cpp 56KB
b3Vector3.cpp 55KB
b3ConvexHullComputer.cpp 55KB
btConvexHullComputer.cpp 55KB
btQuantizedBvh.cpp 50KB
b3GpuPgsContactSolver.cpp 49KB
btDiscreteDynamicsWorld.cpp 49KB
btSoftBodyHelpers.cpp 46KB
b3QuantizedBvh.cpp 46KB
b3GpuJacobiContactSolver.cpp 44KB
btGeneric6DofSpring2Constraint.cpp 42KB
MultiBodyTreeImpl.cpp 41KB
b3GpuPgsConstraintSolver.cpp 40KB
b3GpuSapBroadphase.cpp 38KB
b3File.cpp 37KB
b3DynamicBvh.cpp 37KB
btDbvt.cpp 37KB
b3Solver.cpp 36KB
btConeTwistConstraint.cpp 36KB
btBatchedConstraints.cpp 35KB
b3GpuNarrowPhase.cpp 35KB
btHingeConstraint.cpp 34KB
btMultiBodyDynamicsWorld.cpp 34KB
btCollisionWorldImporter.cpp 33KB
btMultiBodyMLCPConstraintSolver.cpp 32KB
btKinematicCharacterController.cpp 31KB
btGjkPairDetector.cpp 31KB
btConvexConvexAlgorithm.cpp 31KB
btGeneric6DofConstraint.cpp 30KB
b3OpenCLUtils.cpp 29KB
btInternalEdgeUtility.cpp 29KB
btConvexHull.cpp 28KB
b3GjkEpa.cpp 26KB
btGjkEpa2.cpp 26KB
btShapeHull.cpp 25KB
btSliderConstraint.cpp 25KB
btDeformableMultiBodyDynamicsWorld.cpp 25KB
btGImpactCollisionAlgorithm.cpp 24KB
b3Generic6DofConstraint.cpp 24KB
btHeightfieldTerrainShape.cpp 23KB
btDeformableContactConstraint.cpp 23KB
btQuickprof.cpp 23KB
b3GpuRigidBodyPipeline.cpp 23KB
btDbvtBroadphase.cpp 22KB
btBoxBoxDetector.cpp 22KB
btSimulationIslandManagerMt.cpp 22KB
b3DynamicBvhBroadphase.cpp 22KB
b3GpuParallelLinearBvh.cpp 22KB
btThreads.cpp 21KB
btRaycastVehicle.cpp 21KB
btTaskScheduler.cpp 20KB
btMLCPSolver.cpp 20KB
b3RadixSort32CL.cpp 18KB
btPersistentManifold.cpp 18KB
b3VoronoiSimplexSolver.cpp 17KB
btVoronoiSimplexSolver.cpp 17KB
btOverlappingPairCache.cpp 17KB
btNNCGConstraintSolver.cpp 17KB
btRigidBody.cpp 16KB
共 1266 条
- 1
- 2
- 3
- 4
- 5
- 6
- 13
资源评论
小英子架构
- 粉丝: 988
- 资源: 3789
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功