From: Oliver O. <fr...@us...> - 2007-06-17 13:39:37
|
Update of /cvsroot/simspark/simspark/spark/kerosin/openglserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv21072/kerosin/openglserver Modified Files: openglserver.cpp openglserver.h openglsystem.h openglwrapper.h Log Message: merge from projectx branch Index: openglserver.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/openglserver/openglserver.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** openglserver.cpp 15 Mar 2007 07:26:26 -0000 1.2 --- openglserver.cpp 17 Jun 2007 13:38:30 -0000 1.3 *************** *** 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__ *************** *** 197,201 **** #else PROC_ADDRESS(PFNGLACTIVETEXTUREARBPROC, "glActiveTextureARB"); - if (! proc) { --- 202,205 ---- *************** *** 206,207 **** --- 210,231 ---- #endif } + + long int + OpenGLServer::GetWindowHandle() const + { + if (mGLSystem.get() == 0) + { + return 0; + } + return mGLSystem->GetWindowHandle(); + } + + bool + OpenGLServer::IsGLLocked() const + { + if (mGLSystem.get() == 0) + { + return true; + } + return mGLSystem->IsGLLocked(); + } Index: openglsystem.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/openglserver/openglsystem.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** openglsystem.h 15 Mar 2007 07:26:26 -0000 1.2 --- openglsystem.h 17 Jun 2007 13:38:30 -0000 1.3 *************** *** 50,53 **** --- 50,59 ---- virtual void SwapBuffers() = 0; + //! get a handle for the active window. + virtual unsigned long int GetWindowHandle() const { return 0; } + + //! return if the GL subsystem locks using OpenGL to get exclusive access. + virtual bool IsGLLocked() const { return false; } + protected: // Index: openglwrapper.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/openglserver/openglwrapper.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** openglwrapper.h 9 Apr 2007 17:13:44 -0000 1.3 --- openglwrapper.h 17 Jun 2007 13:38:30 -0000 1.4 *************** *** 42,46 **** #include <GL/wglext.h> #elif defined(__APPLE__) ! /* nothing here */ #else #include <GL/glx.h> --- 42,46 ---- #include <GL/wglext.h> #elif defined(__APPLE__) ! #include <OpenGL/glu.h> #else #include <GL/glx.h> Index: openglserver.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/openglserver/openglserver.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** openglserver.h 15 Mar 2007 07:26:26 -0000 1.2 --- openglserver.h 17 Jun 2007 13:38:30 -0000 1.3 *************** *** 1,5 **** /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- ! this file is part of rcssserver3D Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University --- 1,5 ---- /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- ! this file is part of simspark Fri May 9 2003 Copyright (C) 2002,2003 Koblenz University *************** *** 83,89 **** static void* GetExtension(const char* name); ! /** looksup and calls glActiveTextureARB extension if available */ static void glActiveTextureARB(unsigned int texture); protected: //! set up opengl viewport --- 83,95 ---- static void* GetExtension(const char* name); ! /** looks up and calls glActiveTextureARB extension if available */ static void glActiveTextureARB(unsigned int texture); + //! return the main window handle from the gl subsystem + long int GetWindowHandle() const; + + //! return if the GL subsystem locks using OpenGL to get exclusive access + bool IsGLLocked() const; + protected: //! set up opengl viewport |