Skip to content

Commit 2a38d40

Browse files
GLContextAndroid: removed unused context_valid_ member
1 parent 1124f4e commit 2a38d40

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

Graphics/GraphicsEngineOpenGL/include/GLContextAndroid.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019-2022 Diligent Graphics LLC
2+
* Copyright 2019-2024 Diligent Graphics LLC
33
* Copyright 2015-2019 Egor Yusov
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -85,7 +85,6 @@ class GLContext
8585
//Flags
8686
bool gles_initialized_ = false;
8787
bool egl_context_initialized_ = false;
88-
bool context_valid_ = false;
8988

9089
void InitGLES();
9190
void Terminate();

Graphics/GraphicsEngineOpenGL/src/GLContextAndroid.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019-2023 Diligent Graphics LLC
2+
* Copyright 2019-2024 Diligent Graphics LLC
33
* Copyright 2015-2019 Egor Yusov
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -198,7 +198,6 @@ bool GLContext::InitEGLContext()
198198
}
199199

200200
LOG_INFO_MESSAGE("Created OpenGLES Context ", major_version_, '.', minor_version_);
201-
context_valid_ = true;
202201
return true;
203202
}
204203

@@ -217,7 +216,6 @@ void GLContext::AttachToCurrentEGLContext()
217216
{
218217
LOG_ERROR_AND_THROW("Failed to attach to EGLContext: no active context");
219218
}
220-
context_valid_ = true;
221219
glGetIntegerv(GL_MAJOR_VERSION, &major_version_);
222220
glGetIntegerv(GL_MINOR_VERSION, &minor_version_);
223221
}
@@ -288,8 +286,7 @@ GLContext::GLContext(const EngineGLCreateInfo& InitAttribs,
288286
major_version_(0),
289287
minor_version_(0),
290288
gles_initialized_(false),
291-
egl_context_initialized_(false),
292-
context_valid_(false)
289+
egl_context_initialized_(false)
293290
{
294291
auto* NativeWindow = reinterpret_cast<ANativeWindow*>(InitAttribs.Window.pAWindow);
295292
Init(NativeWindow);
@@ -346,7 +343,6 @@ void GLContext::SwapBuffers(int SwapInterval)
346343
else if (err == EGL_CONTEXT_LOST || err == EGL_BAD_CONTEXT)
347344
{
348345
//Context has been lost!!
349-
context_valid_ = false;
350346
Terminate();
351347
if (context_)
352348
{
@@ -380,10 +376,9 @@ void GLContext::Terminate()
380376
eglTerminate(display_);
381377
}
382378

383-
display_ = EGL_NO_DISPLAY;
384-
context_ = EGL_NO_CONTEXT;
385-
surface_ = EGL_NO_SURFACE;
386-
context_valid_ = false;
379+
display_ = EGL_NO_DISPLAY;
380+
context_ = EGL_NO_CONTEXT;
381+
surface_ = EGL_NO_SURFACE;
387382
}
388383

389384

0 commit comments

Comments
 (0)