From: Oliver O. <fr...@us...> - 2007-03-30 01:48:27
|
Update of /cvsroot/simspark/simspark/spark/kerosin/openglserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7201 Modified Files: Tag: projectx openglserver.cpp Log Message: added method to get a handle string for the glwindow Index: openglserver.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/openglserver/openglserver.cpp,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.3.2.1 diff -C2 -d -r1.1.2.3 -r1.1.2.3.2.1 *** openglserver.cpp 28 Feb 2007 04:33:22 -0000 1.1.2.3 --- openglserver.cpp 30 Mar 2007 01:48:20 -0000 1.1.2.3.2.1 *************** *** 26,29 **** --- 26,30 ---- #include <zeitgeist/fileserver/fileserver.h> #include <zeitgeist/logserver/logserver.h> + #include <sstream> using namespace std; *************** *** 85,109 **** } ! void OpenGLServer::Update() { if (mGLSystem.get() == 0) ! { ! return; ! } mGLSystem->Update(); } ! void OpenGLServer::SwapBuffers() const { if (mGLSystem.get() == 0) ! { ! return; ! } mGLSystem->SwapBuffers(); } ! bool OpenGLServer::Init(const string& openGLSysName) { GetLog()->Normal() << "(OpenGLServer) Init " << openGLSysName << "\n"; --- 86,113 ---- } ! void ! OpenGLServer::Update() { if (mGLSystem.get() == 0) ! { ! return; ! } mGLSystem->Update(); } ! void ! OpenGLServer::SwapBuffers() const { if (mGLSystem.get() == 0) ! { ! return; ! } mGLSystem->SwapBuffers(); } ! bool ! OpenGLServer::Init(const string& openGLSysName) { GetLog()->Normal() << "(OpenGLServer) Init " << openGLSysName << "\n"; *************** *** 111,134 **** if (! openGLSysName.empty()) ! { ! // create the OpenGLSystem ! mGLSystem = shared_dynamic_cast<OpenGLSystem> ! (GetCore()->New(openGLSysName)); ! if(mGLSystem.get() == 0) ! { ! // could not create OpenGLSystem ! GetLog()->Error() << "(OpenGLServer) ERROR: unable to create " ! << openGLSysName << "\n"; ! return false; ! } ! if (mGLSystem->Init() == false) ! { ! GetLog()->Error() << "(InputServer) ERROR: unable to initialize " ! << openGLSysName << "\n"; ! return false; ! } } mSupportsFancyLighting = false; --- 115,138 ---- if (! openGLSysName.empty()) ! { ! // create the OpenGLSystem ! mGLSystem = shared_dynamic_cast<OpenGLSystem> ! (GetCore()->New(openGLSysName)); ! if (mGLSystem.get() == 0) ! { ! // could not create OpenGLSystem ! GetLog()->Error() << "(OpenGLServer) ERROR: unable to create " ! << openGLSysName << "\n"; ! return false; ! } ! if (mGLSystem->Init() == false) ! { ! GetLog()->Error() << "(InputServer) ERROR: unable to initialize " ! << openGLSysName << "\n"; ! return false; } + } mSupportsFancyLighting = false; *************** *** 136,142 **** // prepare the set of available lights for (int i=0;i<GL_MAX_LIGHTS;++i) ! { ! mAvailableLights.insert(GL_LIGHT0+i); ! } return true; --- 140,146 ---- // prepare the set of available lights for (int i=0;i<GL_MAX_LIGHTS;++i) ! { ! mAvailableLights.insert(GL_LIGHT0+i); ! } return true; *************** *** 155,161 **** { if (mAvailableLights.size() == 0) ! { ! return -1; ! } TLightSet::iterator iter = mAvailableLights.begin(); --- 159,165 ---- { if (mAvailableLights.size() == 0) ! { ! return -1; ! } TLightSet::iterator iter = mAvailableLights.begin(); *************** *** 190,194 **** static _ptr proc = (_ptr) GetExtension(#_function); ! void OpenGLServer::glActiveTextureARB(unsigned int texture) { #ifdef __APPLE__ --- 194,199 ---- static _ptr proc = (_ptr) GetExtension(#_function); ! void ! OpenGLServer::glActiveTextureARB(unsigned int texture) { #ifdef __APPLE__ *************** *** 206,207 **** --- 211,226 ---- #endif } + + std::string + OpenGLServer::GetWindowHandleStr() const + { + long int handle = 0; + + if (mGLSystem.get() != 0) + { + handle = mGLSystem->GetWindowHandle(); + } + std::ostringstream ost; + ost << handle; + return ost.str(); + } |