Hi,
Getting error while declaring the following :
Code:
osgViewer::GraphicsHandleX11 *linuxContext = NULL;
osgViewer::GraphicsHandleWin32 *windowsContext = NULL;
if( ctxID != -1 )
{ // Find context with ctxID and make it current.
for( unsigned int c=0; c<ctxs.size(); ++c )
{
if( ctxs[c]->getState()->getContextID() == ctxID )
{
ctx = ctxs[c];
}
}
}
else
{
ctx = ctxs.front();
}
if( NULL == ctx )
{
osg::notify(osg::FATAL)<< __FUNCTION__ << ": cannot find valid OpenGL
context."<<std::endl;
return false;
}
//platform dependent casting
#ifdef WIN32
windowsContext = dynamic_cast<GraphicsHandleWin32*>(ctx);
if(NULL == windowsContext)
{
osg::notify(osg::FATAL) << "Win32 Graphics Context Casting is
unsuccessful" << std::endl;
return false;
}
#else
linuxContext = dynamic_cast<GraphicsHandleX11*>(ctx);
if(NULL == linuxContext)
{
osg::notify(osg::FATAL) << "X11 Graphics Context Casting is
unsuccessful" << std::endl;
return false;
}
#endif
//by now the graphics context is found
//and the platform id is also found
cl_context_properties contextProperties[] =
{
#ifdef WIN32
CL_GL_CONTEXT_KHR, (cl_context_properties)
windowsContext->getWGLContext(),
CL_WGL_HDC_KHR, (cl_context_properties) windowsContext->getHDC(),
#else
CL_GL_CONTEXT_KHR, (cl_context_properties)
linuxContext->getGLXContext(),
CL_GLX_DISPLAY_KHR, (intptr_t) linuxContext->getDisplay(),
#endif
CL_CONTEXT_PLATFORM, (cl_context_properties) m_clPlatform,
0
};
the error is :
Code:
/home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:87:7:
error: ‘GraphicsHandleWin32’ is not a member of ‘osgViewer’
/home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:87:39:
error: ‘windowsContext’ was not declared in this scope
/home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:121:35:
error: expected type-specifier before ‘GraphicsHandleX11’
/home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:121:35:
error: expected ‘>’ before ‘GraphicsHandleX11’
/home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:121:35:
error: expected ‘(’ before ‘GraphicsHandleX11’
/home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:121:35:
error: ‘GraphicsHandleX11’ was not declared in this scope
/home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:121:35:
note: suggested alternative:
/usr/local/include/osgViewer/api/X11/GraphicsHandleX11:44:24: note:
‘osgViewer::GraphicsHandleX11’
/home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:121:53:
error: expected primary-expression before ‘>’ token
/home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:121:59:
error: expected ‘)’ before ‘;’ token
/home/sajjad/Downloads/OpenSceneGraph/osgCompute/osgCompute/src/osgOpenCL/osgOpenCLContext.cpp:141:60:
error: ‘class osgViewer::GraphicsHandleX11’ has no member named ‘getGLXContext’
make[2]: *** [src/osgOpenCL/CMakeFiles/osgOpenCL.dir/osgOpenCLContext.cpp.o]
Error 1
make[1]: *** [src/osgOpenCL/CMakeFiles/osgOpenCL.dir/all] Error 2
What should be the file inclusion to get it right? I have included as follows:
Code:
#include <osg/Notify>
#ifdef WIN32
#include <osgViewer/api/Win32/GraphicsHandleWin32>
#else
#include <osgViewer/api/X11/GraphicsHandleX11>
#endif
Any idea ?
Cheers,
Sajjadul
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=53861#53861
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org