Commit 36627a6f authored by Ken Martin's avatar Ken Martin Committed by Kitware Robot
Browse files

Merge topic 'android_build_update'

6c4cf082 commneted out vtkRegressionTestImage
f29a28a9 applied fixes that allow Android to bind to current EGL context
ec3c7a4e using cmakedefine for ANDROID since its not being defined else where
35d6cf57

 added check for GL_POINT_SPRTIE define
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !3572
parents 5b514bdd 6c4cf082
......@@ -27,7 +27,9 @@
#include "vtkObjectFactory.h"
#include "vtkRegressionTestImage.h"
// NOTE: @hcwiley commented this out as its not being used, and causes builds
// to fail with examples on but testing off. Why is this included?
//#include "vtkRegressionTestImage.h"
class GraphAnimate : public vtkCommand
{
......
......@@ -30,11 +30,10 @@
#include <sstream>
#include <EGL/egl.h>
#if ANDROID
#ifdef 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
#ifdef 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();
......@@ -441,7 +448,9 @@ void vtkEGLRenderWindow::WindowInitialize (void)
// for offscreen EGL always turn on point sprites
if (this->OffScreenRendering)
{
#ifdef GL_POINT_SPRITE
glEnable(GL_POINT_SPRITE);
#endif
}
}
......@@ -453,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])
......
......@@ -32,6 +32,8 @@
#define VTK_OPENGL_ES_VERSION 30
#cmakedefine ANDROID
#ifdef ANDROID
# include <GLES3/gl3.h>
#else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment