Merge pull request 'Reduce minimum required OpenGL version from 3.3.0 to 2.1.0, and other fixes' (#3) from gl-renderer into main
Reviewed-on: #3
This commit is contained in:
commit
53a758688e
3 changed files with 10 additions and 5 deletions
|
@ -184,7 +184,7 @@ MACRO(CHECK_LIBRARIES)
|
||||||
ENDIF(ENET_FOUND)
|
ENDIF(ENET_FOUND)
|
||||||
|
|
||||||
# OpenGL
|
# OpenGL
|
||||||
Find_Package(OpenGL)
|
Find_Package(OpenGL 2.1.0)
|
||||||
|
|
||||||
IF(OPENGL_FOUND)
|
IF(OPENGL_FOUND)
|
||||||
SET(HAVE_LIBGL 1)
|
SET(HAVE_LIBGL 1)
|
||||||
|
|
|
@ -377,7 +377,11 @@ SDL_Surface* gfScrCreateWindow(int nWinWidth, int nWinHeight, int nTotalDepth,in
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* Create OpenGL context */
|
/* Create OpenGL context */
|
||||||
GLContext = SDL_GL_CreateContext(GfuiWindow);
|
if (!(GLContext = SDL_GL_CreateContext(GfuiWindow)))
|
||||||
|
{
|
||||||
|
GfLogError("SDL_GL_CreateContext failed: %s\n", SDL_GetError());
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
// If specified, try best possible settings.
|
// If specified, try best possible settings.
|
||||||
PScreenSurface = SDL_CreateRGBSurface(0, nWinWidth, nWinHeight, nTotalDepth,
|
PScreenSurface = SDL_CreateRGBSurface(0, nWinWidth, nWinHeight, nTotalDepth,
|
||||||
|
@ -427,8 +431,8 @@ bool GfScrInitSDL2(int nWinWidth, int nWinHeight, int nFullScreen)
|
||||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
|
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
|
||||||
#else
|
#else
|
||||||
// Version d'OpenGL
|
// Version d'OpenGL
|
||||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
|
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
|
||||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3);
|
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
|
||||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY);
|
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -644,7 +644,8 @@ osg::ref_ptr<osg::Node> SDCar::loadCar(tCarElt *Car, bool tracktype, bool subcat
|
||||||
else
|
else
|
||||||
this->reflectionMappingMethod = REFLECTIONMAPPING_OFF;
|
this->reflectionMappingMethod = REFLECTIONMAPPING_OFF;
|
||||||
|
|
||||||
this->shader = new SDCarShader(car_shaded_body.get(), this);
|
if (_carShader > 0)
|
||||||
|
this->shader = new SDCarShader(car_shaded_body.get(), this);
|
||||||
|
|
||||||
this->reflectionMapping = new SDReflectionMapping(this);
|
this->reflectionMapping = new SDReflectionMapping(this);
|
||||||
this->setReflectionMap(this->reflectionMapping->getReflectionMap());
|
this->setReflectionMap(this->reflectionMapping->getReflectionMap());
|
||||||
|
|
Loading…
Reference in a new issue