updated new DialogDynamicsWorld GUI to compile and run on Mac OS X.
This commit is contained in:
@@ -26,8 +26,8 @@ subject to the following restrictions:
|
|||||||
#include "BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h"
|
#include "BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h"
|
||||||
|
|
||||||
///create 125 (5x5x5) dynamic object
|
///create 125 (5x5x5) dynamic object
|
||||||
#define ARRAY_SIZE_X 15
|
#define ARRAY_SIZE_X 5
|
||||||
#define ARRAY_SIZE_Y 15
|
#define ARRAY_SIZE_Y 5
|
||||||
#define ARRAY_SIZE_Z 1
|
#define ARRAY_SIZE_Z 1
|
||||||
|
|
||||||
//maximum number of objects (and allow user to shoot additional boxes)
|
//maximum number of objects (and allow user to shoot additional boxes)
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ ${BULLET_PHYSICS_SOURCE_DIR}/src ${BULLET_PHYSICS_SOURCE_DIR}/Extras/ConvexHull
|
|||||||
|
|
||||||
ADD_LIBRARY(OpenGLSupport
|
ADD_LIBRARY(OpenGLSupport
|
||||||
GLDebugFont.cpp
|
GLDebugFont.cpp
|
||||||
|
GL_DialogDynamicsWorld.cpp
|
||||||
|
GL_DialogWindow.cpp
|
||||||
GL_ShapeDrawer.cpp
|
GL_ShapeDrawer.cpp
|
||||||
GL_Simplex1to4.cpp
|
GL_Simplex1to4.cpp
|
||||||
GLDebugDrawer.cpp
|
GLDebugDrawer.cpp
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ subject to the following restrictions:
|
|||||||
3. This notice may not be removed or altered from any source distribution.
|
3. This notice may not be removed or altered from any source distribution.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "GL_DialogDynamicsWorld.h"
|
#include "GL_DialogDynamicsWorld.h"
|
||||||
#include "GL_DialogWindow.h"
|
#include "GL_DialogWindow.h"
|
||||||
#include "btBulletDynamicsCommon.h"
|
#include "btBulletDynamicsCommon.h"
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ subject to the following restrictions:
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Extensions
|
// Extensions
|
||||||
|
|
||||||
|
#ifndef __APPLE__
|
||||||
typedef void (APIENTRY * PFNGLBindBufferARB)(GLenum target, GLuint buffer);
|
typedef void (APIENTRY * PFNGLBindBufferARB)(GLenum target, GLuint buffer);
|
||||||
typedef void (APIENTRY * PFNGLBindProgramARB)(GLenum target, GLuint program);
|
typedef void (APIENTRY * PFNGLBindProgramARB)(GLenum target, GLuint program);
|
||||||
typedef GLuint (APIENTRY * PFNGLGetHandleARB)(GLenum pname);
|
typedef GLuint (APIENTRY * PFNGLGetHandleARB)(GLenum pname);
|
||||||
@@ -100,7 +101,7 @@ PFNGLBlendFuncSeparate glBlendFuncSeparate = NULL;
|
|||||||
#ifndef GL_BLEND_DST_ALPHA
|
#ifndef GL_BLEND_DST_ALPHA
|
||||||
# define GL_BLEND_DST_ALPHA 0x80CA
|
# define GL_BLEND_DST_ALPHA 0x80CA
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
GL_DialogWindow::GL_DialogWindow(int horPos,int vertPos,int dialogWidth,int dialogHeight, btCollisionObject* collisionObject,const char* dialogTitle)
|
GL_DialogWindow::GL_DialogWindow(int horPos,int vertPos,int dialogWidth,int dialogHeight, btCollisionObject* collisionObject,const char* dialogTitle)
|
||||||
:m_dialogHorPos(horPos),
|
:m_dialogHorPos(horPos),
|
||||||
@@ -221,6 +222,7 @@ void GL_DialogWindow::draw(btScalar deltaTime)
|
|||||||
int curVertPos = m_dialogVertPos;
|
int curVertPos = m_dialogVertPos;
|
||||||
curVertPos += yInc;
|
curVertPos += yInc;
|
||||||
|
|
||||||
|
glColor4f(1,1,1,1);
|
||||||
GLDebugDrawString(m_dialogHorPos+m_dialogWidth/2-((strlen(m_dialogTitle)/2)*charWidth),m_dialogVertPos+yInc ,m_dialogTitle);
|
GLDebugDrawString(m_dialogHorPos+m_dialogWidth/2-((strlen(m_dialogTitle)/2)*charWidth),m_dialogVertPos+yInc ,m_dialogTitle);
|
||||||
curVertPos += 20;
|
curVertPos += 20;
|
||||||
|
|
||||||
@@ -245,7 +247,7 @@ void GL_DialogWindow::saveOpenGLState()
|
|||||||
glGetIntegerv(GL_ACTIVE_TEXTURE_ARB, &m_PrevActiveTextureARB);
|
glGetIntegerv(GL_ACTIVE_TEXTURE_ARB, &m_PrevActiveTextureARB);
|
||||||
int maxTexUnits = 1;
|
int maxTexUnits = 1;
|
||||||
glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &maxTexUnits);
|
glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &maxTexUnits);
|
||||||
maxTexUnits = max(1, min(32, maxTexUnits));
|
maxTexUnits = btMax(1, btMin(32, maxTexUnits));
|
||||||
for( int i=0; i<maxTexUnits; ++i )
|
for( int i=0; i<maxTexUnits; ++i )
|
||||||
{
|
{
|
||||||
glActiveTextureARB(GL_TEXTURE0_ARB+i);
|
glActiveTextureARB(GL_TEXTURE0_ARB+i);
|
||||||
@@ -338,7 +340,7 @@ void GL_DialogWindow::saveOpenGLState()
|
|||||||
}
|
}
|
||||||
if( glGetHandleARB!=NULL && glUseProgramObjectARB!=NULL )
|
if( glGetHandleARB!=NULL && glUseProgramObjectARB!=NULL )
|
||||||
{
|
{
|
||||||
m_PrevProgramObjectARB = glGetHandleARB(GL_PROGRAM_OBJECT_ARB);
|
m_PrevProgramObjectARB = (GLuint)glGetHandleARB(GL_PROGRAM_OBJECT_ARB);
|
||||||
glUseProgramObjectARB(0);
|
glUseProgramObjectARB(0);
|
||||||
}
|
}
|
||||||
glDisable(GL_TEXTURE_1D);
|
glDisable(GL_TEXTURE_1D);
|
||||||
@@ -393,7 +395,7 @@ void GL_DialogWindow::restoreOpenGLState()
|
|||||||
glEnable(GL_FRAGMENT_PROGRAM_ARB);
|
glEnable(GL_FRAGMENT_PROGRAM_ARB);
|
||||||
}
|
}
|
||||||
if( glGetHandleARB!=NULL && glUseProgramObjectARB!=NULL )
|
if( glGetHandleARB!=NULL && glUseProgramObjectARB!=NULL )
|
||||||
glUseProgramObjectARB(m_PrevProgramObjectARB);
|
glUseProgramObjectARB((void*)m_PrevProgramObjectARB);
|
||||||
if( glTexImage3D!=NULL && m_PrevTexture3D )
|
if( glTexImage3D!=NULL && m_PrevTexture3D )
|
||||||
glEnable(GL_TEXTURE_3D);
|
glEnable(GL_TEXTURE_3D);
|
||||||
if( m_SupportTexRect && m_PrevTexRectARB )
|
if( m_SupportTexRect && m_PrevTexRectARB )
|
||||||
@@ -422,7 +424,7 @@ void GL_DialogWindow::restoreOpenGLState()
|
|||||||
{
|
{
|
||||||
int maxTexUnits = 1;
|
int maxTexUnits = 1;
|
||||||
glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &maxTexUnits);
|
glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &maxTexUnits);
|
||||||
maxTexUnits = max(1, min(32, maxTexUnits));
|
maxTexUnits = btMax(1, btMin(32, maxTexUnits));
|
||||||
for( int i=0; i<maxTexUnits; ++i )
|
for( int i=0; i<maxTexUnits; ++i )
|
||||||
{
|
{
|
||||||
glActiveTextureARB(GL_TEXTURE0_ARB+i);
|
glActiveTextureARB(GL_TEXTURE0_ARB+i);
|
||||||
|
|||||||
@@ -61,6 +61,8 @@ public:
|
|||||||
m_type = GL_TEXT_CONTROL;
|
m_type = GL_TEXT_CONTROL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual ~GL_TextControl() {}
|
||||||
|
|
||||||
virtual void draw(int& parentHorPos,int& parentVertPos,btScalar deltaTime);
|
virtual void draw(int& parentHorPos,int& parentVertPos,btScalar deltaTime);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user