Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Christian Butz
VTK
Commits
f29a28a9
Commit
f29a28a9
authored
Sep 29, 2017
by
H. Cole Wiley
Browse files
applied fixes that allow Android to bind to current EGL context
parent
ec3c7a4e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Rendering/OpenGL2/vtkEGLRenderWindow.cxx
View file @
f29a28a9
...
...
@@ -30,11 +30,10 @@
#include
<sstream>
#include
<EGL/egl.h>
#if ANDROID
#if
def
ANDROID
#include
<android/native_window.h>
#endif
namespace
{
typedef
void
*
EGLDeviceEXT
;
...
...
@@ -143,9 +142,11 @@ vtkEGLRenderWindow::vtkEGLRenderWindow()
this
->
ScreenSize
[
1
]
=
1080
;
// this is initialized in vtkRenderWindow
// so we don't need to initialize on else
#ifdef VTK_USE_OFFSCREEN_EGL
this
->
DeviceIndex
=
VTK_DEFAULT_EGL_DEVICE_INDEX
;
#endif
#if ANDROID
#if
def
ANDROID
this
->
OffScreenRendering
=
false
;
#else
// this is an offscreen-only window otherwise.
...
...
@@ -420,9 +421,15 @@ void vtkEGLRenderWindow::DestroyWindow()
// Initialize the window for rendering.
void
vtkEGLRenderWindow
::
WindowInitialize
(
void
)
{
vtkInternals
*
impl
=
this
->
Internals
;
if
(
this
->
OwnWindow
)
{
this
->
CreateAWindow
();
}
else
if
(
impl
->
Context
==
EGL_NO_CONTEXT
)
{
// Get our current context from the EGL current context
impl
->
Context
=
eglGetCurrentContext
();
}
this
->
MakeCurrent
();
...
...
@@ -455,8 +462,9 @@ void vtkEGLRenderWindow::Initialize (void)
{
this
->
WindowInitialize
();
}
else
else
if
(
this
->
OwnWindow
)
{
// We only need to resize the window if we own it
int
w
,
h
;
this
->
GetEGLSurfaceSize
(
&
w
,
&
h
);
if
(
w
!=
this
->
Size
[
0
]
||
h
!=
this
->
Size
[
1
])
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment