mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-13 21:30:09 +00:00
Merge pull request #1569 from erwincoumans/master
allow to build GLFW version of Bullet examples on Linux (use premake4…
This commit is contained in:
commit
8bc39ab11e
@ -35,7 +35,7 @@
|
||||
if _OPTIONS["enable_system_opengl"] and (os.isdir("/usr/include") and os.isfile("/usr/include/GL/gl.h")) then
|
||||
links {"GL"}
|
||||
else
|
||||
print("No GL/gl.h found, using dynamic loading of GL using glew")
|
||||
print("No GL/gl.h found, using dynamic loading of GL using glad")
|
||||
defines {"GLEW_INIT_OPENGL11_FUNCTIONS=1"}
|
||||
links {"dl"}
|
||||
end
|
||||
@ -50,24 +50,27 @@
|
||||
configuration {"Windows"}
|
||||
defines { "GLEW_STATIC"}
|
||||
includedirs {
|
||||
projectRootDir .. "examples/ThirdPartyLibs/Glew"
|
||||
projectRootDir .. "examples/ThirdPartyLibs/glad"
|
||||
}
|
||||
files { projectRootDir .. "examples/ThirdPartyLibs/Glew/glew.c"}
|
||||
files { projectRootDir .. "examples/ThirdPartyLibs/glad/glad.c"}
|
||||
end
|
||||
if os.is("MacOSX") then
|
||||
includedirs {
|
||||
projectRootDir .. "examples/ThirdPartyLibs/glad"
|
||||
}
|
||||
files { projectRootDir .. "examples/ThirdPartyLibs/glad/glad.c"}
|
||||
end
|
||||
|
||||
if os.is("Linux") then
|
||||
configuration{"Linux"}
|
||||
if _OPTIONS["enable_system_opengl"] and (os.isdir("/usr/include") and os.isfile("/usr/include/GL/gl.h") and os.isfile("/usr/include/GL/glew.h")) then
|
||||
links {"GLEW"}
|
||||
print ("linking against system GLEW")
|
||||
else
|
||||
print("Using static glew and dynamic loading of glx functions")
|
||||
print("Using glad and dynamic loading of glx functions")
|
||||
defines { "GLEW_STATIC","GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS=1"}
|
||||
includedirs {
|
||||
projectRootDir .. "examples/ThirdPartyLibs/Glew"
|
||||
projectRootDir .. "examples/ThirdPartyLibs/glad"
|
||||
}
|
||||
files { projectRootDir .. "examples/ThirdPartyLibs/Glew/glew.c"}
|
||||
files { projectRootDir .. "examples/ThirdPartyLibs/glad/glad.c",
|
||||
projectRootDir .. "examples/ThirdPartyLibs/glad/glad_glx.c"}
|
||||
links {"dl"}
|
||||
end
|
||||
|
||||
end
|
||||
configuration{}
|
||||
|
@ -339,6 +339,10 @@ end
|
||||
end
|
||||
function initGlew()
|
||||
end
|
||||
function initX11()
|
||||
links {"X11", "dl","pthread"}
|
||||
|
||||
end
|
||||
|
||||
else
|
||||
dofile ("findOpenGLGlewGlut.lua")
|
||||
|
Binary file not shown.
@ -42,7 +42,7 @@ INCLUDE_DIRECTORIES(
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/src
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/btgui
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/examples
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/Glew
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad
|
||||
)
|
||||
|
||||
|
||||
|
@ -11,7 +11,7 @@ FILE(GLOB GwenGUISupport_HDRS "GwenGUISupport/*" )
|
||||
|
||||
IF (WIN32)
|
||||
INCLUDE_DIRECTORIES(
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/Glew
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad
|
||||
)
|
||||
ADD_DEFINITIONS(-DGLEW_STATIC)
|
||||
ELSE(WIN32)
|
||||
@ -21,7 +21,7 @@ ELSE(WIN32)
|
||||
ADD_DEFINITIONS("-DGLEW_INIT_OPENGL11_FUNCTIONS=1")
|
||||
ADD_DEFINITIONS("-DGLEW_STATIC")
|
||||
ADD_DEFINITIONS("-DGLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS=1")
|
||||
INCLUDE_DIRECTORIES( ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/Glew )
|
||||
INCLUDE_DIRECTORIES( ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad )
|
||||
ENDIF(APPLE)
|
||||
ENDIF(WIN32)
|
||||
|
||||
@ -90,7 +90,7 @@ LINK_LIBRARIES(
|
||||
|
||||
IF (WIN32)
|
||||
INCLUDE_DIRECTORIES(
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/Glew
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad
|
||||
)
|
||||
LINK_LIBRARIES(
|
||||
${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}
|
||||
@ -101,11 +101,12 @@ ELSE(WIN32)
|
||||
find_library(COCOA NAMES Cocoa)
|
||||
MESSAGE(${COCOA})
|
||||
link_libraries(${COCOA} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
|
||||
INCLUDE_DIRECTORIES( ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad )
|
||||
ELSE(APPLE)
|
||||
ADD_DEFINITIONS("-DGLEW_INIT_OPENGL11_FUNCTIONS=1")
|
||||
ADD_DEFINITIONS("-DGLEW_STATIC")
|
||||
ADD_DEFINITIONS("-DGLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS=1")
|
||||
INCLUDE_DIRECTORIES( ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/Glew )
|
||||
INCLUDE_DIRECTORIES( ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad )
|
||||
LINK_LIBRARIES( pthread ${DL})
|
||||
ENDIF(APPLE)
|
||||
ENDIF(WIN32)
|
||||
|
@ -3,6 +3,7 @@ INCLUDE_DIRECTORIES(
|
||||
..
|
||||
../ThirdPartyLibs
|
||||
../../src
|
||||
../ThirdPartyLibs/glad
|
||||
)
|
||||
|
||||
FILE(GLOB OpenGLWindow_HDRS "*.h" )
|
||||
@ -22,28 +23,28 @@ LIST(REMOVE_ITEM OpenGLWindowCommon_CPP MacOpenGLWindow.cpp )
|
||||
#MESSAGE (${OpenGLWindowCommon_CPP})
|
||||
|
||||
IF (WIN32)
|
||||
SET(OpenGLWindow_SRCS ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/Glew/glew.c ${OpenGLWindowWin32_CPP} ${OpenGLWindowCommon_CPP})
|
||||
SET(OpenGLWindow_SRCS ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad/glad.c ${OpenGLWindowWin32_CPP} ${OpenGLWindowCommon_CPP})
|
||||
INCLUDE_DIRECTORIES(
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/Glew
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad
|
||||
)
|
||||
ADD_DEFINITIONS(-DGLEW_STATIC)
|
||||
ENDIF(WIN32)
|
||||
|
||||
IF (APPLE)
|
||||
SET(OpenGLWindow_SRCS ${OpenGLWindowMac_CPP} ${OpenGLWindowMacObjC_CPP} ${OpenGLWindowCommon_CPP} )
|
||||
SET(OpenGLWindow_SRCS ${OpenGLWindowMac_CPP} ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad/glad.c ${OpenGLWindowMacObjC_CPP} ${OpenGLWindowCommon_CPP} )
|
||||
ENDIF(APPLE)
|
||||
|
||||
#no Linux detection?
|
||||
IF(NOT WIN32 AND NOT APPLE)
|
||||
INCLUDE_DIRECTORIES(
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/Glew
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/optionalX11
|
||||
)
|
||||
ADD_DEFINITIONS(-DGLEW_STATIC)
|
||||
ADD_DEFINITIONS("-DGLEW_INIT_OPENGL11_FUNCTIONS=1")
|
||||
ADD_DEFINITIONS("-DGLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS=1")
|
||||
ADD_DEFINITIONS("-DDYNAMIC_LOAD_X11_FUNCTIONS=1")
|
||||
SET(OpenGLWindow_SRCS ${OpenGLWindowLinux_CPP} ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/Glew/glew.c ${OpenGLWindowCommon_CPP} )
|
||||
SET(OpenGLWindow_SRCS ${OpenGLWindowLinux_CPP} ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad/glad_glx.c ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad/glad.c ${OpenGLWindowCommon_CPP} )
|
||||
ENDIF()
|
||||
|
||||
|
||||
|
@ -33,7 +33,9 @@ float shadowMapWorldSize=10;
|
||||
#else
|
||||
#ifndef __APPLE__
|
||||
#ifndef glVertexAttribDivisor
|
||||
|
||||
#ifndef NO_GLEW
|
||||
|
||||
#define glVertexAttribDivisor glVertexAttribDivisorARB
|
||||
#endif //NO_GLEW
|
||||
#endif //glVertexAttribDivisor
|
||||
@ -132,7 +134,7 @@ struct b3GraphicsInstance
|
||||
int m_numIndices;
|
||||
int m_numVertices;
|
||||
|
||||
|
||||
|
||||
int m_numGraphicsInstances;
|
||||
b3AlignedObjectArray<int> m_tempObjectUids;
|
||||
int m_instanceOffset;
|
||||
@ -217,7 +219,7 @@ struct InternalDataRenderer : public GLInstanceRendererInternalData
|
||||
|
||||
SimpleCamera m_defaultCamera1;
|
||||
CommonCameraInterface* m_activeCamera;
|
||||
|
||||
|
||||
GLfloat m_projectionMatrix[16];
|
||||
GLfloat m_viewMatrix[16];
|
||||
GLfloat m_viewMatrixInverse[16];
|
||||
@ -230,9 +232,9 @@ struct InternalDataRenderer : public GLInstanceRendererInternalData
|
||||
|
||||
GLRenderToTexture* m_shadowMap;
|
||||
GLuint m_shadowTexture;
|
||||
|
||||
|
||||
GLuint m_renderFrameBuffer;
|
||||
|
||||
|
||||
|
||||
|
||||
b3ResizablePool< b3PublicGraphicsInstance> m_publicGraphicsInstances;
|
||||
@ -256,7 +258,7 @@ struct InternalDataRenderer : public GLInstanceRendererInternalData
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
@ -471,7 +473,7 @@ void GLInstancingRenderer::readSingleInstanceTransformFromCPU(int srcIndex2, flo
|
||||
position[0] = m_data->m_instance_positions_ptr[srcIndex*4+0];
|
||||
position[1] = m_data->m_instance_positions_ptr[srcIndex*4+1];
|
||||
position[2] = m_data->m_instance_positions_ptr[srcIndex*4+2];
|
||||
|
||||
|
||||
orientation[0] = m_data->m_instance_quaternion_ptr[srcIndex*4+0];
|
||||
orientation[1] = m_data->m_instance_quaternion_ptr[srcIndex*4+1];
|
||||
orientation[2] = m_data->m_instance_quaternion_ptr[srcIndex*4+2];
|
||||
@ -640,11 +642,11 @@ void GLInstancingRenderer::writeTransforms()
|
||||
//B3_PROFILE("b3Assert(glGetError() 2");
|
||||
b3Assert(glGetError() ==GL_NO_ERROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifdef B3_DEBUG
|
||||
{
|
||||
|
||||
|
||||
//B3_PROFILE("m_data->m_totalNumInstances == totalNumInstances");
|
||||
|
||||
int totalNumInstances= 0;
|
||||
@ -693,8 +695,8 @@ void GLInstancingRenderer::writeTransforms()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
for (int k=0;k<m_graphicsInstances.size();k++)
|
||||
{
|
||||
@ -703,7 +705,7 @@ void GLInstancingRenderer::writeTransforms()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
char* base = orgBase;
|
||||
|
||||
@ -831,7 +833,7 @@ void GLInstancingRenderer::rebuildGraphicsInstances()
|
||||
curOffset++;
|
||||
int objectUniqueId = m_graphicsInstances[i]->m_tempObjectUids[g];
|
||||
b3PublicGraphicsInstance* pg = m_data->m_publicGraphicsInstances.getHandle(objectUniqueId);
|
||||
|
||||
|
||||
registerGraphicsInstanceInternal(objectUniqueId,pg->m_position,pg->m_orientation,pg->m_color,pg->m_scale);
|
||||
}
|
||||
}
|
||||
@ -857,7 +859,7 @@ int GLInstancingRenderer::registerGraphicsInstanceInternal(int newUid, const flo
|
||||
// b3Assert(pg);
|
||||
// int objectIndex = pg->m_internalInstanceIndex;
|
||||
|
||||
|
||||
|
||||
|
||||
b3GraphicsInstance* gfxObj = m_graphicsInstances[shapeIndex];
|
||||
int index = gfxObj->m_numGraphicsInstances + gfxObj->m_instanceOffset;
|
||||
@ -949,7 +951,7 @@ int GLInstancingRenderer::registerTexture(const unsigned char* texels, int width
|
||||
b3Assert(glGetError() ==GL_NO_ERROR);
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
int textureIndex = m_data->m_textureHandles.size();
|
||||
// const GLubyte* image= (const GLubyte*)texels;
|
||||
// const GLubyte* image= (const GLubyte*)texels;
|
||||
GLuint textureHandle;
|
||||
glGenTextures(1,(GLuint*)&textureHandle);
|
||||
glBindTexture(GL_TEXTURE_2D,textureHandle);
|
||||
@ -1031,7 +1033,7 @@ void GLInstancingRenderer::updateTexture(int textureIndex, const unsigned cha
|
||||
void GLInstancingRenderer::activateTexture(int textureIndex)
|
||||
{
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
|
||||
|
||||
if (textureIndex>=0 && textureIndex < m_data->m_textureHandles.size())
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D,m_data->m_textureHandles[textureIndex].m_glTexture);
|
||||
@ -1057,7 +1059,7 @@ void GLInstancingRenderer::updateShape(int shapeIndex, const float* vertices)
|
||||
glBufferSubData( GL_ARRAY_BUFFER,vertexStrideInBytes*gfxObj->m_vertexArrayOffset,sz,
|
||||
vertices);
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
int GLInstancingRenderer::registerShape(const float* vertices, int numvertices, const int* indices, int numIndices,int primitiveType, int textureId)
|
||||
@ -1087,7 +1089,7 @@ int GLInstancingRenderer::registerShape(const float* vertices, int numvertices,
|
||||
gfxObj->m_numVertices = numvertices;
|
||||
|
||||
|
||||
|
||||
|
||||
int vertexStrideInBytes = 9*sizeof(float);
|
||||
int sz = numvertices*vertexStrideInBytes;
|
||||
int totalUsed = vertexStrideInBytes*gfxObj->m_vertexArrayOffset+sz;
|
||||
@ -1102,10 +1104,10 @@ int GLInstancingRenderer::registerShape(const float* vertices, int numvertices,
|
||||
#if 0
|
||||
|
||||
char* dest= (char*)glMapBuffer( GL_ARRAY_BUFFER,GL_WRITE_ONLY);//GL_WRITE_ONLY
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef B3_DEBUG
|
||||
|
||||
|
||||
#endif//B3_DEBUG
|
||||
|
||||
memcpy(dest+vertexStrideInBytes*gfxObj->m_vertexArrayOffset,vertices,sz);
|
||||
@ -1148,13 +1150,13 @@ void GLInstancingRenderer::InitShaders()
|
||||
|
||||
{
|
||||
triangleShaderProgram = gltLoadShaderPair(triangleVertexShaderText,triangleFragmentShader);
|
||||
|
||||
|
||||
//triangle_vpos_location = glGetAttribLocation(triangleShaderProgram, "vPos");
|
||||
//triangle_vUV_location = glGetAttribLocation(triangleShaderProgram, "vUV");
|
||||
|
||||
triangle_mvp_location = glGetUniformLocation(triangleShaderProgram, "MVP");
|
||||
triangle_vcol_location = glGetUniformLocation(triangleShaderProgram, "vCol");
|
||||
|
||||
|
||||
glLinkProgram(triangleShaderProgram);
|
||||
glUseProgram(triangleShaderProgram);
|
||||
|
||||
@ -1434,7 +1436,7 @@ void GLInstancingRenderer::updateCamera(int upAxis)
|
||||
m_data->m_activeCamera->getCameraViewMatrix(m_data->m_viewMatrix);
|
||||
b3Scalar viewMat[16];
|
||||
b3Scalar viewMatInverse[16];
|
||||
|
||||
|
||||
for (int i=0;i<16;i++)
|
||||
{
|
||||
viewMat[i] = m_data->m_viewMatrix[i];
|
||||
@ -1688,7 +1690,7 @@ void GLInstancingRenderer::drawTexturedTriangleMesh(float worldPosition[3], floa
|
||||
b3Quaternion orn(worldOrientation[0],worldOrientation[1],worldOrientation[2],worldOrientation[3]);
|
||||
b3Vector3 pos = b3MakeVector3(worldPosition[0],worldPosition[1],worldPosition[2]);
|
||||
|
||||
|
||||
|
||||
b3Transform worldTrans(orn,pos);
|
||||
b3Scalar worldMatUnk[16];
|
||||
worldTrans.getOpenGLMatrix(worldMatUnk);
|
||||
@ -1706,7 +1708,7 @@ void GLInstancingRenderer::drawTexturedTriangleMesh(float worldPosition[3], floa
|
||||
|
||||
glUniform3f(triangle_vcol_location,colorRGBA[0],colorRGBA[1],colorRGBA[2]);
|
||||
checkError("glUniform3f");
|
||||
|
||||
|
||||
glBindVertexArray(triangleVertexArrayObject);
|
||||
checkError("glBindVertexArray");
|
||||
|
||||
@ -1721,15 +1723,15 @@ void GLInstancingRenderer::drawTexturedTriangleMesh(float worldPosition[3], floa
|
||||
PointerCaster uvCast;
|
||||
uvCast.m_baseIndex = 8*sizeof(float);
|
||||
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(GfxVertexFormat0), posCast.m_pointer);
|
||||
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, sizeof(GfxVertexFormat0), uvCast.m_pointer);
|
||||
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, sizeof(GfxVertexFormat0), uvCast.m_pointer);
|
||||
checkError("glVertexAttribPointer");
|
||||
glEnableVertexAttribArray(0);
|
||||
glEnableVertexAttribArray(1);
|
||||
|
||||
|
||||
glVertexAttribDivisor(0,0);
|
||||
glVertexAttribDivisor(1,0);
|
||||
checkError("glVertexAttribDivisor");
|
||||
|
||||
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, triangleIndexVbo);
|
||||
int indexBufferSizeInBytes = numIndices*sizeof(int);
|
||||
|
||||
@ -1881,7 +1883,7 @@ void GLInstancingRenderer::drawLine(const double fromIn[4], const double toIn[4]
|
||||
}
|
||||
void GLInstancingRenderer::drawLine(const float from[4], const float to[4], const float color[4], float lineWidth)
|
||||
{
|
||||
|
||||
|
||||
b3Assert(glGetError() ==GL_NO_ERROR);
|
||||
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
@ -1959,9 +1961,9 @@ B3_ATTRIBUTE_ALIGNED16(struct) SortableTransparentInstance
|
||||
B3_ATTRIBUTE_ALIGNED16(struct) TransparentDistanceSortPredicate
|
||||
{
|
||||
|
||||
inline bool operator() (const SortableTransparentInstance& a, const SortableTransparentInstance& b) const
|
||||
inline bool operator() (const SortableTransparentInstance& a, const SortableTransparentInstance& b) const
|
||||
{
|
||||
|
||||
|
||||
return (a.m_projection > b.m_projection);
|
||||
}
|
||||
};
|
||||
@ -2029,7 +2031,7 @@ void GLInstancingRenderer::renderSceneInternal(int orgRenderMode)
|
||||
#else//OLD_SHADOWMAP_INIT
|
||||
//Reduce size of shadowMap if glTexImage2D call fails as may happen in some cases
|
||||
//https://github.com/bulletphysics/bullet3/issues/40
|
||||
|
||||
|
||||
int size;
|
||||
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &size);
|
||||
if (size < shadowMapWidth){
|
||||
@ -2040,8 +2042,8 @@ void GLInstancingRenderer::renderSceneInternal(int orgRenderMode)
|
||||
}
|
||||
GLuint err;
|
||||
do {
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT16,
|
||||
shadowMapWidth, shadowMapHeight,
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT16,
|
||||
shadowMapWidth, shadowMapHeight,
|
||||
0, GL_DEPTH_COMPONENT, GL_FLOAT, 0);
|
||||
err = glGetError();
|
||||
if (err!=GL_NO_ERROR){
|
||||
@ -2155,7 +2157,7 @@ b3Assert(glGetError() ==GL_NO_ERROR);
|
||||
{
|
||||
totalNumInstances+=m_graphicsInstances[i]->m_numGraphicsInstances;
|
||||
}
|
||||
|
||||
|
||||
b3AlignedObjectArray<SortableTransparentInstance> transparentInstances;
|
||||
{
|
||||
int curOffset = 0;
|
||||
@ -2167,18 +2169,18 @@ b3Assert(glGetError() ==GL_NO_ERROR);
|
||||
m_data->m_activeCamera->getCameraForwardVector(fwd);
|
||||
b3Vector3 camForwardVec;
|
||||
camForwardVec.setValue(fwd[0],fwd[1],fwd[2]);
|
||||
|
||||
|
||||
|
||||
|
||||
for (int obj=0;obj<m_graphicsInstances.size();obj++)
|
||||
{
|
||||
b3GraphicsInstance* gfxObj = m_graphicsInstances[obj];
|
||||
if (gfxObj->m_numGraphicsInstances)
|
||||
{
|
||||
SortableTransparentInstance inst;
|
||||
|
||||
|
||||
inst.m_shapeIndex = obj;
|
||||
|
||||
|
||||
|
||||
|
||||
if ((gfxObj->m_flags&eGfxTransparency)==0)
|
||||
{
|
||||
inst.m_instanceId = curOffset;
|
||||
@ -2207,12 +2209,12 @@ b3Assert(glGetError() ==GL_NO_ERROR);
|
||||
}
|
||||
}
|
||||
TransparentDistanceSortPredicate sorter;
|
||||
|
||||
|
||||
transparentInstances.quickSort(sorter);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//two passes: first for opaque instances, second for transparent ones.
|
||||
for (int pass = 0; pass<2;pass++)
|
||||
{
|
||||
@ -2222,17 +2224,17 @@ b3Assert(glGetError() ==GL_NO_ERROR);
|
||||
int shapeIndex = transparentInstances[i].m_shapeIndex;
|
||||
|
||||
b3GraphicsInstance* gfxObj = m_graphicsInstances[shapeIndex];
|
||||
|
||||
|
||||
//only draw stuff (opaque/transparent) if it is the right pass
|
||||
int drawThisPass = (pass==0) == ((gfxObj->m_flags&eGfxTransparency)==0);
|
||||
|
||||
//transparent objects don't cast shadows (to simplify things)
|
||||
if (gfxObj->m_flags&eGfxTransparency)
|
||||
if (gfxObj->m_flags&eGfxTransparency)
|
||||
{
|
||||
if (renderMode==B3_CREATE_SHADOWMAP_RENDERMODE)
|
||||
drawThisPass = 0;
|
||||
}
|
||||
|
||||
|
||||
if (drawThisPass && gfxObj->m_numGraphicsInstances)
|
||||
{
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
@ -2358,7 +2360,7 @@ b3Assert(glGetError() ==GL_NO_ERROR);
|
||||
glUseProgram(instancingShader);
|
||||
glUniformMatrix4fv(ProjectionMatrix, 1, false, &m_data->m_projectionMatrix[0]);
|
||||
glUniformMatrix4fv(ModelViewMatrix, 1, false, &m_data->m_viewMatrix[0]);
|
||||
|
||||
|
||||
b3Vector3 gLightDir = m_data->m_lightPos;
|
||||
gLightDir.normalize();
|
||||
glUniform3f(regularLightDirIn,gLightDir[0],gLightDir[1],gLightDir[2]);
|
||||
@ -2367,7 +2369,7 @@ b3Assert(glGetError() ==GL_NO_ERROR);
|
||||
|
||||
if ( gfxObj->m_flags&eGfxTransparency)
|
||||
{
|
||||
|
||||
|
||||
int instanceId = transparentInstances[i].m_instanceId;
|
||||
glVertexAttribPointer(1, 4, GL_FLOAT, GL_FALSE, 0, (GLvoid *)((instanceId)*4*sizeof(float)+m_data->m_maxShapeCapacityInBytes));
|
||||
glVertexAttribPointer(2, 4, GL_FLOAT, GL_FALSE, 0, (GLvoid *)((instanceId)*4*sizeof(float)+m_data->m_maxShapeCapacityInBytes+POSITION_BUFFER_SIZE));
|
||||
@ -2375,18 +2377,18 @@ b3Assert(glGetError() ==GL_NO_ERROR);
|
||||
glVertexAttribPointer(6, 3, GL_FLOAT, GL_FALSE, 0, (GLvoid *)((instanceId)*3*sizeof(float)+m_data->m_maxShapeCapacityInBytes+POSITION_BUFFER_SIZE+ORIENTATION_BUFFER_SIZE+COLOR_BUFFER_SIZE));
|
||||
|
||||
glDrawElements(GL_TRIANGLES, indexCount, GL_UNSIGNED_INT, 0);
|
||||
|
||||
|
||||
} else
|
||||
{
|
||||
glDrawElementsInstanced(GL_TRIANGLES, indexCount, GL_UNSIGNED_INT, indexOffset, gfxObj->m_numGraphicsInstances);
|
||||
}
|
||||
|
||||
|
||||
if ( gfxObj->m_flags&eGfxTransparency)
|
||||
{
|
||||
glDisable (GL_BLEND);
|
||||
glDepthMask(true);
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
case B3_CREATE_SHADOWMAP_RENDERMODE:
|
||||
@ -2405,7 +2407,7 @@ b3Assert(glGetError() ==GL_NO_ERROR);
|
||||
glEnable (GL_BLEND);
|
||||
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
|
||||
|
||||
glUseProgram(useShadowMapInstancingShader);
|
||||
glUniformMatrix4fv(useShadow_ProjectionMatrix, 1, false, &m_data->m_projectionMatrix[0]);
|
||||
//glUniformMatrix4fv(useShadow_ModelViewMatrix, 1, false, &m_data->m_viewMatrix[0]);
|
||||
@ -2416,7 +2418,7 @@ b3Assert(glGetError() ==GL_NO_ERROR);
|
||||
glUniform3f(useShadow_lightSpecularIntensity, m_data->m_lightSpecularIntensity[0],m_data->m_lightSpecularIntensity[1],m_data->m_lightSpecularIntensity[2]);
|
||||
glUniform3f(useShadow_materialSpecularColor, gfxObj->m_materialSpecularColor[0],gfxObj->m_materialSpecularColor[1],gfxObj->m_materialSpecularColor[2]);
|
||||
|
||||
|
||||
|
||||
|
||||
float MVP[16];
|
||||
if (reflectionPass)
|
||||
@ -2434,7 +2436,7 @@ b3Assert(glGetError() ==GL_NO_ERROR);
|
||||
b3Matrix4x4Mul16(m_data->m_projectionMatrix,m_data->m_viewMatrix,MVP);
|
||||
glCullFace(GL_BACK);
|
||||
}
|
||||
|
||||
|
||||
glUniformMatrix4fv(useShadow_MVP, 1, false, &MVP[0]);
|
||||
//gLightDir.normalize();
|
||||
glUniform3f(useShadow_lightPosIn,m_data->m_lightPos[0],m_data->m_lightPos[1],m_data->m_lightPos[2]);
|
||||
@ -2442,14 +2444,14 @@ b3Assert(glGetError() ==GL_NO_ERROR);
|
||||
m_data->m_activeCamera->getCameraPosition(camPos);
|
||||
glUniform3f(useShadow_cameraPositionIn,camPos[0],camPos[1],camPos[2]);
|
||||
glUniform1f(useShadow_materialShininessIn,gfxObj->m_materialShinyNess);
|
||||
|
||||
|
||||
glUniformMatrix4fv(useShadow_DepthBiasModelViewMatrix, 1, false, &depthBiasMVP[0][0]);
|
||||
glActiveTexture(GL_TEXTURE1);
|
||||
glBindTexture(GL_TEXTURE_2D, m_data->m_shadowTexture);
|
||||
glUniform1i(useShadow_shadowMap,1);
|
||||
|
||||
|
||||
//sort transparent objects
|
||||
|
||||
|
||||
//gfxObj->m_instanceOffset
|
||||
|
||||
if ( gfxObj->m_flags&eGfxTransparency)
|
||||
@ -2464,7 +2466,7 @@ b3Assert(glGetError() ==GL_NO_ERROR);
|
||||
{
|
||||
glDrawElementsInstanced(GL_TRIANGLES, indexCount, GL_UNSIGNED_INT, indexOffset, gfxObj->m_numGraphicsInstances);
|
||||
}
|
||||
|
||||
|
||||
if ( gfxObj->m_flags&eGfxTransparency)
|
||||
{
|
||||
glDisable (GL_BLEND);
|
||||
|
@ -170,17 +170,19 @@ void dumpInfo(void)
|
||||
if (m_resizeCallback)
|
||||
{
|
||||
(*m_resizeCallback)(width,height);
|
||||
}
|
||||
#ifndef NO_OPENGL3
|
||||
NSRect backingBounds = [self convertRectToBacking:[self bounds]];
|
||||
GLsizei backingPixelWidth = (GLsizei)(backingBounds.size.width),
|
||||
backingPixelHeight = (GLsizei)(backingBounds.size.height);
|
||||
|
||||
// Set viewport
|
||||
glViewport(0, 0, backingPixelWidth, backingPixelHeight);
|
||||
#else
|
||||
glViewport(0,0,(GLsizei)width,(GLsizei)height);
|
||||
|
||||
#ifndef NO_OPENGL3
|
||||
NSRect backingBounds = [self convertRectToBacking:[self bounds]];
|
||||
GLsizei backingPixelWidth = (GLsizei)(backingBounds.size.width),
|
||||
backingPixelHeight = (GLsizei)(backingBounds.size.height);
|
||||
|
||||
// Set viewport
|
||||
glViewport(0, 0, backingPixelWidth, backingPixelHeight);
|
||||
#else
|
||||
glViewport(0,0,(GLsizei)width,(GLsizei)height);
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[m_context setView: self];
|
||||
@ -236,7 +238,7 @@ void dumpInfo(void)
|
||||
[fmt release];
|
||||
[m_context makeCurrentContext];
|
||||
|
||||
checkError("makeCurrentContext");
|
||||
//checkError("makeCurrentContext");
|
||||
}
|
||||
|
||||
-(void) MakeCurrent
|
||||
@ -400,7 +402,9 @@ int Mac_createWindow(struct MacOpenGLWindowInternalData* m_internalData,struct M
|
||||
///ci.m_resizeCallback];
|
||||
|
||||
[m_internalData->m_myview initWithFrame: frame];
|
||||
|
||||
|
||||
|
||||
|
||||
// OpenGL init!
|
||||
[m_internalData->m_myview MakeContext : ci->m_openglVersion];
|
||||
|
||||
@ -420,7 +424,7 @@ int Mac_createWindow(struct MacOpenGLWindowInternalData* m_internalData,struct M
|
||||
|
||||
// float newBackingScaleFactor = [m_internalData->m_window backingScaleFactor];
|
||||
|
||||
dumpInfo();
|
||||
//dumpInfo();
|
||||
|
||||
|
||||
|
||||
@ -479,6 +483,11 @@ int Mac_createWindow(struct MacOpenGLWindowInternalData* m_internalData,struct M
|
||||
[m_internalData->m_myApp finishLaunching];
|
||||
[pool release];
|
||||
|
||||
if(!gladLoadGL()) {
|
||||
printf("gladLoadGL failed!\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -21,33 +21,7 @@ subject to the following restrictions:
|
||||
#include "glad/glad.h"
|
||||
#include <GLFW/glfw3.h>
|
||||
#else
|
||||
//think different
|
||||
#if defined(__APPLE__) && !defined (VMDMESA)
|
||||
#include <OpenGL/OpenGL.h>
|
||||
#include <OpenGL/gl.h>
|
||||
#else
|
||||
|
||||
#ifdef GLEW_STATIC
|
||||
#include "CustomGL/glew.h"
|
||||
#else
|
||||
#ifdef NO_GLEW
|
||||
#define GL_GLEXT_LEGACY
|
||||
#include "third_party/GL/gl/include/GL/gl.h"
|
||||
#include "third_party/GL/gl/include/GL/glext.h"
|
||||
#else
|
||||
#include <GL/glew.h>
|
||||
#endif //NO_GLEW
|
||||
#endif //GLEW_STATIC
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#include <windows.h>
|
||||
//#include <GL/gl.h>
|
||||
//#include <GL/glu.h>
|
||||
#else
|
||||
//#include <GL/gl.h>
|
||||
//#include <GL/glu.h>
|
||||
#endif //_WINDOWS
|
||||
#endif //APPLE
|
||||
#include "glad/glad.h"
|
||||
#endif //B3_USE_GLFW
|
||||
//disable glGetError
|
||||
//#undef glGetError
|
||||
|
@ -21,56 +21,8 @@ subject to the following restrictions:
|
||||
#include <glad/glad.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
#else
|
||||
//think different
|
||||
#if defined(__APPLE__) && !defined (VMDMESA)
|
||||
#include <OpenGL/OpenGL.h>
|
||||
//#include <OpenGL/gl.h>
|
||||
//#include <OpenGL/glu.h>
|
||||
//#import <Cocoa/Cocoa.h>
|
||||
#if defined (USE_OPENGL2) || defined (NO_OPENGL3)
|
||||
#include <OpenGL/gl.h>
|
||||
#else
|
||||
#include <OpenGL/gl3.h>
|
||||
#endif
|
||||
#else
|
||||
|
||||
|
||||
#ifdef GLEW_STATIC
|
||||
#include "CustomGL/glew.h"
|
||||
#else
|
||||
#ifdef NO_GLEW
|
||||
#define GL_GLEXT_LEGACY
|
||||
#include "third_party/GL/gl/include/GL/gl.h"
|
||||
#include "third_party/GL/gl/include/GL/glext.h"
|
||||
#else
|
||||
#include <GL/glew.h>
|
||||
#endif //NO_GLEW
|
||||
#endif //GLEW_STATIC
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#include <windows.h>
|
||||
//#include <GL/gl.h>
|
||||
//#include <GL/glu.h>
|
||||
#else
|
||||
//#include <GL/gl.h>
|
||||
//#include <GL/glu.h>
|
||||
#endif //_WINDOWS
|
||||
#endif //APPLE
|
||||
#endif
|
||||
//disable glGetError
|
||||
//#undef glGetError
|
||||
//#define glGetError MyGetError
|
||||
//
|
||||
//GLenum inline MyGetError()
|
||||
//{
|
||||
// return 0;
|
||||
//}
|
||||
|
||||
///on Linux only glDrawElementsInstancedARB is defined?!?
|
||||
//#ifdef __linux
|
||||
//#define glDrawElementsInstanced glDrawElementsInstancedARB
|
||||
//
|
||||
//#endif //__linux
|
||||
#include "glad/glad.h"
|
||||
#endif //B3_USE_GLFW
|
||||
|
||||
#endif //__OPENGL_INCLUDE_H
|
||||
|
||||
|
@ -44,6 +44,8 @@ static SimpleOpenGL2App* gApp2=0;
|
||||
|
||||
static void Simple2ResizeCallback( float widthf, float heightf)
|
||||
{
|
||||
glViewport(0, 0, widthf, heightf);
|
||||
|
||||
int width = (int)widthf;
|
||||
int height = (int)heightf;
|
||||
if (gApp2->m_renderer && gApp2->m_window)
|
||||
@ -139,12 +141,17 @@ SimpleOpenGL2App::SimpleOpenGL2App(const char* title, int width, int height)
|
||||
#ifndef NO_GLEW
|
||||
#ifndef __APPLE__
|
||||
#ifndef _WIN32
|
||||
#ifndef B3_USE_GLFW
|
||||
//some Linux implementations need the 'glewExperimental' to be true
|
||||
glewExperimental = GL_TRUE;
|
||||
#endif//B3_USE_GLFW
|
||||
#endif //_WIN32
|
||||
|
||||
#ifndef B3_USE_GLFW
|
||||
if (glewInit() != GLEW_OK)
|
||||
//gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);
|
||||
|
||||
|
||||
#if 0
|
||||
if (glewInit() != GLEW_OK)
|
||||
{
|
||||
b3Error("glewInit failed");
|
||||
exit(1);
|
||||
@ -154,6 +161,7 @@ SimpleOpenGL2App::SimpleOpenGL2App(const char* title, int width, int height)
|
||||
b3Error("GLEW_VERSION_2_1 needs to support 2_1");
|
||||
exit(1); // or handle the error in a nicer way
|
||||
}
|
||||
#endif
|
||||
#endif //B3_USE_GLFW
|
||||
#endif //__APPLE__
|
||||
#endif //NO_GLEW
|
||||
|
@ -71,6 +71,8 @@ static SimpleOpenGL3App* gApp=0;
|
||||
|
||||
static void SimpleResizeCallback( float widthf, float heightf)
|
||||
{
|
||||
|
||||
|
||||
int width = (int)widthf;
|
||||
int height = (int)heightf;
|
||||
if (gApp && gApp->m_instancingRenderer)
|
||||
@ -285,6 +287,14 @@ struct MyRenderCallbacks : public RenderCallbacks
|
||||
}
|
||||
};
|
||||
|
||||
static void printGLString(const char *name, GLenum s) {
|
||||
const char *v = (const char *) glGetString(s);
|
||||
printf("%s = %s\n",name, v);
|
||||
}
|
||||
|
||||
bool sOpenGLVerbose = true;
|
||||
|
||||
|
||||
SimpleOpenGL3App::SimpleOpenGL3App( const char* title, int width,int height, bool allowRetina)
|
||||
{
|
||||
gApp = this;
|
||||
@ -308,7 +318,16 @@ SimpleOpenGL3App::SimpleOpenGL3App( const char* title, int width,int height, boo
|
||||
|
||||
m_window->setWindowTitle(title);
|
||||
|
||||
|
||||
|
||||
|
||||
b3Assert(glGetError() ==GL_NO_ERROR);
|
||||
|
||||
{
|
||||
printGLString("Version", GL_VERSION);
|
||||
printGLString("Vendor", GL_VENDOR);
|
||||
printGLString("Renderer", GL_RENDERER);
|
||||
}
|
||||
|
||||
glClearColor( m_backgroundColorRGB[0],
|
||||
m_backgroundColorRGB[1],
|
||||
@ -321,11 +340,16 @@ SimpleOpenGL3App::SimpleOpenGL3App( const char* title, int width,int height, boo
|
||||
|
||||
b3Assert(glGetError() ==GL_NO_ERROR);
|
||||
|
||||
#ifndef NO_GLEW
|
||||
//gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);
|
||||
|
||||
|
||||
#ifdef USE_GLEW
|
||||
#ifndef __APPLE__
|
||||
#ifndef _WIN32
|
||||
#ifndef B3_USE_GLFW
|
||||
//some Linux implementations need the 'glewExperimental' to be true
|
||||
glewExperimental = GL_TRUE;
|
||||
#endif //B3_USE_GLFW
|
||||
#endif //_WIN32
|
||||
|
||||
#ifndef B3_USE_GLFW
|
||||
@ -335,7 +359,8 @@ SimpleOpenGL3App::SimpleOpenGL3App( const char* title, int width,int height, boo
|
||||
exit(1); // or handle the error in a nicer way
|
||||
#endif //B3_USE_GLFW
|
||||
#endif //__APPLE__
|
||||
#endif //NO_GLEW
|
||||
#endif //USE_GLEW
|
||||
|
||||
glGetError();//don't remove this call, it is needed for Ubuntu
|
||||
|
||||
b3Assert(glGetError() ==GL_NO_ERROR);
|
||||
|
@ -18,19 +18,14 @@ subject to the following restrictions:
|
||||
|
||||
#include "Win32OpenGLWindow.h"
|
||||
|
||||
|
||||
#include "OpenGLInclude.h"
|
||||
|
||||
//#include "Bullet3Common/b3Vector3.h"
|
||||
|
||||
#include "Win32InternalWindowData.h"
|
||||
#include <stdio.h>
|
||||
|
||||
static void printGLString(const char *name, GLenum s) {
|
||||
const char *v = (const char *) glGetString(s);
|
||||
printf("%s = %s\n",name, v);
|
||||
}
|
||||
|
||||
bool sOpenGLVerbose = true;
|
||||
#include <stdlib.h>
|
||||
|
||||
void Win32OpenGLWindow::enableOpenGL()
|
||||
{
|
||||
@ -63,12 +58,7 @@ void Win32OpenGLWindow::enableOpenGL()
|
||||
m_data->m_hRC = wglCreateContext( m_data->m_hDC );
|
||||
wglMakeCurrent( m_data->m_hDC, m_data->m_hRC );
|
||||
|
||||
if (sOpenGLVerbose)
|
||||
{
|
||||
printGLString("Version", GL_VERSION);
|
||||
printGLString("Vendor", GL_VENDOR);
|
||||
printGLString("Renderer", GL_RENDERER);
|
||||
}
|
||||
|
||||
//printGLString("Extensions", GL_EXTENSIONS);
|
||||
|
||||
}
|
||||
@ -94,6 +84,12 @@ void Win32OpenGLWindow::createWindow(const b3gWindowConstructionInfo& ci)
|
||||
//VideoDriver = video::createOpenGLDriver(CreationParams, FileSystem, this);
|
||||
enableOpenGL();
|
||||
|
||||
if(!gladLoadGL()) {
|
||||
printf("gladLoadGL failed!\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -147,6 +143,7 @@ void Win32OpenGLWindow::endRendering()
|
||||
|
||||
int Win32OpenGLWindow::fileOpenDialog(char* fileName, int maxFileNameLength)
|
||||
{
|
||||
#if 0
|
||||
//wchar_t wideChars[1024];
|
||||
|
||||
OPENFILENAME ofn ;
|
||||
@ -176,9 +173,9 @@ int Win32OpenGLWindow::fileOpenDialog(char* fileName, int maxFileNameLength)
|
||||
ofn.Flags = OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST ;
|
||||
GetOpenFileName( &ofn );
|
||||
return strlen(fileName);
|
||||
|
||||
|
||||
//return 0;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
int Win32OpenGLWindow::getWidth() const
|
||||
|
@ -413,7 +413,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
sData->m_fullWindowHeight = wr.bottom-wr.top;//LOWORD (lParam) HIWORD (lParam);
|
||||
sData->m_openglViewportWidth = clientRect.right;
|
||||
sData->m_openglViewportHeight = clientRect.bottom;
|
||||
glViewport(0, 0, sData->m_openglViewportWidth, sData->m_openglViewportHeight);
|
||||
//glViewport(0, 0, sData->m_openglViewportWidth, sData->m_openglViewportHeight);
|
||||
|
||||
if (sData->m_resizeCallback)
|
||||
(*sData->m_resizeCallback)(sData->m_openglViewportWidth,sData->m_openglViewportHeight);
|
||||
|
@ -1,18 +1,21 @@
|
||||
|
||||
#ifndef B3_USE_GLFW
|
||||
|
||||
#include "X11OpenGLWindow.h"
|
||||
#include "OpenGLInclude.h"
|
||||
|
||||
#include<stdio.h>
|
||||
#include<stdlib.h>
|
||||
#ifdef GLEW_STATIC
|
||||
#include "CustomGL/glew.h"
|
||||
#include "glad/glad.h"
|
||||
#else
|
||||
#include <GL/glew.h>
|
||||
#endif//GLEW_STATIC
|
||||
|
||||
#ifdef GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
|
||||
#include "CustomGL/glxew.h"
|
||||
#include "glad/glad_glx.h"
|
||||
#else
|
||||
#include<GL/glx.h>
|
||||
#include "GL/glx.h"
|
||||
#endif // GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
|
||||
#include <assert.h>
|
||||
|
||||
@ -470,20 +473,12 @@ void X11OpenGLWindow::enableOpenGL()
|
||||
glXMakeCurrent(m_data->m_dpy, m_data->m_win, m_data->m_glc);
|
||||
}
|
||||
|
||||
#ifdef GLEW_INIT_OPENGL11_FUNCTIONS
|
||||
{
|
||||
GLboolean res = glewOpenGL11Init();
|
||||
if (res==0)
|
||||
{
|
||||
printf("glewOpenGL11Init OK!\n");
|
||||
} else
|
||||
{
|
||||
fprintf(stderr, "ERROR: glewOpenGL11Init failed, exiting!\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
if(!gladLoadGL()) {
|
||||
printf("gladLoadGL failed!\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
|
||||
#endif //GLEW_INIT_OPENGL11_FUNCTIONS
|
||||
|
||||
const GLubyte* ven = glGetString(GL_VENDOR);
|
||||
printf("GL_VENDOR=%s\n", ven);
|
||||
@ -527,18 +522,16 @@ void X11OpenGLWindow::createWindow(const b3gWindowConstructionInfo& ci)
|
||||
|
||||
m_data->m_root = DefaultRootWindow(m_data->m_dpy);
|
||||
|
||||
|
||||
#ifdef GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
|
||||
GLboolean res = glewXInit();
|
||||
if (res==0)
|
||||
{
|
||||
printf("glewXInit OK\n");
|
||||
} else
|
||||
{
|
||||
fprintf(stderr, "glewXInit failed, exit\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#endif //GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
|
||||
|
||||
int res=gladLoadGLX(m_data->m_dpy,DefaultScreen(m_data->m_dpy));
|
||||
if (!res)
|
||||
{
|
||||
printf("Error in gladLoadGLX\n");
|
||||
exit(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
if (ci.m_openglVersion < 3)
|
||||
@ -1121,3 +1114,4 @@ int X11OpenGLWindow::fileOpenDialog(char* filename, int maxNameLength)
|
||||
return len;
|
||||
|
||||
}
|
||||
#endif
|
||||
|
@ -72,7 +72,7 @@ project ("App_RobotSimulator")
|
||||
|
||||
includedirs {"../../src", "../../examples",
|
||||
"../../examples/ThirdPartyLibs"}
|
||||
defines {"PHYSICS_IN_PROCESS_EXAMPLE_BROWSER"}
|
||||
defines {"B3_USE_ROBOTSIM_GUI", "PHYSICS_IN_PROCESS_EXAMPLE_BROWSER"}
|
||||
|
||||
hasCL = findOpenCL("clew")
|
||||
|
||||
@ -297,4 +297,4 @@ end
|
||||
if os.is("Linux") then
|
||||
initX11()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -144,7 +144,7 @@ ENDIF(INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES)
|
||||
INCLUDE_DIRECTORIES(
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/src
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/Glew
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad
|
||||
)
|
||||
|
||||
ADD_DEFINITIONS(-DB3_USE_STANDALONE_EXAMPLE)
|
||||
@ -220,7 +220,7 @@ IF (WIN32 OR APPLE)
|
||||
INCLUDE_DIRECTORIES(
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/src
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/Glew
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/openvr/headers
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/openvr/samples/shared
|
||||
)
|
||||
|
@ -6587,7 +6587,10 @@ bool PhysicsServerCommandProcessor::processSendPhysicsParametersCommand(const st
|
||||
clientCmd.m_physSimParamArgs.m_gravityAcceleration[1],
|
||||
clientCmd.m_physSimParamArgs.m_gravityAcceleration[2]);
|
||||
this->m_data->m_dynamicsWorld->setGravity(grav);
|
||||
#ifndef SKIP_SOFT_BODY_MULTI_BODY_DYNAMICS_WORLD
|
||||
m_data->m_dynamicsWorld->getWorldInfo().m_gravity=grav;
|
||||
|
||||
#endif
|
||||
if (m_data->m_verboseOutput)
|
||||
{
|
||||
b3Printf("Updated Gravity: %f,%f,%f",grav[0],grav[1],grav[2]);
|
||||
|
@ -78,7 +78,7 @@ int main(int argc, char* argv[])
|
||||
b3CommandLineArgs myArgs(argc, argv);
|
||||
|
||||
|
||||
SimpleOpenGLApp* app = new SimpleOpenGLApp("SimpleOpenGL3App", gWidth, gHeight);
|
||||
SimpleOpenGLApp* app = new SimpleOpenGLApp("SimpleOpenGL3App", 1024, 768);
|
||||
|
||||
app->m_renderer->getActiveCamera()->setCameraDistance(13);
|
||||
app->m_renderer->getActiveCamera()->setCameraPitch(0);
|
||||
|
@ -2,6 +2,7 @@
|
||||
#ifdef BT_USE_CUSTOM_PROFILER
|
||||
#endif
|
||||
|
||||
|
||||
//========= Copyright Valve Corporation ============//
|
||||
|
||||
#include "../OpenGLWindow/SimpleOpenGL3App.h"
|
||||
@ -19,6 +20,12 @@
|
||||
#include "BulletCollision/CollisionShapes/btCollisionShape.h"
|
||||
#include "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h"
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#endif//__APPLE__
|
||||
|
||||
|
||||
#include "LinearMath/btIDebugDraw.h"
|
||||
int gSharedMemoryKey = -1;
|
||||
int gDebugDrawFlags = 0;
|
||||
@ -525,14 +532,6 @@ bool CMainApplication::BInit()
|
||||
}
|
||||
|
||||
|
||||
glewExperimental = GL_TRUE;
|
||||
GLenum nGlewError = glewInit();
|
||||
if (nGlewError != GLEW_OK)
|
||||
{
|
||||
printf( "%s - Error initializing GLEW! %s\n", __FUNCTION__, glewGetErrorString( nGlewError ) );
|
||||
return false;
|
||||
}
|
||||
glGetError(); // to clear the error caused deep in GLEW
|
||||
|
||||
if ( SDL_GL_SetSwapInterval( m_bVblank ? 1 : 0 ) < 0 )
|
||||
{
|
||||
@ -1278,16 +1277,9 @@ bool CMainApplication::SetupTexturemaps()
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR );
|
||||
|
||||
#ifdef WIN32
|
||||
GLfloat fLargest;
|
||||
#ifdef B3_USE_GLFW
|
||||
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY, &fLargest);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY, fLargest);
|
||||
#else
|
||||
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &fLargest);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, fLargest);
|
||||
#endif
|
||||
#endif
|
||||
glBindTexture( GL_TEXTURE_2D, 0 );
|
||||
|
||||
return ( m_iTexture != 0 );
|
||||
@ -2299,16 +2291,9 @@ bool CGLRenderModel::BInit( const vr::RenderModel_t & vrModel, const vr::RenderM
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR );
|
||||
#ifdef _WIN32
|
||||
GLfloat fLargest;
|
||||
#ifdef B3_USE_GLFW
|
||||
glGetFloatv( GL_MAX_TEXTURE_MAX_ANISOTROPY, &fLargest );
|
||||
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY, fLargest );
|
||||
#else
|
||||
glGetFloatv( GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &fLargest );
|
||||
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, fLargest );
|
||||
#endif //B3_USE_GLFW
|
||||
#endif//_WIN32
|
||||
glBindTexture( GL_TEXTURE_2D, 0 );
|
||||
|
||||
m_unVertexCount = vrModel.unTriangleCount * 3;
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@
|
||||
INCLUDE_DIRECTORIES(
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/src
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/Glew
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad
|
||||
)
|
||||
|
||||
IF(NOT WIN32 AND NOT APPLE)
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include <OpenGL/gl.h>
|
||||
#else
|
||||
#ifdef GLEW_STATIC
|
||||
#include "CustomGL/glew.h"
|
||||
#include "glad/glad.h"
|
||||
#else
|
||||
#ifdef NO_GLEW
|
||||
#define GL_GLEXT_LEGACY
|
||||
|
@ -7,7 +7,7 @@
|
||||
APIs: gl=4.6
|
||||
Profile: compatibility
|
||||
Extensions:
|
||||
|
||||
|
||||
Loader: True
|
||||
Local files: False
|
||||
Omit khrplatform: False
|
||||
@ -1939,7 +1939,7 @@ static void load_GL_VERSION_3_0(GLADloadproc load) {
|
||||
glad_glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)load("glFramebufferTexture3D");
|
||||
glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)load("glFramebufferRenderbuffer");
|
||||
glad_glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)load("glGetFramebufferAttachmentParameteriv");
|
||||
|
||||
|
||||
glad_glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)load("glBlitFramebuffer");
|
||||
glad_glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)load("glRenderbufferStorageMultisample");
|
||||
glad_glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)load("glFramebufferTextureLayer");
|
||||
@ -1991,7 +1991,7 @@ static void load_GL_VERSION_3_2(GLADloadproc load) {
|
||||
glad_glSampleMaski = (PFNGLSAMPLEMASKIPROC)load("glSampleMaski");
|
||||
}
|
||||
static void load_GL_VERSION_3_3(GLADloadproc load) {
|
||||
if(!GLAD_GL_VERSION_3_3) return;
|
||||
//if(!GLAD_GL_VERSION_3_3) return;
|
||||
glad_glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)load("glBindFragDataLocationIndexed");
|
||||
glad_glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)load("glGetFragDataIndex");
|
||||
glad_glGenSamplers = (PFNGLGENSAMPLERSPROC)load("glGenSamplers");
|
||||
|
1249
examples/ThirdPartyLibs/glad/glad/glad_glx.h
Normal file
1249
examples/ThirdPartyLibs/glad/glad/glad_glx.h
Normal file
File diff suppressed because it is too large
Load Diff
837
examples/ThirdPartyLibs/glad/glad_glx.c
Normal file
837
examples/ThirdPartyLibs/glad/glad_glx.c
Normal file
@ -0,0 +1,837 @@
|
||||
/*
|
||||
|
||||
GLX loader generated by glad 0.1.16a0 on Tue Feb 20 13:09:25 2018.
|
||||
|
||||
Language/Generator: C/C++
|
||||
Specification: glx
|
||||
APIs: glx=1.4
|
||||
Profile: -
|
||||
Extensions:
|
||||
GLX_3DFX_multisample,
|
||||
GLX_AMD_gpu_association,
|
||||
GLX_ARB_context_flush_control,
|
||||
GLX_ARB_create_context,
|
||||
GLX_ARB_create_context_no_error,
|
||||
GLX_ARB_create_context_profile,
|
||||
GLX_ARB_create_context_robustness,
|
||||
GLX_ARB_fbconfig_float,
|
||||
GLX_ARB_framebuffer_sRGB,
|
||||
GLX_ARB_get_proc_address,
|
||||
GLX_ARB_multisample,
|
||||
GLX_ARB_robustness_application_isolation,
|
||||
GLX_ARB_robustness_share_group_isolation,
|
||||
GLX_ARB_vertex_buffer_object,
|
||||
GLX_EXT_buffer_age,
|
||||
GLX_EXT_create_context_es2_profile,
|
||||
GLX_EXT_create_context_es_profile,
|
||||
GLX_EXT_fbconfig_packed_float,
|
||||
GLX_EXT_framebuffer_sRGB,
|
||||
GLX_EXT_import_context,
|
||||
GLX_EXT_libglvnd,
|
||||
GLX_EXT_no_config_context,
|
||||
GLX_EXT_stereo_tree,
|
||||
GLX_EXT_swap_control,
|
||||
GLX_EXT_swap_control_tear,
|
||||
GLX_EXT_texture_from_pixmap,
|
||||
GLX_EXT_visual_info,
|
||||
GLX_EXT_visual_rating,
|
||||
GLX_INTEL_swap_event,
|
||||
GLX_MESA_agp_offset,
|
||||
GLX_MESA_copy_sub_buffer,
|
||||
GLX_MESA_pixmap_colormap,
|
||||
GLX_MESA_query_renderer,
|
||||
GLX_MESA_release_buffers,
|
||||
GLX_MESA_set_3dfx_mode,
|
||||
GLX_MESA_swap_control,
|
||||
GLX_NV_copy_buffer,
|
||||
GLX_NV_copy_image,
|
||||
GLX_NV_delay_before_swap,
|
||||
GLX_NV_float_buffer,
|
||||
GLX_NV_multisample_coverage,
|
||||
GLX_NV_present_video,
|
||||
GLX_NV_robustness_video_memory_purge,
|
||||
GLX_NV_swap_group,
|
||||
GLX_NV_video_capture,
|
||||
GLX_NV_video_out,
|
||||
GLX_OML_swap_method,
|
||||
GLX_OML_sync_control,
|
||||
GLX_SGIS_blended_overlay,
|
||||
GLX_SGIS_multisample,
|
||||
GLX_SGIS_shared_multisample,
|
||||
GLX_SGIX_dmbuffer,
|
||||
GLX_SGIX_fbconfig,
|
||||
GLX_SGIX_hyperpipe,
|
||||
GLX_SGIX_pbuffer,
|
||||
GLX_SGIX_swap_barrier,
|
||||
GLX_SGIX_swap_group,
|
||||
GLX_SGIX_video_resize,
|
||||
GLX_SGIX_video_source,
|
||||
GLX_SGIX_visual_select_group,
|
||||
GLX_SGI_cushion,
|
||||
GLX_SGI_make_current_read,
|
||||
GLX_SGI_swap_control,
|
||||
GLX_SGI_video_sync,
|
||||
GLX_SUN_get_transparent_index
|
||||
Loader: True
|
||||
Local files: False
|
||||
Omit khrplatform: False
|
||||
|
||||
Commandline:
|
||||
--api="glx=1.4" --generator="c" --spec="glx" --extensions="GLX_3DFX_multisample,GLX_AMD_gpu_association,GLX_ARB_context_flush_control,GLX_ARB_create_context,GLX_ARB_create_context_no_error,GLX_ARB_create_context_profile,GLX_ARB_create_context_robustness,GLX_ARB_fbconfig_float,GLX_ARB_framebuffer_sRGB,GLX_ARB_get_proc_address,GLX_ARB_multisample,GLX_ARB_robustness_application_isolation,GLX_ARB_robustness_share_group_isolation,GLX_ARB_vertex_buffer_object,GLX_EXT_buffer_age,GLX_EXT_create_context_es2_profile,GLX_EXT_create_context_es_profile,GLX_EXT_fbconfig_packed_float,GLX_EXT_framebuffer_sRGB,GLX_EXT_import_context,GLX_EXT_libglvnd,GLX_EXT_no_config_context,GLX_EXT_stereo_tree,GLX_EXT_swap_control,GLX_EXT_swap_control_tear,GLX_EXT_texture_from_pixmap,GLX_EXT_visual_info,GLX_EXT_visual_rating,GLX_INTEL_swap_event,GLX_MESA_agp_offset,GLX_MESA_copy_sub_buffer,GLX_MESA_pixmap_colormap,GLX_MESA_query_renderer,GLX_MESA_release_buffers,GLX_MESA_set_3dfx_mode,GLX_MESA_swap_control,GLX_NV_copy_buffer,GLX_NV_copy_image,GLX_NV_delay_before_swap,GLX_NV_float_buffer,GLX_NV_multisample_coverage,GLX_NV_present_video,GLX_NV_robustness_video_memory_purge,GLX_NV_swap_group,GLX_NV_video_capture,GLX_NV_video_out,GLX_OML_swap_method,GLX_OML_sync_control,GLX_SGIS_blended_overlay,GLX_SGIS_multisample,GLX_SGIS_shared_multisample,GLX_SGIX_dmbuffer,GLX_SGIX_fbconfig,GLX_SGIX_hyperpipe,GLX_SGIX_pbuffer,GLX_SGIX_swap_barrier,GLX_SGIX_swap_group,GLX_SGIX_video_resize,GLX_SGIX_video_source,GLX_SGIX_visual_select_group,GLX_SGI_cushion,GLX_SGI_make_current_read,GLX_SGI_swap_control,GLX_SGI_video_sync,GLX_SUN_get_transparent_index"
|
||||
Online:
|
||||
Too many extensions
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <glad/glad_glx.h>
|
||||
|
||||
static void* get_proc(const char *namez);
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
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 <dlfcn.h>
|
||||
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(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 gladLoadGLX(Display *dpy, int screen) {
|
||||
int status = 0;
|
||||
|
||||
if(open_gl()) {
|
||||
status = gladLoadGLXLoader((GLADloadproc)get_proc, dpy, screen);
|
||||
//close_gl();
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
static Display *GLADGLXDisplay = 0;
|
||||
static int GLADGLXscreen = 0;
|
||||
|
||||
static int get_exts(void) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void free_exts(void) {
|
||||
return;
|
||||
}
|
||||
|
||||
static int has_ext(const char *ext) {
|
||||
const char *terminator;
|
||||
const char *loc;
|
||||
const char *extensions;
|
||||
|
||||
if(!GLAD_GLX_VERSION_1_1)
|
||||
return 0;
|
||||
|
||||
extensions = glXQueryExtensionsString(GLADGLXDisplay, GLADGLXscreen);
|
||||
|
||||
if(extensions == NULL || ext == NULL)
|
||||
return 0;
|
||||
|
||||
while(1) {
|
||||
loc = strstr(extensions, ext);
|
||||
if(loc == NULL)
|
||||
break;
|
||||
|
||||
terminator = loc + strlen(ext);
|
||||
if((loc == extensions || *(loc - 1) == ' ') &&
|
||||
(*terminator == ' ' || *terminator == '\0'))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
extensions = terminator;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int GLAD_GLX_VERSION_1_0;
|
||||
int GLAD_GLX_VERSION_1_1;
|
||||
int GLAD_GLX_VERSION_1_2;
|
||||
int GLAD_GLX_VERSION_1_3;
|
||||
int GLAD_GLX_VERSION_1_4;
|
||||
PFNGLXGETSELECTEDEVENTPROC glad_glXGetSelectedEvent;
|
||||
PFNGLXQUERYEXTENSIONPROC glad_glXQueryExtension;
|
||||
PFNGLXMAKECURRENTPROC glad_glXMakeCurrent;
|
||||
PFNGLXSELECTEVENTPROC glad_glXSelectEvent;
|
||||
PFNGLXCREATECONTEXTPROC glad_glXCreateContext;
|
||||
PFNGLXCREATEGLXPIXMAPPROC glad_glXCreateGLXPixmap;
|
||||
PFNGLXQUERYVERSIONPROC glad_glXQueryVersion;
|
||||
PFNGLXGETCURRENTREADDRAWABLEPROC glad_glXGetCurrentReadDrawable;
|
||||
PFNGLXDESTROYPIXMAPPROC glad_glXDestroyPixmap;
|
||||
PFNGLXGETCURRENTCONTEXTPROC glad_glXGetCurrentContext;
|
||||
PFNGLXGETPROCADDRESSPROC glad_glXGetProcAddress;
|
||||
PFNGLXWAITGLPROC glad_glXWaitGL;
|
||||
PFNGLXISDIRECTPROC glad_glXIsDirect;
|
||||
PFNGLXDESTROYWINDOWPROC glad_glXDestroyWindow;
|
||||
PFNGLXCREATEWINDOWPROC glad_glXCreateWindow;
|
||||
PFNGLXCOPYCONTEXTPROC glad_glXCopyContext;
|
||||
PFNGLXCREATEPBUFFERPROC glad_glXCreatePbuffer;
|
||||
PFNGLXSWAPBUFFERSPROC glad_glXSwapBuffers;
|
||||
PFNGLXGETCURRENTDISPLAYPROC glad_glXGetCurrentDisplay;
|
||||
PFNGLXGETCURRENTDRAWABLEPROC glad_glXGetCurrentDrawable;
|
||||
PFNGLXQUERYCONTEXTPROC glad_glXQueryContext;
|
||||
PFNGLXCHOOSEVISUALPROC glad_glXChooseVisual;
|
||||
PFNGLXQUERYSERVERSTRINGPROC glad_glXQueryServerString;
|
||||
PFNGLXDESTROYCONTEXTPROC glad_glXDestroyContext;
|
||||
PFNGLXDESTROYGLXPIXMAPPROC glad_glXDestroyGLXPixmap;
|
||||
PFNGLXGETFBCONFIGATTRIBPROC glad_glXGetFBConfigAttrib;
|
||||
PFNGLXUSEXFONTPROC glad_glXUseXFont;
|
||||
PFNGLXDESTROYPBUFFERPROC glad_glXDestroyPbuffer;
|
||||
PFNGLXCHOOSEFBCONFIGPROC glad_glXChooseFBConfig;
|
||||
PFNGLXCREATENEWCONTEXTPROC glad_glXCreateNewContext;
|
||||
PFNGLXMAKECONTEXTCURRENTPROC glad_glXMakeContextCurrent;
|
||||
PFNGLXGETCONFIGPROC glad_glXGetConfig;
|
||||
PFNGLXGETFBCONFIGSPROC glad_glXGetFBConfigs;
|
||||
PFNGLXCREATEPIXMAPPROC glad_glXCreatePixmap;
|
||||
PFNGLXWAITXPROC glad_glXWaitX;
|
||||
PFNGLXGETVISUALFROMFBCONFIGPROC glad_glXGetVisualFromFBConfig;
|
||||
PFNGLXQUERYDRAWABLEPROC glad_glXQueryDrawable;
|
||||
PFNGLXQUERYEXTENSIONSSTRINGPROC glad_glXQueryExtensionsString;
|
||||
PFNGLXGETCLIENTSTRINGPROC glad_glXGetClientString;
|
||||
int GLAD_GLX_ARB_framebuffer_sRGB;
|
||||
int GLAD_GLX_EXT_import_context;
|
||||
int GLAD_GLX_NV_float_buffer;
|
||||
int GLAD_GLX_EXT_libglvnd;
|
||||
int GLAD_GLX_SGIS_shared_multisample;
|
||||
int GLAD_GLX_SGIX_pbuffer;
|
||||
int GLAD_GLX_EXT_no_config_context;
|
||||
int GLAD_GLX_ARB_fbconfig_float;
|
||||
int GLAD_GLX_SGIX_hyperpipe;
|
||||
int GLAD_GLX_MESA_set_3dfx_mode;
|
||||
int GLAD_GLX_INTEL_swap_event;
|
||||
int GLAD_GLX_SGIX_video_resize;
|
||||
int GLAD_GLX_MESA_pixmap_colormap;
|
||||
int GLAD_GLX_EXT_create_context_es2_profile;
|
||||
int GLAD_GLX_ARB_robustness_application_isolation;
|
||||
int GLAD_GLX_NV_copy_image;
|
||||
int GLAD_GLX_NV_swap_group;
|
||||
int GLAD_GLX_OML_sync_control;
|
||||
int GLAD_GLX_EXT_framebuffer_sRGB;
|
||||
int GLAD_GLX_ARB_create_context_robustness;
|
||||
int GLAD_GLX_OML_swap_method;
|
||||
int GLAD_GLX_EXT_fbconfig_packed_float;
|
||||
int GLAD_GLX_EXT_buffer_age;
|
||||
int GLAD_GLX_3DFX_multisample;
|
||||
int GLAD_GLX_EXT_visual_info;
|
||||
int GLAD_GLX_SGI_video_sync;
|
||||
int GLAD_GLX_NV_video_capture;
|
||||
int GLAD_GLX_SGIS_multisample;
|
||||
int GLAD_GLX_EXT_texture_from_pixmap;
|
||||
int GLAD_GLX_NV_video_out;
|
||||
int GLAD_GLX_ARB_multisample;
|
||||
int GLAD_GLX_MESA_swap_control;
|
||||
int GLAD_GLX_NV_delay_before_swap;
|
||||
int GLAD_GLX_SGI_make_current_read;
|
||||
int GLAD_GLX_SGIX_swap_group;
|
||||
int GLAD_GLX_EXT_swap_control;
|
||||
int GLAD_GLX_SGIX_video_source;
|
||||
int GLAD_GLX_MESA_query_renderer;
|
||||
int GLAD_GLX_NV_robustness_video_memory_purge;
|
||||
int GLAD_GLX_ARB_create_context;
|
||||
int GLAD_GLX_ARB_context_flush_control;
|
||||
int GLAD_GLX_ARB_robustness_share_group_isolation;
|
||||
int GLAD_GLX_EXT_stereo_tree;
|
||||
int GLAD_GLX_SGI_swap_control;
|
||||
int GLAD_GLX_SGIX_dmbuffer;
|
||||
int GLAD_GLX_SGIX_visual_select_group;
|
||||
int GLAD_GLX_SGIS_blended_overlay;
|
||||
int GLAD_GLX_NV_multisample_coverage;
|
||||
int GLAD_GLX_EXT_create_context_es_profile;
|
||||
int GLAD_GLX_SGIX_fbconfig;
|
||||
int GLAD_GLX_EXT_swap_control_tear;
|
||||
int GLAD_GLX_SGI_cushion;
|
||||
int GLAD_GLX_MESA_release_buffers;
|
||||
int GLAD_GLX_EXT_visual_rating;
|
||||
int GLAD_GLX_MESA_copy_sub_buffer;
|
||||
int GLAD_GLX_MESA_agp_offset;
|
||||
int GLAD_GLX_NV_copy_buffer;
|
||||
int GLAD_GLX_ARB_create_context_no_error;
|
||||
int GLAD_GLX_NV_present_video;
|
||||
int GLAD_GLX_SUN_get_transparent_index;
|
||||
int GLAD_GLX_AMD_gpu_association;
|
||||
int GLAD_GLX_ARB_create_context_profile;
|
||||
int GLAD_GLX_SGIX_swap_barrier;
|
||||
int GLAD_GLX_ARB_get_proc_address;
|
||||
int GLAD_GLX_ARB_vertex_buffer_object;
|
||||
PFNGLXGETGPUIDSAMDPROC glad_glXGetGPUIDsAMD;
|
||||
PFNGLXGETGPUINFOAMDPROC glad_glXGetGPUInfoAMD;
|
||||
PFNGLXGETCONTEXTGPUIDAMDPROC glad_glXGetContextGPUIDAMD;
|
||||
PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC glad_glXCreateAssociatedContextAMD;
|
||||
PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC glad_glXCreateAssociatedContextAttribsAMD;
|
||||
PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC glad_glXDeleteAssociatedContextAMD;
|
||||
PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC glad_glXMakeAssociatedContextCurrentAMD;
|
||||
PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC glad_glXGetCurrentAssociatedContextAMD;
|
||||
PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC glad_glXBlitContextFramebufferAMD;
|
||||
PFNGLXCREATECONTEXTATTRIBSARBPROC glad_glXCreateContextAttribsARB;
|
||||
PFNGLXGETPROCADDRESSARBPROC glad_glXGetProcAddressARB;
|
||||
PFNGLXGETCURRENTDISPLAYEXTPROC glad_glXGetCurrentDisplayEXT;
|
||||
PFNGLXQUERYCONTEXTINFOEXTPROC glad_glXQueryContextInfoEXT;
|
||||
PFNGLXGETCONTEXTIDEXTPROC glad_glXGetContextIDEXT;
|
||||
PFNGLXIMPORTCONTEXTEXTPROC glad_glXImportContextEXT;
|
||||
PFNGLXFREECONTEXTEXTPROC glad_glXFreeContextEXT;
|
||||
PFNGLXSWAPINTERVALEXTPROC glad_glXSwapIntervalEXT;
|
||||
PFNGLXBINDTEXIMAGEEXTPROC glad_glXBindTexImageEXT;
|
||||
PFNGLXRELEASETEXIMAGEEXTPROC glad_glXReleaseTexImageEXT;
|
||||
PFNGLXGETAGPOFFSETMESAPROC glad_glXGetAGPOffsetMESA;
|
||||
PFNGLXCOPYSUBBUFFERMESAPROC glad_glXCopySubBufferMESA;
|
||||
PFNGLXCREATEGLXPIXMAPMESAPROC glad_glXCreateGLXPixmapMESA;
|
||||
PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC glad_glXQueryCurrentRendererIntegerMESA;
|
||||
PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC glad_glXQueryCurrentRendererStringMESA;
|
||||
PFNGLXQUERYRENDERERINTEGERMESAPROC glad_glXQueryRendererIntegerMESA;
|
||||
PFNGLXQUERYRENDERERSTRINGMESAPROC glad_glXQueryRendererStringMESA;
|
||||
PFNGLXRELEASEBUFFERSMESAPROC glad_glXReleaseBuffersMESA;
|
||||
PFNGLXSET3DFXMODEMESAPROC glad_glXSet3DfxModeMESA;
|
||||
PFNGLXGETSWAPINTERVALMESAPROC glad_glXGetSwapIntervalMESA;
|
||||
PFNGLXSWAPINTERVALMESAPROC glad_glXSwapIntervalMESA;
|
||||
PFNGLXCOPYBUFFERSUBDATANVPROC glad_glXCopyBufferSubDataNV;
|
||||
PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC glad_glXNamedCopyBufferSubDataNV;
|
||||
PFNGLXCOPYIMAGESUBDATANVPROC glad_glXCopyImageSubDataNV;
|
||||
PFNGLXDELAYBEFORESWAPNVPROC glad_glXDelayBeforeSwapNV;
|
||||
PFNGLXENUMERATEVIDEODEVICESNVPROC glad_glXEnumerateVideoDevicesNV;
|
||||
PFNGLXBINDVIDEODEVICENVPROC glad_glXBindVideoDeviceNV;
|
||||
PFNGLXJOINSWAPGROUPNVPROC glad_glXJoinSwapGroupNV;
|
||||
PFNGLXBINDSWAPBARRIERNVPROC glad_glXBindSwapBarrierNV;
|
||||
PFNGLXQUERYSWAPGROUPNVPROC glad_glXQuerySwapGroupNV;
|
||||
PFNGLXQUERYMAXSWAPGROUPSNVPROC glad_glXQueryMaxSwapGroupsNV;
|
||||
PFNGLXQUERYFRAMECOUNTNVPROC glad_glXQueryFrameCountNV;
|
||||
PFNGLXRESETFRAMECOUNTNVPROC glad_glXResetFrameCountNV;
|
||||
PFNGLXBINDVIDEOCAPTUREDEVICENVPROC glad_glXBindVideoCaptureDeviceNV;
|
||||
PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC glad_glXEnumerateVideoCaptureDevicesNV;
|
||||
PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC glad_glXLockVideoCaptureDeviceNV;
|
||||
PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC glad_glXQueryVideoCaptureDeviceNV;
|
||||
PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC glad_glXReleaseVideoCaptureDeviceNV;
|
||||
PFNGLXGETVIDEODEVICENVPROC glad_glXGetVideoDeviceNV;
|
||||
PFNGLXRELEASEVIDEODEVICENVPROC glad_glXReleaseVideoDeviceNV;
|
||||
PFNGLXBINDVIDEOIMAGENVPROC glad_glXBindVideoImageNV;
|
||||
PFNGLXRELEASEVIDEOIMAGENVPROC glad_glXReleaseVideoImageNV;
|
||||
PFNGLXSENDPBUFFERTOVIDEONVPROC glad_glXSendPbufferToVideoNV;
|
||||
PFNGLXGETVIDEOINFONVPROC glad_glXGetVideoInfoNV;
|
||||
PFNGLXGETSYNCVALUESOMLPROC glad_glXGetSyncValuesOML;
|
||||
PFNGLXGETMSCRATEOMLPROC glad_glXGetMscRateOML;
|
||||
PFNGLXSWAPBUFFERSMSCOMLPROC glad_glXSwapBuffersMscOML;
|
||||
PFNGLXWAITFORMSCOMLPROC glad_glXWaitForMscOML;
|
||||
PFNGLXWAITFORSBCOMLPROC glad_glXWaitForSbcOML;
|
||||
#ifdef _DM_BUFFER_H_
|
||||
PFNGLXASSOCIATEDMPBUFFERSGIXPROC glad_glXAssociateDMPbufferSGIX;
|
||||
#endif
|
||||
PFNGLXGETFBCONFIGATTRIBSGIXPROC glad_glXGetFBConfigAttribSGIX;
|
||||
PFNGLXCHOOSEFBCONFIGSGIXPROC glad_glXChooseFBConfigSGIX;
|
||||
PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC glad_glXCreateGLXPixmapWithConfigSGIX;
|
||||
PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC glad_glXCreateContextWithConfigSGIX;
|
||||
PFNGLXGETVISUALFROMFBCONFIGSGIXPROC glad_glXGetVisualFromFBConfigSGIX;
|
||||
PFNGLXGETFBCONFIGFROMVISUALSGIXPROC glad_glXGetFBConfigFromVisualSGIX;
|
||||
PFNGLXQUERYHYPERPIPENETWORKSGIXPROC glad_glXQueryHyperpipeNetworkSGIX;
|
||||
PFNGLXHYPERPIPECONFIGSGIXPROC glad_glXHyperpipeConfigSGIX;
|
||||
PFNGLXQUERYHYPERPIPECONFIGSGIXPROC glad_glXQueryHyperpipeConfigSGIX;
|
||||
PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC glad_glXDestroyHyperpipeConfigSGIX;
|
||||
PFNGLXBINDHYPERPIPESGIXPROC glad_glXBindHyperpipeSGIX;
|
||||
PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC glad_glXQueryHyperpipeBestAttribSGIX;
|
||||
PFNGLXHYPERPIPEATTRIBSGIXPROC glad_glXHyperpipeAttribSGIX;
|
||||
PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC glad_glXQueryHyperpipeAttribSGIX;
|
||||
PFNGLXCREATEGLXPBUFFERSGIXPROC glad_glXCreateGLXPbufferSGIX;
|
||||
PFNGLXDESTROYGLXPBUFFERSGIXPROC glad_glXDestroyGLXPbufferSGIX;
|
||||
PFNGLXQUERYGLXPBUFFERSGIXPROC glad_glXQueryGLXPbufferSGIX;
|
||||
PFNGLXSELECTEVENTSGIXPROC glad_glXSelectEventSGIX;
|
||||
PFNGLXGETSELECTEDEVENTSGIXPROC glad_glXGetSelectedEventSGIX;
|
||||
PFNGLXBINDSWAPBARRIERSGIXPROC glad_glXBindSwapBarrierSGIX;
|
||||
PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC glad_glXQueryMaxSwapBarriersSGIX;
|
||||
PFNGLXJOINSWAPGROUPSGIXPROC glad_glXJoinSwapGroupSGIX;
|
||||
PFNGLXBINDCHANNELTOWINDOWSGIXPROC glad_glXBindChannelToWindowSGIX;
|
||||
PFNGLXCHANNELRECTSGIXPROC glad_glXChannelRectSGIX;
|
||||
PFNGLXQUERYCHANNELRECTSGIXPROC glad_glXQueryChannelRectSGIX;
|
||||
PFNGLXQUERYCHANNELDELTASSGIXPROC glad_glXQueryChannelDeltasSGIX;
|
||||
PFNGLXCHANNELRECTSYNCSGIXPROC glad_glXChannelRectSyncSGIX;
|
||||
#ifdef _VL_H_
|
||||
PFNGLXCREATEGLXVIDEOSOURCESGIXPROC glad_glXCreateGLXVideoSourceSGIX;
|
||||
PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC glad_glXDestroyGLXVideoSourceSGIX;
|
||||
#endif
|
||||
PFNGLXCUSHIONSGIPROC glad_glXCushionSGI;
|
||||
PFNGLXMAKECURRENTREADSGIPROC glad_glXMakeCurrentReadSGI;
|
||||
PFNGLXGETCURRENTREADDRAWABLESGIPROC glad_glXGetCurrentReadDrawableSGI;
|
||||
PFNGLXSWAPINTERVALSGIPROC glad_glXSwapIntervalSGI;
|
||||
PFNGLXGETVIDEOSYNCSGIPROC glad_glXGetVideoSyncSGI;
|
||||
PFNGLXWAITVIDEOSYNCSGIPROC glad_glXWaitVideoSyncSGI;
|
||||
PFNGLXGETTRANSPARENTINDEXSUNPROC glad_glXGetTransparentIndexSUN;
|
||||
static void load_GLX_VERSION_1_0(GLADloadproc load) {
|
||||
if(!GLAD_GLX_VERSION_1_0) return;
|
||||
glad_glXChooseVisual = (PFNGLXCHOOSEVISUALPROC)load("glXChooseVisual");
|
||||
glad_glXCreateContext = (PFNGLXCREATECONTEXTPROC)load("glXCreateContext");
|
||||
glad_glXDestroyContext = (PFNGLXDESTROYCONTEXTPROC)load("glXDestroyContext");
|
||||
glad_glXMakeCurrent = (PFNGLXMAKECURRENTPROC)load("glXMakeCurrent");
|
||||
glad_glXCopyContext = (PFNGLXCOPYCONTEXTPROC)load("glXCopyContext");
|
||||
glad_glXSwapBuffers = (PFNGLXSWAPBUFFERSPROC)load("glXSwapBuffers");
|
||||
glad_glXCreateGLXPixmap = (PFNGLXCREATEGLXPIXMAPPROC)load("glXCreateGLXPixmap");
|
||||
glad_glXDestroyGLXPixmap = (PFNGLXDESTROYGLXPIXMAPPROC)load("glXDestroyGLXPixmap");
|
||||
glad_glXQueryExtension = (PFNGLXQUERYEXTENSIONPROC)load("glXQueryExtension");
|
||||
glad_glXQueryVersion = (PFNGLXQUERYVERSIONPROC)load("glXQueryVersion");
|
||||
glad_glXIsDirect = (PFNGLXISDIRECTPROC)load("glXIsDirect");
|
||||
glad_glXGetConfig = (PFNGLXGETCONFIGPROC)load("glXGetConfig");
|
||||
glad_glXGetCurrentContext = (PFNGLXGETCURRENTCONTEXTPROC)load("glXGetCurrentContext");
|
||||
glad_glXGetCurrentDrawable = (PFNGLXGETCURRENTDRAWABLEPROC)load("glXGetCurrentDrawable");
|
||||
glad_glXWaitGL = (PFNGLXWAITGLPROC)load("glXWaitGL");
|
||||
glad_glXWaitX = (PFNGLXWAITXPROC)load("glXWaitX");
|
||||
glad_glXUseXFont = (PFNGLXUSEXFONTPROC)load("glXUseXFont");
|
||||
}
|
||||
static void load_GLX_VERSION_1_1(GLADloadproc load) {
|
||||
if(!GLAD_GLX_VERSION_1_1) return;
|
||||
glad_glXQueryExtensionsString = (PFNGLXQUERYEXTENSIONSSTRINGPROC)load("glXQueryExtensionsString");
|
||||
glad_glXQueryServerString = (PFNGLXQUERYSERVERSTRINGPROC)load("glXQueryServerString");
|
||||
glad_glXGetClientString = (PFNGLXGETCLIENTSTRINGPROC)load("glXGetClientString");
|
||||
}
|
||||
static void load_GLX_VERSION_1_2(GLADloadproc load) {
|
||||
if(!GLAD_GLX_VERSION_1_2) return;
|
||||
glad_glXGetCurrentDisplay = (PFNGLXGETCURRENTDISPLAYPROC)load("glXGetCurrentDisplay");
|
||||
}
|
||||
static void load_GLX_VERSION_1_3(GLADloadproc load) {
|
||||
if(!GLAD_GLX_VERSION_1_3) return;
|
||||
glad_glXGetFBConfigs = (PFNGLXGETFBCONFIGSPROC)load("glXGetFBConfigs");
|
||||
glad_glXChooseFBConfig = (PFNGLXCHOOSEFBCONFIGPROC)load("glXChooseFBConfig");
|
||||
glad_glXGetFBConfigAttrib = (PFNGLXGETFBCONFIGATTRIBPROC)load("glXGetFBConfigAttrib");
|
||||
glad_glXGetVisualFromFBConfig = (PFNGLXGETVISUALFROMFBCONFIGPROC)load("glXGetVisualFromFBConfig");
|
||||
glad_glXCreateWindow = (PFNGLXCREATEWINDOWPROC)load("glXCreateWindow");
|
||||
glad_glXDestroyWindow = (PFNGLXDESTROYWINDOWPROC)load("glXDestroyWindow");
|
||||
glad_glXCreatePixmap = (PFNGLXCREATEPIXMAPPROC)load("glXCreatePixmap");
|
||||
glad_glXDestroyPixmap = (PFNGLXDESTROYPIXMAPPROC)load("glXDestroyPixmap");
|
||||
glad_glXCreatePbuffer = (PFNGLXCREATEPBUFFERPROC)load("glXCreatePbuffer");
|
||||
glad_glXDestroyPbuffer = (PFNGLXDESTROYPBUFFERPROC)load("glXDestroyPbuffer");
|
||||
glad_glXQueryDrawable = (PFNGLXQUERYDRAWABLEPROC)load("glXQueryDrawable");
|
||||
glad_glXCreateNewContext = (PFNGLXCREATENEWCONTEXTPROC)load("glXCreateNewContext");
|
||||
glad_glXMakeContextCurrent = (PFNGLXMAKECONTEXTCURRENTPROC)load("glXMakeContextCurrent");
|
||||
glad_glXGetCurrentReadDrawable = (PFNGLXGETCURRENTREADDRAWABLEPROC)load("glXGetCurrentReadDrawable");
|
||||
glad_glXQueryContext = (PFNGLXQUERYCONTEXTPROC)load("glXQueryContext");
|
||||
glad_glXSelectEvent = (PFNGLXSELECTEVENTPROC)load("glXSelectEvent");
|
||||
glad_glXGetSelectedEvent = (PFNGLXGETSELECTEDEVENTPROC)load("glXGetSelectedEvent");
|
||||
}
|
||||
static void load_GLX_VERSION_1_4(GLADloadproc load) {
|
||||
if(!GLAD_GLX_VERSION_1_4) return;
|
||||
glad_glXGetProcAddress = (PFNGLXGETPROCADDRESSPROC)load("glXGetProcAddress");
|
||||
}
|
||||
static void load_GLX_AMD_gpu_association(GLADloadproc load) {
|
||||
if(!GLAD_GLX_AMD_gpu_association) return;
|
||||
glad_glXGetGPUIDsAMD = (PFNGLXGETGPUIDSAMDPROC)load("glXGetGPUIDsAMD");
|
||||
glad_glXGetGPUInfoAMD = (PFNGLXGETGPUINFOAMDPROC)load("glXGetGPUInfoAMD");
|
||||
glad_glXGetContextGPUIDAMD = (PFNGLXGETCONTEXTGPUIDAMDPROC)load("glXGetContextGPUIDAMD");
|
||||
glad_glXCreateAssociatedContextAMD = (PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC)load("glXCreateAssociatedContextAMD");
|
||||
glad_glXCreateAssociatedContextAttribsAMD = (PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC)load("glXCreateAssociatedContextAttribsAMD");
|
||||
glad_glXDeleteAssociatedContextAMD = (PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC)load("glXDeleteAssociatedContextAMD");
|
||||
glad_glXMakeAssociatedContextCurrentAMD = (PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC)load("glXMakeAssociatedContextCurrentAMD");
|
||||
glad_glXGetCurrentAssociatedContextAMD = (PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC)load("glXGetCurrentAssociatedContextAMD");
|
||||
glad_glXBlitContextFramebufferAMD = (PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC)load("glXBlitContextFramebufferAMD");
|
||||
}
|
||||
static void load_GLX_ARB_create_context(GLADloadproc load) {
|
||||
if(!GLAD_GLX_ARB_create_context) return;
|
||||
glad_glXCreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC)load("glXCreateContextAttribsARB");
|
||||
}
|
||||
static void load_GLX_ARB_get_proc_address(GLADloadproc load) {
|
||||
if(!GLAD_GLX_ARB_get_proc_address) return;
|
||||
glad_glXGetProcAddressARB = (PFNGLXGETPROCADDRESSARBPROC)load("glXGetProcAddressARB");
|
||||
}
|
||||
static void load_GLX_EXT_import_context(GLADloadproc load) {
|
||||
if(!GLAD_GLX_EXT_import_context) return;
|
||||
glad_glXGetCurrentDisplayEXT = (PFNGLXGETCURRENTDISPLAYEXTPROC)load("glXGetCurrentDisplayEXT");
|
||||
glad_glXQueryContextInfoEXT = (PFNGLXQUERYCONTEXTINFOEXTPROC)load("glXQueryContextInfoEXT");
|
||||
glad_glXGetContextIDEXT = (PFNGLXGETCONTEXTIDEXTPROC)load("glXGetContextIDEXT");
|
||||
glad_glXImportContextEXT = (PFNGLXIMPORTCONTEXTEXTPROC)load("glXImportContextEXT");
|
||||
glad_glXFreeContextEXT = (PFNGLXFREECONTEXTEXTPROC)load("glXFreeContextEXT");
|
||||
}
|
||||
static void load_GLX_EXT_swap_control(GLADloadproc load) {
|
||||
if(!GLAD_GLX_EXT_swap_control) return;
|
||||
glad_glXSwapIntervalEXT = (PFNGLXSWAPINTERVALEXTPROC)load("glXSwapIntervalEXT");
|
||||
}
|
||||
static void load_GLX_EXT_texture_from_pixmap(GLADloadproc load) {
|
||||
if(!GLAD_GLX_EXT_texture_from_pixmap) return;
|
||||
glad_glXBindTexImageEXT = (PFNGLXBINDTEXIMAGEEXTPROC)load("glXBindTexImageEXT");
|
||||
glad_glXReleaseTexImageEXT = (PFNGLXRELEASETEXIMAGEEXTPROC)load("glXReleaseTexImageEXT");
|
||||
}
|
||||
static void load_GLX_MESA_agp_offset(GLADloadproc load) {
|
||||
if(!GLAD_GLX_MESA_agp_offset) return;
|
||||
glad_glXGetAGPOffsetMESA = (PFNGLXGETAGPOFFSETMESAPROC)load("glXGetAGPOffsetMESA");
|
||||
}
|
||||
static void load_GLX_MESA_copy_sub_buffer(GLADloadproc load) {
|
||||
if(!GLAD_GLX_MESA_copy_sub_buffer) return;
|
||||
glad_glXCopySubBufferMESA = (PFNGLXCOPYSUBBUFFERMESAPROC)load("glXCopySubBufferMESA");
|
||||
}
|
||||
static void load_GLX_MESA_pixmap_colormap(GLADloadproc load) {
|
||||
if(!GLAD_GLX_MESA_pixmap_colormap) return;
|
||||
glad_glXCreateGLXPixmapMESA = (PFNGLXCREATEGLXPIXMAPMESAPROC)load("glXCreateGLXPixmapMESA");
|
||||
}
|
||||
static void load_GLX_MESA_query_renderer(GLADloadproc load) {
|
||||
if(!GLAD_GLX_MESA_query_renderer) return;
|
||||
glad_glXQueryCurrentRendererIntegerMESA = (PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC)load("glXQueryCurrentRendererIntegerMESA");
|
||||
glad_glXQueryCurrentRendererStringMESA = (PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC)load("glXQueryCurrentRendererStringMESA");
|
||||
glad_glXQueryRendererIntegerMESA = (PFNGLXQUERYRENDERERINTEGERMESAPROC)load("glXQueryRendererIntegerMESA");
|
||||
glad_glXQueryRendererStringMESA = (PFNGLXQUERYRENDERERSTRINGMESAPROC)load("glXQueryRendererStringMESA");
|
||||
}
|
||||
static void load_GLX_MESA_release_buffers(GLADloadproc load) {
|
||||
if(!GLAD_GLX_MESA_release_buffers) return;
|
||||
glad_glXReleaseBuffersMESA = (PFNGLXRELEASEBUFFERSMESAPROC)load("glXReleaseBuffersMESA");
|
||||
}
|
||||
static void load_GLX_MESA_set_3dfx_mode(GLADloadproc load) {
|
||||
if(!GLAD_GLX_MESA_set_3dfx_mode) return;
|
||||
glad_glXSet3DfxModeMESA = (PFNGLXSET3DFXMODEMESAPROC)load("glXSet3DfxModeMESA");
|
||||
}
|
||||
static void load_GLX_MESA_swap_control(GLADloadproc load) {
|
||||
if(!GLAD_GLX_MESA_swap_control) return;
|
||||
glad_glXGetSwapIntervalMESA = (PFNGLXGETSWAPINTERVALMESAPROC)load("glXGetSwapIntervalMESA");
|
||||
glad_glXSwapIntervalMESA = (PFNGLXSWAPINTERVALMESAPROC)load("glXSwapIntervalMESA");
|
||||
}
|
||||
static void load_GLX_NV_copy_buffer(GLADloadproc load) {
|
||||
if(!GLAD_GLX_NV_copy_buffer) return;
|
||||
glad_glXCopyBufferSubDataNV = (PFNGLXCOPYBUFFERSUBDATANVPROC)load("glXCopyBufferSubDataNV");
|
||||
glad_glXNamedCopyBufferSubDataNV = (PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC)load("glXNamedCopyBufferSubDataNV");
|
||||
}
|
||||
static void load_GLX_NV_copy_image(GLADloadproc load) {
|
||||
if(!GLAD_GLX_NV_copy_image) return;
|
||||
glad_glXCopyImageSubDataNV = (PFNGLXCOPYIMAGESUBDATANVPROC)load("glXCopyImageSubDataNV");
|
||||
}
|
||||
static void load_GLX_NV_delay_before_swap(GLADloadproc load) {
|
||||
if(!GLAD_GLX_NV_delay_before_swap) return;
|
||||
glad_glXDelayBeforeSwapNV = (PFNGLXDELAYBEFORESWAPNVPROC)load("glXDelayBeforeSwapNV");
|
||||
}
|
||||
static void load_GLX_NV_present_video(GLADloadproc load) {
|
||||
if(!GLAD_GLX_NV_present_video) return;
|
||||
glad_glXEnumerateVideoDevicesNV = (PFNGLXENUMERATEVIDEODEVICESNVPROC)load("glXEnumerateVideoDevicesNV");
|
||||
glad_glXBindVideoDeviceNV = (PFNGLXBINDVIDEODEVICENVPROC)load("glXBindVideoDeviceNV");
|
||||
}
|
||||
static void load_GLX_NV_swap_group(GLADloadproc load) {
|
||||
if(!GLAD_GLX_NV_swap_group) return;
|
||||
glad_glXJoinSwapGroupNV = (PFNGLXJOINSWAPGROUPNVPROC)load("glXJoinSwapGroupNV");
|
||||
glad_glXBindSwapBarrierNV = (PFNGLXBINDSWAPBARRIERNVPROC)load("glXBindSwapBarrierNV");
|
||||
glad_glXQuerySwapGroupNV = (PFNGLXQUERYSWAPGROUPNVPROC)load("glXQuerySwapGroupNV");
|
||||
glad_glXQueryMaxSwapGroupsNV = (PFNGLXQUERYMAXSWAPGROUPSNVPROC)load("glXQueryMaxSwapGroupsNV");
|
||||
glad_glXQueryFrameCountNV = (PFNGLXQUERYFRAMECOUNTNVPROC)load("glXQueryFrameCountNV");
|
||||
glad_glXResetFrameCountNV = (PFNGLXRESETFRAMECOUNTNVPROC)load("glXResetFrameCountNV");
|
||||
}
|
||||
static void load_GLX_NV_video_capture(GLADloadproc load) {
|
||||
if(!GLAD_GLX_NV_video_capture) return;
|
||||
glad_glXBindVideoCaptureDeviceNV = (PFNGLXBINDVIDEOCAPTUREDEVICENVPROC)load("glXBindVideoCaptureDeviceNV");
|
||||
glad_glXEnumerateVideoCaptureDevicesNV = (PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC)load("glXEnumerateVideoCaptureDevicesNV");
|
||||
glad_glXLockVideoCaptureDeviceNV = (PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC)load("glXLockVideoCaptureDeviceNV");
|
||||
glad_glXQueryVideoCaptureDeviceNV = (PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC)load("glXQueryVideoCaptureDeviceNV");
|
||||
glad_glXReleaseVideoCaptureDeviceNV = (PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC)load("glXReleaseVideoCaptureDeviceNV");
|
||||
}
|
||||
static void load_GLX_NV_video_out(GLADloadproc load) {
|
||||
if(!GLAD_GLX_NV_video_out) return;
|
||||
glad_glXGetVideoDeviceNV = (PFNGLXGETVIDEODEVICENVPROC)load("glXGetVideoDeviceNV");
|
||||
glad_glXReleaseVideoDeviceNV = (PFNGLXRELEASEVIDEODEVICENVPROC)load("glXReleaseVideoDeviceNV");
|
||||
glad_glXBindVideoImageNV = (PFNGLXBINDVIDEOIMAGENVPROC)load("glXBindVideoImageNV");
|
||||
glad_glXReleaseVideoImageNV = (PFNGLXRELEASEVIDEOIMAGENVPROC)load("glXReleaseVideoImageNV");
|
||||
glad_glXSendPbufferToVideoNV = (PFNGLXSENDPBUFFERTOVIDEONVPROC)load("glXSendPbufferToVideoNV");
|
||||
glad_glXGetVideoInfoNV = (PFNGLXGETVIDEOINFONVPROC)load("glXGetVideoInfoNV");
|
||||
}
|
||||
static void load_GLX_OML_sync_control(GLADloadproc load) {
|
||||
if(!GLAD_GLX_OML_sync_control) return;
|
||||
glad_glXGetSyncValuesOML = (PFNGLXGETSYNCVALUESOMLPROC)load("glXGetSyncValuesOML");
|
||||
glad_glXGetMscRateOML = (PFNGLXGETMSCRATEOMLPROC)load("glXGetMscRateOML");
|
||||
glad_glXSwapBuffersMscOML = (PFNGLXSWAPBUFFERSMSCOMLPROC)load("glXSwapBuffersMscOML");
|
||||
glad_glXWaitForMscOML = (PFNGLXWAITFORMSCOMLPROC)load("glXWaitForMscOML");
|
||||
glad_glXWaitForSbcOML = (PFNGLXWAITFORSBCOMLPROC)load("glXWaitForSbcOML");
|
||||
}
|
||||
static void load_GLX_SGIX_dmbuffer(GLADloadproc load) {
|
||||
if(!GLAD_GLX_SGIX_dmbuffer) return;
|
||||
#ifdef _DM_BUFFER_H_
|
||||
glad_glXAssociateDMPbufferSGIX = (PFNGLXASSOCIATEDMPBUFFERSGIXPROC)load("glXAssociateDMPbufferSGIX");
|
||||
#else
|
||||
(void)load;
|
||||
#endif
|
||||
}
|
||||
static void load_GLX_SGIX_fbconfig(GLADloadproc load) {
|
||||
if(!GLAD_GLX_SGIX_fbconfig) return;
|
||||
glad_glXGetFBConfigAttribSGIX = (PFNGLXGETFBCONFIGATTRIBSGIXPROC)load("glXGetFBConfigAttribSGIX");
|
||||
glad_glXChooseFBConfigSGIX = (PFNGLXCHOOSEFBCONFIGSGIXPROC)load("glXChooseFBConfigSGIX");
|
||||
glad_glXCreateGLXPixmapWithConfigSGIX = (PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC)load("glXCreateGLXPixmapWithConfigSGIX");
|
||||
glad_glXCreateContextWithConfigSGIX = (PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC)load("glXCreateContextWithConfigSGIX");
|
||||
glad_glXGetVisualFromFBConfigSGIX = (PFNGLXGETVISUALFROMFBCONFIGSGIXPROC)load("glXGetVisualFromFBConfigSGIX");
|
||||
glad_glXGetFBConfigFromVisualSGIX = (PFNGLXGETFBCONFIGFROMVISUALSGIXPROC)load("glXGetFBConfigFromVisualSGIX");
|
||||
}
|
||||
static void load_GLX_SGIX_hyperpipe(GLADloadproc load) {
|
||||
if(!GLAD_GLX_SGIX_hyperpipe) return;
|
||||
glad_glXQueryHyperpipeNetworkSGIX = (PFNGLXQUERYHYPERPIPENETWORKSGIXPROC)load("glXQueryHyperpipeNetworkSGIX");
|
||||
glad_glXHyperpipeConfigSGIX = (PFNGLXHYPERPIPECONFIGSGIXPROC)load("glXHyperpipeConfigSGIX");
|
||||
glad_glXQueryHyperpipeConfigSGIX = (PFNGLXQUERYHYPERPIPECONFIGSGIXPROC)load("glXQueryHyperpipeConfigSGIX");
|
||||
glad_glXDestroyHyperpipeConfigSGIX = (PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC)load("glXDestroyHyperpipeConfigSGIX");
|
||||
glad_glXBindHyperpipeSGIX = (PFNGLXBINDHYPERPIPESGIXPROC)load("glXBindHyperpipeSGIX");
|
||||
glad_glXQueryHyperpipeBestAttribSGIX = (PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC)load("glXQueryHyperpipeBestAttribSGIX");
|
||||
glad_glXHyperpipeAttribSGIX = (PFNGLXHYPERPIPEATTRIBSGIXPROC)load("glXHyperpipeAttribSGIX");
|
||||
glad_glXQueryHyperpipeAttribSGIX = (PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC)load("glXQueryHyperpipeAttribSGIX");
|
||||
}
|
||||
static void load_GLX_SGIX_pbuffer(GLADloadproc load) {
|
||||
if(!GLAD_GLX_SGIX_pbuffer) return;
|
||||
glad_glXCreateGLXPbufferSGIX = (PFNGLXCREATEGLXPBUFFERSGIXPROC)load("glXCreateGLXPbufferSGIX");
|
||||
glad_glXDestroyGLXPbufferSGIX = (PFNGLXDESTROYGLXPBUFFERSGIXPROC)load("glXDestroyGLXPbufferSGIX");
|
||||
glad_glXQueryGLXPbufferSGIX = (PFNGLXQUERYGLXPBUFFERSGIXPROC)load("glXQueryGLXPbufferSGIX");
|
||||
glad_glXSelectEventSGIX = (PFNGLXSELECTEVENTSGIXPROC)load("glXSelectEventSGIX");
|
||||
glad_glXGetSelectedEventSGIX = (PFNGLXGETSELECTEDEVENTSGIXPROC)load("glXGetSelectedEventSGIX");
|
||||
}
|
||||
static void load_GLX_SGIX_swap_barrier(GLADloadproc load) {
|
||||
if(!GLAD_GLX_SGIX_swap_barrier) return;
|
||||
glad_glXBindSwapBarrierSGIX = (PFNGLXBINDSWAPBARRIERSGIXPROC)load("glXBindSwapBarrierSGIX");
|
||||
glad_glXQueryMaxSwapBarriersSGIX = (PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC)load("glXQueryMaxSwapBarriersSGIX");
|
||||
}
|
||||
static void load_GLX_SGIX_swap_group(GLADloadproc load) {
|
||||
if(!GLAD_GLX_SGIX_swap_group) return;
|
||||
glad_glXJoinSwapGroupSGIX = (PFNGLXJOINSWAPGROUPSGIXPROC)load("glXJoinSwapGroupSGIX");
|
||||
}
|
||||
static void load_GLX_SGIX_video_resize(GLADloadproc load) {
|
||||
if(!GLAD_GLX_SGIX_video_resize) return;
|
||||
glad_glXBindChannelToWindowSGIX = (PFNGLXBINDCHANNELTOWINDOWSGIXPROC)load("glXBindChannelToWindowSGIX");
|
||||
glad_glXChannelRectSGIX = (PFNGLXCHANNELRECTSGIXPROC)load("glXChannelRectSGIX");
|
||||
glad_glXQueryChannelRectSGIX = (PFNGLXQUERYCHANNELRECTSGIXPROC)load("glXQueryChannelRectSGIX");
|
||||
glad_glXQueryChannelDeltasSGIX = (PFNGLXQUERYCHANNELDELTASSGIXPROC)load("glXQueryChannelDeltasSGIX");
|
||||
glad_glXChannelRectSyncSGIX = (PFNGLXCHANNELRECTSYNCSGIXPROC)load("glXChannelRectSyncSGIX");
|
||||
}
|
||||
static void load_GLX_SGIX_video_source(GLADloadproc load) {
|
||||
if(!GLAD_GLX_SGIX_video_source) return;
|
||||
#ifdef _VL_H_
|
||||
glad_glXCreateGLXVideoSourceSGIX = (PFNGLXCREATEGLXVIDEOSOURCESGIXPROC)load("glXCreateGLXVideoSourceSGIX");
|
||||
glad_glXDestroyGLXVideoSourceSGIX = (PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC)load("glXDestroyGLXVideoSourceSGIX");
|
||||
#else
|
||||
(void)load;
|
||||
#endif
|
||||
}
|
||||
static void load_GLX_SGI_cushion(GLADloadproc load) {
|
||||
if(!GLAD_GLX_SGI_cushion) return;
|
||||
glad_glXCushionSGI = (PFNGLXCUSHIONSGIPROC)load("glXCushionSGI");
|
||||
}
|
||||
static void load_GLX_SGI_make_current_read(GLADloadproc load) {
|
||||
if(!GLAD_GLX_SGI_make_current_read) return;
|
||||
glad_glXMakeCurrentReadSGI = (PFNGLXMAKECURRENTREADSGIPROC)load("glXMakeCurrentReadSGI");
|
||||
glad_glXGetCurrentReadDrawableSGI = (PFNGLXGETCURRENTREADDRAWABLESGIPROC)load("glXGetCurrentReadDrawableSGI");
|
||||
}
|
||||
static void load_GLX_SGI_swap_control(GLADloadproc load) {
|
||||
if(!GLAD_GLX_SGI_swap_control) return;
|
||||
glad_glXSwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC)load("glXSwapIntervalSGI");
|
||||
}
|
||||
static void load_GLX_SGI_video_sync(GLADloadproc load) {
|
||||
if(!GLAD_GLX_SGI_video_sync) return;
|
||||
glad_glXGetVideoSyncSGI = (PFNGLXGETVIDEOSYNCSGIPROC)load("glXGetVideoSyncSGI");
|
||||
glad_glXWaitVideoSyncSGI = (PFNGLXWAITVIDEOSYNCSGIPROC)load("glXWaitVideoSyncSGI");
|
||||
}
|
||||
static void load_GLX_SUN_get_transparent_index(GLADloadproc load) {
|
||||
if(!GLAD_GLX_SUN_get_transparent_index) return;
|
||||
glad_glXGetTransparentIndexSUN = (PFNGLXGETTRANSPARENTINDEXSUNPROC)load("glXGetTransparentIndexSUN");
|
||||
}
|
||||
static int find_extensionsGLX(void) {
|
||||
if (!get_exts()) return 0;
|
||||
GLAD_GLX_3DFX_multisample = has_ext("GLX_3DFX_multisample");
|
||||
GLAD_GLX_AMD_gpu_association = has_ext("GLX_AMD_gpu_association");
|
||||
GLAD_GLX_ARB_context_flush_control = has_ext("GLX_ARB_context_flush_control");
|
||||
GLAD_GLX_ARB_create_context = has_ext("GLX_ARB_create_context");
|
||||
GLAD_GLX_ARB_create_context_no_error = has_ext("GLX_ARB_create_context_no_error");
|
||||
GLAD_GLX_ARB_create_context_profile = has_ext("GLX_ARB_create_context_profile");
|
||||
GLAD_GLX_ARB_create_context_robustness = has_ext("GLX_ARB_create_context_robustness");
|
||||
GLAD_GLX_ARB_fbconfig_float = has_ext("GLX_ARB_fbconfig_float");
|
||||
GLAD_GLX_ARB_framebuffer_sRGB = has_ext("GLX_ARB_framebuffer_sRGB");
|
||||
GLAD_GLX_ARB_get_proc_address = has_ext("GLX_ARB_get_proc_address");
|
||||
GLAD_GLX_ARB_multisample = has_ext("GLX_ARB_multisample");
|
||||
GLAD_GLX_ARB_robustness_application_isolation = has_ext("GLX_ARB_robustness_application_isolation");
|
||||
GLAD_GLX_ARB_robustness_share_group_isolation = has_ext("GLX_ARB_robustness_share_group_isolation");
|
||||
GLAD_GLX_ARB_vertex_buffer_object = has_ext("GLX_ARB_vertex_buffer_object");
|
||||
GLAD_GLX_EXT_buffer_age = has_ext("GLX_EXT_buffer_age");
|
||||
GLAD_GLX_EXT_create_context_es2_profile = has_ext("GLX_EXT_create_context_es2_profile");
|
||||
GLAD_GLX_EXT_create_context_es_profile = has_ext("GLX_EXT_create_context_es_profile");
|
||||
GLAD_GLX_EXT_fbconfig_packed_float = has_ext("GLX_EXT_fbconfig_packed_float");
|
||||
GLAD_GLX_EXT_framebuffer_sRGB = has_ext("GLX_EXT_framebuffer_sRGB");
|
||||
GLAD_GLX_EXT_import_context = has_ext("GLX_EXT_import_context");
|
||||
GLAD_GLX_EXT_libglvnd = has_ext("GLX_EXT_libglvnd");
|
||||
GLAD_GLX_EXT_no_config_context = has_ext("GLX_EXT_no_config_context");
|
||||
GLAD_GLX_EXT_stereo_tree = has_ext("GLX_EXT_stereo_tree");
|
||||
GLAD_GLX_EXT_swap_control = has_ext("GLX_EXT_swap_control");
|
||||
GLAD_GLX_EXT_swap_control_tear = has_ext("GLX_EXT_swap_control_tear");
|
||||
GLAD_GLX_EXT_texture_from_pixmap = has_ext("GLX_EXT_texture_from_pixmap");
|
||||
GLAD_GLX_EXT_visual_info = has_ext("GLX_EXT_visual_info");
|
||||
GLAD_GLX_EXT_visual_rating = has_ext("GLX_EXT_visual_rating");
|
||||
GLAD_GLX_INTEL_swap_event = has_ext("GLX_INTEL_swap_event");
|
||||
GLAD_GLX_MESA_agp_offset = has_ext("GLX_MESA_agp_offset");
|
||||
GLAD_GLX_MESA_copy_sub_buffer = has_ext("GLX_MESA_copy_sub_buffer");
|
||||
GLAD_GLX_MESA_pixmap_colormap = has_ext("GLX_MESA_pixmap_colormap");
|
||||
GLAD_GLX_MESA_query_renderer = has_ext("GLX_MESA_query_renderer");
|
||||
GLAD_GLX_MESA_release_buffers = has_ext("GLX_MESA_release_buffers");
|
||||
GLAD_GLX_MESA_set_3dfx_mode = has_ext("GLX_MESA_set_3dfx_mode");
|
||||
GLAD_GLX_MESA_swap_control = has_ext("GLX_MESA_swap_control");
|
||||
GLAD_GLX_NV_copy_buffer = has_ext("GLX_NV_copy_buffer");
|
||||
GLAD_GLX_NV_copy_image = has_ext("GLX_NV_copy_image");
|
||||
GLAD_GLX_NV_delay_before_swap = has_ext("GLX_NV_delay_before_swap");
|
||||
GLAD_GLX_NV_float_buffer = has_ext("GLX_NV_float_buffer");
|
||||
GLAD_GLX_NV_multisample_coverage = has_ext("GLX_NV_multisample_coverage");
|
||||
GLAD_GLX_NV_present_video = has_ext("GLX_NV_present_video");
|
||||
GLAD_GLX_NV_robustness_video_memory_purge = has_ext("GLX_NV_robustness_video_memory_purge");
|
||||
GLAD_GLX_NV_swap_group = has_ext("GLX_NV_swap_group");
|
||||
GLAD_GLX_NV_video_capture = has_ext("GLX_NV_video_capture");
|
||||
GLAD_GLX_NV_video_out = has_ext("GLX_NV_video_out");
|
||||
GLAD_GLX_OML_swap_method = has_ext("GLX_OML_swap_method");
|
||||
GLAD_GLX_OML_sync_control = has_ext("GLX_OML_sync_control");
|
||||
GLAD_GLX_SGIS_blended_overlay = has_ext("GLX_SGIS_blended_overlay");
|
||||
GLAD_GLX_SGIS_multisample = has_ext("GLX_SGIS_multisample");
|
||||
GLAD_GLX_SGIS_shared_multisample = has_ext("GLX_SGIS_shared_multisample");
|
||||
GLAD_GLX_SGIX_dmbuffer = has_ext("GLX_SGIX_dmbuffer");
|
||||
GLAD_GLX_SGIX_fbconfig = has_ext("GLX_SGIX_fbconfig");
|
||||
GLAD_GLX_SGIX_hyperpipe = has_ext("GLX_SGIX_hyperpipe");
|
||||
GLAD_GLX_SGIX_pbuffer = has_ext("GLX_SGIX_pbuffer");
|
||||
GLAD_GLX_SGIX_swap_barrier = has_ext("GLX_SGIX_swap_barrier");
|
||||
GLAD_GLX_SGIX_swap_group = has_ext("GLX_SGIX_swap_group");
|
||||
GLAD_GLX_SGIX_video_resize = has_ext("GLX_SGIX_video_resize");
|
||||
GLAD_GLX_SGIX_video_source = has_ext("GLX_SGIX_video_source");
|
||||
GLAD_GLX_SGIX_visual_select_group = has_ext("GLX_SGIX_visual_select_group");
|
||||
GLAD_GLX_SGI_cushion = has_ext("GLX_SGI_cushion");
|
||||
GLAD_GLX_SGI_make_current_read = has_ext("GLX_SGI_make_current_read");
|
||||
GLAD_GLX_SGI_swap_control = has_ext("GLX_SGI_swap_control");
|
||||
GLAD_GLX_SGI_video_sync = has_ext("GLX_SGI_video_sync");
|
||||
GLAD_GLX_SUN_get_transparent_index = has_ext("GLX_SUN_get_transparent_index");
|
||||
free_exts();
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void find_coreGLX(Display *dpy, int screen) {
|
||||
int major = 0, minor = 0;
|
||||
glXQueryVersion(dpy, &major, &minor);
|
||||
GLADGLXDisplay = dpy;
|
||||
GLADGLXscreen = screen;
|
||||
GLAD_GLX_VERSION_1_0 = (major == 1 && minor >= 0) || major > 1;
|
||||
GLAD_GLX_VERSION_1_1 = (major == 1 && minor >= 1) || major > 1;
|
||||
GLAD_GLX_VERSION_1_2 = (major == 1 && minor >= 2) || major > 1;
|
||||
GLAD_GLX_VERSION_1_3 = (major == 1 && minor >= 3) || major > 1;
|
||||
GLAD_GLX_VERSION_1_4 = (major == 1 && minor >= 4) || major > 1;
|
||||
}
|
||||
|
||||
int gladLoadGLXLoader(GLADloadproc load, Display *dpy, int screen) {
|
||||
glXQueryVersion = (PFNGLXQUERYVERSIONPROC)load("glXQueryVersion");
|
||||
if(glXQueryVersion == NULL) return 0;
|
||||
find_coreGLX(dpy, screen);
|
||||
load_GLX_VERSION_1_0(load);
|
||||
load_GLX_VERSION_1_1(load);
|
||||
load_GLX_VERSION_1_2(load);
|
||||
load_GLX_VERSION_1_3(load);
|
||||
load_GLX_VERSION_1_4(load);
|
||||
|
||||
if (!find_extensionsGLX()) return 0;
|
||||
load_GLX_AMD_gpu_association(load);
|
||||
load_GLX_ARB_create_context(load);
|
||||
load_GLX_ARB_get_proc_address(load);
|
||||
load_GLX_EXT_import_context(load);
|
||||
load_GLX_EXT_swap_control(load);
|
||||
load_GLX_EXT_texture_from_pixmap(load);
|
||||
load_GLX_MESA_agp_offset(load);
|
||||
load_GLX_MESA_copy_sub_buffer(load);
|
||||
load_GLX_MESA_pixmap_colormap(load);
|
||||
load_GLX_MESA_query_renderer(load);
|
||||
load_GLX_MESA_release_buffers(load);
|
||||
load_GLX_MESA_set_3dfx_mode(load);
|
||||
load_GLX_MESA_swap_control(load);
|
||||
load_GLX_NV_copy_buffer(load);
|
||||
load_GLX_NV_copy_image(load);
|
||||
load_GLX_NV_delay_before_swap(load);
|
||||
load_GLX_NV_present_video(load);
|
||||
load_GLX_NV_swap_group(load);
|
||||
load_GLX_NV_video_capture(load);
|
||||
load_GLX_NV_video_out(load);
|
||||
load_GLX_OML_sync_control(load);
|
||||
load_GLX_SGIX_dmbuffer(load);
|
||||
load_GLX_SGIX_fbconfig(load);
|
||||
load_GLX_SGIX_hyperpipe(load);
|
||||
load_GLX_SGIX_pbuffer(load);
|
||||
load_GLX_SGIX_swap_barrier(load);
|
||||
load_GLX_SGIX_swap_group(load);
|
||||
load_GLX_SGIX_video_resize(load);
|
||||
load_GLX_SGIX_video_source(load);
|
||||
load_GLX_SGI_cushion(load);
|
||||
load_GLX_SGI_make_current_read(load);
|
||||
load_GLX_SGI_swap_control(load);
|
||||
load_GLX_SGI_video_sync(load);
|
||||
load_GLX_SUN_get_transparent_index(load);
|
||||
return 1;
|
||||
}
|
||||
|
@ -0,0 +1,3 @@
|
||||
from . import boxstack_pybullet_sim.py
|
||||
from . import pybullet_sim_gym_env.py
|
||||
|
12
setup.py
12
setup.py
@ -388,7 +388,8 @@ if _platform == "linux" or _platform == "linux2":
|
||||
CXX_FLAGS += '-fno-inline-functions-called-once'
|
||||
sources = sources + ["examples/ThirdPartyLibs/enet/unix.c"]\
|
||||
+["examples/OpenGLWindow/X11OpenGLWindow.cpp"]\
|
||||
+["examples/ThirdPartyLibs/Glew/glew.c"]
|
||||
+["examples/ThirdPartyLibs/glad/glad.c"]\
|
||||
+["examples/ThirdPartyLibs/glad/glad_glx.c"]
|
||||
include_dirs += ["examples/ThirdPartyLibs/optionalX11"]
|
||||
elif _platform == "win32":
|
||||
print("win32!")
|
||||
@ -398,7 +399,7 @@ elif _platform == "win32":
|
||||
sources = sources + ["examples/ThirdPartyLibs/enet/win32.c"]\
|
||||
+["examples/OpenGLWindow/Win32Window.cpp"]\
|
||||
+["examples/OpenGLWindow/Win32OpenGLWindow.cpp"]\
|
||||
+["examples/ThirdPartyLibs/Glew/glew.c"]
|
||||
+["examples/ThirdPartyLibs/glad/glad.c"]
|
||||
elif _platform == "darwin":
|
||||
print("darwin!")
|
||||
os.environ['LDFLAGS'] = '-framework Cocoa -framework OpenGL'
|
||||
@ -408,6 +409,7 @@ elif _platform == "darwin":
|
||||
# CXX_FLAGS += '-framework Cocoa '
|
||||
sources = sources + ["examples/ThirdPartyLibs/enet/unix.c"]\
|
||||
+["examples/OpenGLWindow/MacOpenGLWindow.cpp"]\
|
||||
+["examples/ThirdPartyLibs/glad/glad.c"]\
|
||||
+["examples/OpenGLWindow/MacOpenGLWindowObjC.m"]
|
||||
else:
|
||||
print("bsd!")
|
||||
@ -419,7 +421,7 @@ else:
|
||||
CXX_FLAGS += '-fno-inline-functions-called-once'
|
||||
sources = ["examples/ThirdPartyLibs/enet/unix.c"]\
|
||||
+["examples/OpenGLWindow/X11OpenGLWindow.cpp"]\
|
||||
+["examples/ThirdPartyLibs/Glew/glew.c"]\
|
||||
+["examples/ThirdPartyLibs/glad/glad.c"]\
|
||||
+ sources
|
||||
|
||||
setup_py_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
@ -444,7 +446,7 @@ print("-----")
|
||||
|
||||
setup(
|
||||
name = 'pybullet',
|
||||
version='1.8.6',
|
||||
version='1.8.9',
|
||||
description='Official Python Interface for the Bullet Physics SDK specialized for Robotics Simulation and Reinforcement Learning',
|
||||
long_description='pybullet is an easy to use Python module for physics simulation, robotics and deep reinforcement learning based on the Bullet Physics SDK. With pybullet you can load articulated bodies from URDF, SDF and other file formats. pybullet provides forward dynamics simulation, inverse dynamics computation, forward and inverse kinematics and collision detection and ray intersection queries. Aside from physics simulation, pybullet supports to rendering, with a CPU renderer and OpenGL visualization and support for virtual reality headsets.',
|
||||
url='https://github.com/bulletphysics/bullet3',
|
||||
@ -457,7 +459,7 @@ setup(
|
||||
sources = sources,
|
||||
libraries = libraries,
|
||||
extra_compile_args=CXX_FLAGS.split(),
|
||||
include_dirs = include_dirs + ["src","examples/ThirdPartyLibs","examples/ThirdPartyLibs/Glew", "examples/ThirdPartyLibs/enet/include","examples/ThirdPartyLibs/clsocket/src"]
|
||||
include_dirs = include_dirs + ["src","examples/ThirdPartyLibs","examples/ThirdPartyLibs/glad", "examples/ThirdPartyLibs/enet/include","examples/ThirdPartyLibs/clsocket/src"]
|
||||
) ],
|
||||
classifiers=['Development Status :: 5 - Production/Stable',
|
||||
'License :: OSI Approved :: zlib/libpng License',
|
||||
|
@ -355,9 +355,8 @@ int main()
|
||||
#ifndef __APPLE__
|
||||
#ifndef _WIN32
|
||||
//we need glewExperimental on Linux
|
||||
glewExperimental = GL_TRUE;
|
||||
#endif // _WIN32
|
||||
glewInit();
|
||||
gladLoadGL();
|
||||
#endif
|
||||
#endif //B3_USE_GLFW
|
||||
//we ned to call glGetError twice, because of some Ubuntu/Intel/OpenGL issue
|
||||
|
Loading…
Reference in New Issue
Block a user