diff options
| author | Egor <egor.yusov@gmail.com> | 2018-02-18 18:08:40 +0000 |
|---|---|---|
| committer | Egor <egor.yusov@gmail.com> | 2018-02-18 18:08:40 +0000 |
| commit | e4c889778bf39b393ce071594c39fc2714b90d54 (patch) | |
| tree | 42b5cc1334fe127dbf4f5ff45948b3cecea56a91 /Graphics/GraphicsEngineOpenGL | |
| parent | Implemented more robust screen orientation/size change handling on Android (diff) | |
| download | DiligentCore-e4c889778bf39b393ce071594c39fc2714b90d54.tar.gz DiligentCore-e4c889778bf39b393ce071594c39fc2714b90d54.zip | |
Updated handling glPolygonMode function on GLES
Diffstat (limited to 'Graphics/GraphicsEngineOpenGL')
| -rw-r--r-- | Graphics/GraphicsEngineOpenGL/src/GLContextState.cpp | 14 | ||||
| -rw-r--r-- | Graphics/GraphicsEngineOpenGL/src/GLStubsAndroid.cpp | 4 | ||||
| -rw-r--r-- | Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp | 3 |
3 files changed, 16 insertions, 5 deletions
diff --git a/Graphics/GraphicsEngineOpenGL/src/GLContextState.cpp b/Graphics/GraphicsEngineOpenGL/src/GLContextState.cpp index c05780bc..7f582257 100644 --- a/Graphics/GraphicsEngineOpenGL/src/GLContextState.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/GLContextState.cpp @@ -426,9 +426,17 @@ namespace Diligent { if( m_RSState.FillMode != FillMode ) { - auto PolygonMode = FillMode == FILL_MODE_WIREFRAME ? GL_LINE : GL_FILL; - glPolygonMode( GL_FRONT_AND_BACK, PolygonMode ); - CHECK_GL_ERROR( "Failed to set polygon mode" ); + if(glPolygonMode != nullptr) + { + auto PolygonMode = FillMode == FILL_MODE_WIREFRAME ? GL_LINE : GL_FILL; + glPolygonMode( GL_FRONT_AND_BACK, PolygonMode ); + CHECK_GL_ERROR( "Failed to set polygon mode" ); + } + else + { + if(FillMode != FILL_MODE_SOLID) + LOG_ERROR("This API/device only supports solid fill mode"); + } m_RSState.FillMode = FillMode; } diff --git a/Graphics/GraphicsEngineOpenGL/src/GLStubsAndroid.cpp b/Graphics/GraphicsEngineOpenGL/src/GLStubsAndroid.cpp index 643aad8a..32d83727 100644 --- a/Graphics/GraphicsEngineOpenGL/src/GLStubsAndroid.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/GLStubsAndroid.cpp @@ -97,7 +97,7 @@ #endif #ifdef LOAD_GL_POLYGON_MODE - DECLARE_GL_FUNCTION( glPolygonMode, PFNGLPOLYGONMODE, GLenum, GLenum) + PFNGLPOLYGONMODE glPolygonMode = nullptr; #endif #ifdef LOAD_GL_ENABLEI @@ -225,7 +225,7 @@ Func = (FuncType)eglGetProcAddress( #Func );\ #endif #ifdef LOAD_GL_POLYGON_MODE - LOAD_GL_FUNCTION( glPolygonMode, PFNGLPOLYGONMODE) + glPolygonMode = (PFNGLPOLYGONMODE)eglGetProcAddress("glPolygonMode"); #endif #ifdef LOAD_GL_ENABLEI diff --git a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp index ffb9794a..4676bb4a 100644 --- a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceGLImpl.cpp @@ -643,6 +643,9 @@ void RenderDeviceGLImpl::TestTextureFormat( TEXTURE_FORMAT TexFormat ) void RenderDeviceGLImpl :: QueryDeviceCaps() { + if(glPolygonMode == nullptr) + m_DeviceCaps.bWireframeFillSupported = false; + if(m_DeviceCaps.bWireframeFillSupported) { // Test glPolygonMode() function to check if it fails |
