From f5cef88e1449439f1bce3a43b16b9c5286ace2f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 26 Jan 2017 11:57:48 +0100 Subject: [PATCH] Workaround for exit crash on Android. Need to rethink this... --- ext/native/thin3d/thin3d_gl.cpp | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/ext/native/thin3d/thin3d_gl.cpp b/ext/native/thin3d/thin3d_gl.cpp index 85b503fff7..1293282866 100644 --- a/ext/native/thin3d/thin3d_gl.cpp +++ b/ext/native/thin3d/thin3d_gl.cpp @@ -658,7 +658,7 @@ inline bool isPowerOf2(int n) { return n == 1 || (n & (n - 1)) == 0; } -class OpenGLTexture : public Texture, GfxResourceHolder { +class OpenGLTexture : public Texture { public: OpenGLTexture(const TextureDesc &desc) : tex_(0), target_(TypeToTarget(desc.type)), format_(desc.format), mipLevels_(desc.mipLevels) { generatedMips_ = false; @@ -669,7 +669,6 @@ public: canWrap_ = !isPowerOf2(width_) || !isPowerOf2(height_); glGenTextures(1, &tex_); - register_gl_resource_holder(this); if (!desc.initData.size()) return; @@ -685,7 +684,6 @@ public: AutoGenMipmaps(); } ~OpenGLTexture() { - unregister_gl_resource_holder(this); Destroy(); } @@ -711,15 +709,6 @@ public: glBindTexture(target_, tex_); } - void GLLost() override { - // We can assume that the texture is gone. - tex_ = 0; - generatedMips_ = false; - } - - void GLRestore() override { - } - private: GLuint tex_; GLuint target_; @@ -882,6 +871,9 @@ RasterState *OpenGLContext::CreateRasterState(const RasterStateDesc &desc) { case CullMode::FRONT_AND_BACK: rs->cullMode = GL_FRONT_AND_BACK; break; + case CullMode::NONE: + // Unsupported + break; } return rs; } @@ -1192,4 +1184,4 @@ uint32_t OpenGLContext::GetDataFormatSupport(DataFormat fmt) const { } } -} // namespace Draw \ No newline at end of file +} // namespace Draw