From Pjotr Svetachov, "For me osgviewer.cpp and Renderer.cpp were not compiling (visual studio 2013 with profile GL2) because they were still using GLuintEXT. So I changed that, see the attached files.

I also noticed that the generated OpenGL header were not copied to the installation directory so my own application could not find it."
This commit is contained in:
Robert Osfield 2014-04-25 08:57:27 +00:00
parent 6a0270279c
commit 4994b806d2
3 changed files with 12 additions and 11 deletions

View File

@ -94,7 +94,7 @@ public:
if (_previousSync)
{
unsigned int num_seconds = 1;
GLuint64EXT timeout = num_seconds * ((GLuint64EXT)1000 * 1000 * 1000);
GLuint64 timeout = num_seconds * ((GLuint64)1000 * 1000 * 1000);
_glClientWaitSync(_previousSync, 0, timeout);
_glDeleteSync(_previousSync);
@ -112,8 +112,8 @@ public:
typedef GLsync (GL_APIENTRY * PFNGLFENCESYNCPROC) (GLenum condition, GLbitfield flags);
typedef GLboolean (GL_APIENTRY * PFNGLISSYNCPROC) (GLsync sync);
typedef void (GL_APIENTRY * PFNGLDELETESYNCPROC) (GLsync sync);
typedef GLenum (GL_APIENTRY * PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64EXT timeout);
typedef void (GL_APIENTRY * PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64EXT timeout);
typedef GLenum (GL_APIENTRY * PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
typedef void (GL_APIENTRY * PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
typedef void (GL_APIENTRY * PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *params);
typedef void (GL_APIENTRY * PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);

View File

@ -210,6 +210,7 @@ SET(TARGET_H
${HEADER_PATH}/View
${HEADER_PATH}/Viewport
${OPENSCENEGRAPH_CONFIG_HEADER}
${OPENSCENEGRAPH_OPENGL_HEADER}
)
#ADD_LIBRARY(${LIB_NAME}

View File

@ -77,7 +77,7 @@ void EXTQuerySupport::checkQuery(osg::Stats* stats, osg::State* /*state*/,
_extensions->glGetQueryObjectiv(query, GL_QUERY_RESULT_AVAILABLE, &available);
if (available)
{
GLuint64EXT timeElapsed = 0;
GLuint64 timeElapsed = 0;
_extensions->glGetQueryObjectui64v(query, GL_QUERY_RESULT, &timeElapsed);
double timeElapsedSeconds = double(timeElapsed)*1e-9;
@ -214,13 +214,13 @@ void ARBQuerySupport::checkQuery(osg::Stats* stats, osg::State* state,
if (available)
{
QueryPair queries = itr->queries;
GLuint64EXT beginTimestamp = 0;
GLuint64EXT endTimestamp = 0;
GLuint64 beginTimestamp = 0;
GLuint64 endTimestamp = 0;
_extensions->glGetQueryObjectui64v(queries.first, GL_QUERY_RESULT,
&beginTimestamp);
_extensions->glGetQueryObjectui64v(queries.second, GL_QUERY_RESULT,
&endTimestamp);
GLuint64EXT gpuTimestamp = state->getGpuTimestamp();
GLuint64 gpuTimestamp = state->getGpuTimestamp();
// Have any of the timestamps wrapped around?
int tbits = state->getTimestampBits();
if (tbits < 64)
@ -228,11 +228,11 @@ void ARBQuerySupport::checkQuery(osg::Stats* stats, osg::State* state,
// If the high bits on any of the timestamp bits are
// different then the counters may have wrapped.
const int hiShift = (tbits - 1);
const GLuint64EXT hiMask = 1 << hiShift;
const GLuint64EXT sum = (beginTimestamp >> hiShift)
const GLuint64 hiMask = 1 << hiShift;
const GLuint64 sum = (beginTimestamp >> hiShift)
+ (endTimestamp >> hiShift) + (gpuTimestamp >> hiShift);
if (sum == 1 || sum == 2) {
const GLuint64EXT wrapAdd = 1 << tbits;
const GLuint64 wrapAdd = 1 << tbits;
// Counter wrapped between begin and end?
if (beginTimestamp > endTimestamp)
{
@ -251,7 +251,7 @@ void ARBQuerySupport::checkQuery(osg::Stats* stats, osg::State* state,
}
}
}
GLuint64EXT timeElapsed = endTimestamp - beginTimestamp;
GLuint64 timeElapsed = endTimestamp - beginTimestamp;
double timeElapsedSeconds = double(timeElapsed)*1e-9;
double gpuTick = state->getGpuTime();
double beginTime = 0.0;