MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0030600Open CASCADE[OCCT] OCCT:Visualizationpublic2019-03-22 14:202019-03-22 15:06
Reporterkgv 
Assigned Tokgv 
PrioritynormalSeverityintegration request 
StatusnewResolutionopen 
PlatformOSOS Version
Product Version 
Target Version[OCCT] 7.4.0*Fixed in Version 
Summary0030600: Visualization, TKOpenGl - include GLES3/gl3.h instead of GLES2/gl2.h
DescriptionOpenGl_GlFunctions.hxx currently includes GLES2/gl2.h header for compatibility with old Android/iOS devices. This leads to extra bloating re-definitions for using GLES3 functionality.

// include main OpenGL header provided with system
#if defined(__APPLE__)
  #import <TargetConditionals.h>
  #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
    #include <OpenGLES/ES2/gl.h>
  #else
    #include <OpenGL/gl.h>
  #endif
  #define __X_GL_H // prevent chaotic gl.h inclusions to avoid compile errors
#elif defined(HAVE_GLES2) || defined(OCCT_UWP) || defined(__ANDROID__) || defined(__QNX__)
  #if defined(_WIN32)
    // Angle OpenGL ES headers do not define function prototypes even for core functions,
    // however OCCT is expected to be linked against libGLESv2
    #define GL_GLEXT_PROTOTYPES
  #endif
  #include <GLES2/gl2.h>
  //#include <GLES3/gl3.h>
#else
  #include <GL/gl.h>
#endif


It is proposed to use GLES3/gl3.h and remove extra macros, but at the same time remain linking to libGLESv2.so, so that only header files will be actually needed for building.
This should work transparently for newer Android NDK (like android-ndk-r16b), where header files are now shared across all versions, but on older NDKs (like android-ndk-r12), this would require building for at least Android 19+ (or hacking earlier Android headers by copying GLES3).

The same should apply to iOS target [OpenGLES/ES3/gl.h].
Note that OpenGl_Window_1.mm should be also updated to try creating kEAGLRenderingAPIOpenGLES3 and then fallback to kEAGLRenderingAPIOpenGLES2:
    aGLContext = [[EAGLContext alloc] initWithAPI: kEAGLRenderingAPIOpenGLES2];
Steps To ReproduceN/A
TagsNo tags attached.
Test case number
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2019-03-22 14:20 kgv New Issue
2019-03-22 14:20 kgv Assigned To => kgv
2019-03-22 14:20 kgv Relationship added related to 0030505
2019-03-22 15:06 kgv Description Updated View Revisions


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker