deathkiller / jazz2-native

🎮 · Jazz² Resurrection: Native C++ reimplementation of Jazz Jackrabbit 2
https://deat.tk/jazz2/
GNU General Public License v3.0
549 stars 37 forks source link

Building against GLES2/3 on non-Android platforms #60

Closed vanfanel closed 5 months ago

vanfanel commented 6 months ago

Jazz² Resurrection version

Latest GIT code

Problem or limitation

Looking at https://github.com/deathkiller/jazz2-native/blob/dcfdf210f89e3d12a8c5a9d136ef249b3ca0b8ef/cmake/ncine_imported_targets.cmake#L213 it seems that GLES2 is only searched when an ARM processor is found. Would it be possible to have GLES support (as opposed to full OpenGL) on non-ARM CPUs?

I have been trying to implement this (with a new CMake parameter like -DUSE_GLES) but commenting out the mentioned if(NCINE_ARM_PROCESSOR), OpenGL is still used.

Proposed solution

A simple -DUSE_GLES parameter for CMake

deathkiller commented 5 months ago

Can you check if OPENGLES2_FOUND is true, and OPENGL_FOUND is false? Please, include also the cmake configuration log (after you remove the mentioned line with if(NCINE_ARM_PROCESSOR)). Is it possible that you have both libraries on your system? So you want to force link only to GLES library?

It tries to link to what is available, the code is here: https://github.com/deathkiller/jazz2-native/blob/f26b8963a669c8e7b7b3316c913bce00a6a9d13d/cmake/ncine_extra_sources.cmake#L28-L48

vanfanel commented 5 months ago

@deathkiller After removing the aforementioned ARM line, this is the log: the *** lines are message() lines I inserted under if(OPENGL_FOUND) and if(ANGLE_FOUND OR OPENGLES2_FOUND):

manuel@debian:~/src/jazz2-native/b4$ cmake ..
-- The CXX compiler identification is GNU 13.2.0
-- The C compiler identification is GNU 13.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Compiling for architecture: x86_64
-- Content directory: /home/manuel/src/jazz2-native/Content
-- Found Git: /usr/bin/git (found version "2.43.0")
-- Game version: 2024.05.r2-f26b896
-- Downloading dependencies from "https://github.com/deathkiller/jazz2-libraries/archive/2.6.1.tar.gz"...
-- Could NOT find libdw (missing: LIBDW_LIBRARY LIBDW_INCLUDE_DIR) 
-- Could NOT find libbfd (missing: LIBBFD_LIBRARY LIBBFD_INCLUDE_DIR) 
-- Could NOT find libdwarf (missing: LIBDWARF_LIBRARY LIBDWARF_INCLUDE_DIR) 
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.3")
-- Found GLEW: /home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Linux/x86_64/libGLEW.so (found version "2.2.0")
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
-- Found system OpenGL|ES 2 library: /usr/lib/x86_64-linux-gnu/libGLESv2.so
-- Found GLFW: /home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Linux/x86_64/libglfw.so
-- Found SDL2: /usr/lib/x86_64-linux-gnu/libSDL2main.a;/usr/lib/x86_64-linux-gnu/libSDL2.so
-- Found OpenAL: /home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Linux/x86_64/libopenal.so
-- Could NOT find Vorbis (missing: OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY VORBIS_INCLUDE_DIR) 
-- Found libopenmpt: /home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Linux/x86_64/libopenmpt.so
-- Using GLFW as the preferred backend
-- Using GNU IFUNC for CPU-dependent functionality
-- Runtime event tracing is enabled
***********OPENGL_FOUND is TRUE
-- Using newer OpenGL::OpenGL target (GLVND)
***********OPENGLES2_FOUND is TRUE
-- Exporting shader files to C strings
-- Configuring done (25.5s)
-- Generating done (0.0s)
-- Build files have been written to: /home/manuel/src/jazz2-native/b4

This system, like any modern GNU/Linux distro, has both OpenGL and GLES2/3 installed.

The idea is having a -DUSE_GLES or similar parameter to build against GLES even if OpenGL is present: GLES has better performance in lightweight system. Even if modern GLVND OpenGL is installed, GLES may be preferred.

After configuring on a system with both OpenGL and GLES, however, building against GLES fails with errors:

In file included from /home/manuel/src/jazz2-native/Sources/nCine/Backends/../Graphics/../CommonHeaders.h:6,
                 from /home/manuel/src/jazz2-native/Sources/nCine/Backends/../Graphics/TextureFormat.h:4,
                 from /home/manuel/src/jazz2-native/Sources/nCine/Backends/../Graphics/ITextureLoader.h:3,
                 from /home/manuel/src/jazz2-native/Sources/nCine/Backends/GlfwGfxDevice.cpp:5:
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GLES3/gl3.h:507:60: error: ‘void __glewActiveTexture(GLenum)’ redeclared as different kind of entity
  507 | GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);
      |                                                            ^
In file included from /home/manuel/src/jazz2-native/Sources/nCine/Backends/GlfwGfxDevice.h:9,
                 from /home/manuel/src/jazz2-native/Sources/nCine/Backends/GlfwGfxDevice.cpp:3:
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GL/glew.h:22286:40: note: previous declaration ‘void (* __glewActiveTexture)(GLenum)’
22286 | GLEW_FUN_EXPORT PFNGLACTIVETEXTUREPROC __glewActiveTexture;
      |                                        ^~~~~~~~~~~~~~~~~~~
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GLES3/gl3.h:508:74: error: ‘void __glewAttachShader(GLuint, GLuint)’ redeclared as different kind of entity
  508 | GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
      |                                                                          ^
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GL/glew.h:22401:39: note: previous declaration ‘void (* __glewAttachShader)(GLuint, GLuint)’
22401 | GLEW_FUN_EXPORT PFNGLATTACHSHADERPROC __glewAttachShader;
      |                                       ^~~~~~~~~~~~~~~~~~
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GLES3/gl3.h:509:99: error: ‘void __glewBindAttribLocation(GLuint, GLuint, const GLchar*)’ redeclared as different kind of entity
  509 | GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name);
      |                                                                                                   ^
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GL/glew.h:22402:45: note: previous declaration ‘void (* __glewBindAttribLocation)(GLuint, GLuint, const GLchar*)’
22402 | GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation;
      |                                             ^~~~~~~~~~~~~~~~~~~~~~~~
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GLES3/gl3.h:510:71: error: ‘void __glewBindBuffer(GLenum, GLuint)’ redeclared as different kind of entity
  510 | GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
      |                                                                       ^
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GL/glew.h:22382:37: note: previous declaration ‘void (* __glewBindBuffer)(GLenum, GLuint)’
22382 | GLEW_FUN_EXPORT PFNGLBINDBUFFERPROC __glewBindBuffer;
      |                                     ^~~~~~~~~~~~~~~~
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GLES3/gl3.h:511:81: error: ‘void __glewBindFramebuffer(GLenum, GLuint)’ redeclared as different kind of entity
  511 | GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
      |                                                                                 ^
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GL/glew.h:22896:42: note: previous declaration ‘void (* __glewBindFramebuffer)(GLenum, GLuint)’
22896 | GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFERPROC __glewBindFramebuffer;
      |                                          ^~~~~~~~~~~~~~~~~~~~~
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GLES3/gl3.h:512:83: error: ‘void __glewBindRenderbuffer(GLenum, GLuint)’ redeclared as different kind of entity
  512 | GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
      |                                                                                   ^
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GL/glew.h:22897:43: note: previous declaration ‘void (* __glewBindRenderbuffer)(GLenum, GLuint)’
22897 | GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFERPROC __glewBindRenderbuffer;
      |                                           ^~~~~~~~~~~~~~~~~~~~~~
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GLES3/gl3.h:514:98: error: ‘void __glewBlendColor(GLfloat, GLfloat, GLfloat, GLfloat)’ redeclared as different kind of entity
  514 | GL_APICALL void GL_APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
      |                                                                                                  ^
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GL/glew.h:22333:37: note: previous declaration ‘void (* __glewBlendColor)(GLclampf, GLclampf, GLclampf, GLclampf)’
22333 | GLEW_FUN_EXPORT PFNGLBLENDCOLORPROC __glewBlendColor;
      |                                     ^~~~~~~~~~~~~~~~
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GLES3/gl3.h:515:57: error: ‘void __glewBlendEquation(GLenum)’ redeclared as different kind of entity
  515 | GL_APICALL void GL_APIENTRY glBlendEquation (GLenum mode);
      |                                                         ^
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GL/glew.h:22334:40: note: previous declaration ‘void (* __glewBlendEquation)(GLenum)’
22334 | GLEW_FUN_EXPORT PFNGLBLENDEQUATIONPROC __glewBlendEquation;
      |                                        ^~~~~~~~~~~~~~~~~~~
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GLES3/gl3.h:516:86: error: ‘void __glewBlendEquationSeparate(GLenum, GLenum)’ redeclared as different kind of entity
  516 | GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
      |                                                                                      ^
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GL/glew.h:22403:48: note: previous declaration ‘void (* __glewBlendEquationSeparate)(GLenum, GLenum)’
22403 | GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEPROC __glewBlendEquationSeparate;
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GLES3/gl3.h:518:128: error: ‘void __glewBlendFuncSeparate(GLenum, GLenum, GLenum, GLenum)’ redeclared as different kind of entity
  518 | GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
      |                                                                                                                                ^
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GL/glew.h:22335:44: note: previous declaration ‘void (* __glewBlendFuncSeparate)(GLenum, GLenum, GLenum, GLenum)’
22335 | GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEPROC __glewBlendFuncSeparate;
      |                                            ^~~~~~~~~~~~~~~~~~~~~~~
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GLES3/gl3.h:519:105: error: ‘void __glewBufferData(GLenum, GLsizeiptr, const void*, GLenum)’ redeclared as different kind of entity
  519 | GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
      |                                                                                                         ^
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GL/glew.h:22383:37: note: previous declaration ‘void (* __glewBufferData)(GLenum, GLsizeiptr, const void*, GLenum)’
22383 | GLEW_FUN_EXPORT PFNGLBUFFERDATAPROC __glewBufferData;
      |                                     ^~~~~~~~~~~~~~~~
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GLES3/gl3.h:520:111: error: ‘void __glewBufferSubData(GLenum, GLintptr, GLsizeiptr, const void*)’ redeclared as different kind of entity
  520 | GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
      |                                                                                                               ^
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GL/glew.h:22384:40: note: previous declaration ‘void (* __glewBufferSubData)(GLenum, GLintptr, GLsizeiptr, const void*)’
22384 | GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAPROC __glewBufferSubData;
      |                                        ^~~~~~~~~~~~~~~~~~~
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GLES3/gl3.h:521:70: error: ‘GLenum __glewCheckFramebufferStatus(GLenum)’ redeclared as different kind of entity
  521 | GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target);
      |                                                                      ^
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GL/glew.h:22899:49: note: previous declaration ‘GLenum (* __glewCheckFramebufferStatus)(GLenum)’
22899 | GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus;
      |                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GLES3/gl3.h:524:53: error: ‘void __glewClearDepthf(GLfloat)’ redeclared as different kind of entity
  524 | GL_APICALL void GL_APIENTRY glClearDepthf (GLfloat d);
      |                                                     ^
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GL/glew.h:22714:38: note: previous declaration ‘void (* __glewClearDepthf)(GLclampf)’
22714 | GLEW_FUN_EXPORT PFNGLCLEARDEPTHFPROC __glewClearDepthf;
      |                                      ^~~~~~~~~~~~~~~~~
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GLES3/gl3.h:527:59: error: ‘void __glewCompileShader(GLuint)’ redeclared as different kind of entity
  527 | GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader);
      |                                                           ^
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GL/glew.h:22404:40: note: previous declaration ‘void (* __glewCompileShader)(GLuint)’
22404 | GLEW_FUN_EXPORT PFNGLCOMPILESHADERPROC __glewCompileShader;
      |                                        ^~~~~~~~~~~~~~~~~~~
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GLES3/gl3.h:528:184: error: ‘void __glewCompressedTexImage2D(GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const void*)’ redeclared as different kind of entity
  528 | GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
      |                                                                                                                                                                                        ^
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GL/glew.h:22289:47: note: previous declaration ‘void (* __glewCompressedTexImage2D)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const void*)’
22289 | GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DPROC __glewCompressedTexImage2D;
      |                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GLES3/gl3.h:529:195: error: ‘void __glewCompressedTexSubImage2D(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const void*)’ redeclared as different kind of entity
  529 | GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
      |                                                                                                                                                                                                   ^
/home/manuel/src/jazz2-native/b4/_deps/ncine_libraries-src/Includes/GL/glew.h:22292:50: note: previous declaration ‘void (* __glewCompressedTexSubImage2D)(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const void*)’
22292 | GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC __glewCompressedTexSubImage2D;
vanfanel commented 5 months ago

I also tried passing -DNCINE_PREFERRED_BACKEND=SDL2 and got different errors:

[  1%] Building CXX object CMakeFiles/jazz2.dir/Sources/nCine/Backends/SdlGfxDevice.cpp.o
In file included from /home/manuel/src/jazz2-native/Sources/nCine/Backends/SdlGfxDevice.cpp:8:
/home/manuel/src/jazz2-native/b5/_deps/ncine_libraries-src/Includes/GL/glew.h:23671:17: error: ‘PFNGLBLENDEQUATIONEXTPROC’ does not name a type; did you mean ‘PFNGLBLENDEQUATIONIEXTPROC’?
23671 | GLEW_FUN_EXPORT PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT;
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                 PFNGLBLENDEQUATIONIEXTPROC
/home/manuel/src/jazz2-native/b5/_deps/ncine_libraries-src/Includes/GL/glew.h:23674:17: error: ‘PFNGLNAMEDBUFFERSTORAGEEXTPROC’ does not name a type; did you mean ‘PFNGLNAMEDBUFFERSTORAGEPROC’?
23674 | GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSTORAGEEXTPROC __glewNamedBufferStorageEXT;
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                 PFNGLNAMEDBUFFERSTORAGEPROC
/home/manuel/src/jazz2-native/b5/_deps/ncine_libraries-src/Includes/GL/glew.h:24108:17: error: ‘PFNGLTEXSTORAGEMEM1DEXTPROC’ does not name a type; did you mean ‘PFNGLTEXSTORAGEMEM3DEXTPROC’?
24108 | GLEW_FUN_EXPORT PFNGLTEXSTORAGEMEM1DEXTPROC __glewTexStorageMem1DEXT;
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                 PFNGLTEXSTORAGEMEM3DEXTPROC
/home/manuel/src/jazz2-native/b5/_deps/ncine_libraries-src/Includes/GL/glew.h:24113:17: error: ‘PFNGLTEXTURESTORAGEMEM1DEXTPROC’ does not name a type; did you mean ‘PFNGLTEXTURESTORAGEMEM3DEXTPROC’?
24113 | GLEW_FUN_EXPORT PFNGLTEXTURESTORAGEMEM1DEXTPROC __glewTextureStorageMem1DEXT;
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                 PFNGLTEXTURESTORAGEMEM3DEXTPROC
/home/manuel/src/jazz2-native/b5/_deps/ncine_libraries-src/Includes/GL/glew.h:24205:17: error: ‘PFNGLACTIVEPROGRAMEXTPROC’ does not name a type; did you mean ‘PFNGLACTIVESHADERPROGRAMEXTPROC’?
24205 | GLEW_FUN_EXPORT PFNGLACTIVEPROGRAMEXTPROC __glewActiveProgramEXT;
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                 PFNGLACTIVESHADERPROGRAMEXTPROC
/home/manuel/src/jazz2-native/b5/_deps/ncine_libraries-src/Includes/GL/glew.h:24206:17: error: ‘PFNGLCREATESHADERPROGRAMEXTPROC’ does not name a type; did you mean ‘PFNGLCREATESHADERPROGRAMVEXTPROC’?
24206 | GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMEXTPROC __glewCreateShaderProgramEXT;
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                 PFNGLCREATESHADERPROGRAMVEXTPROC
/home/manuel/src/jazz2-native/b5/_deps/ncine_libraries-src/Includes/GL/glew.h:24207:17: error: ‘PFNGLUSESHADERPROGRAMEXTPROC’ does not name a type; did you mean ‘PFNGLACTIVESHADERPROGRAMEXTPROC’?
24207 | GLEW_FUN_EXPORT PFNGLUSESHADERPROGRAMEXTPROC __glewUseShaderProgramEXT;
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                 PFNGLACTIVESHADERPROGRAMEXTPROC
/home/manuel/src/jazz2-native/b5/_deps/ncine_libraries-src/Includes/GL/glew.h:24219:17: error: ‘PFNGLTEXTUREPAGECOMMITMENTEXTPROC’ does not name a type; did you mean ‘PFNGLTEXTUREPAGECOMMITMENTMEMNVPROC’?
24219 | GLEW_FUN_EXPORT PFNGLTEXTUREPAGECOMMITMENTEXTPROC __glewTexturePageCommitmentEXT;
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                 PFNGLTEXTUREPAGECOMMITMENTMEMNVPROC
/home/manuel/src/jazz2-native/b5/_deps/ncine_libraries-src/Includes/GL/glew.h:24416:17: error: ‘PFNGLDEBUGMESSAGECALLBACKPROC’ does not name a type; did you mean ‘PFNGLDEBUGMESSAGECALLBACKKHRPROC’?
24416 | GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKPROC __glewDebugMessageCallback;
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                 PFNGLDEBUGMESSAGECALLBACKKHRPROC
/home/manuel/src/jazz2-native/b5/_deps/ncine_libraries-src/Includes/GL/glew.h:24417:17: error: ‘PFNGLDEBUGMESSAGECONTROLPROC’ does not name a type; did you mean ‘PFNGLDEBUGMESSAGECONTROLKHRPROC’?
24417 | GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLPROC __glewDebugMessageControl;
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                 PFNGLDEBUGMESSAGECONTROLKHRPROC
/home/manuel/src/jazz2-native/b5/_deps/ncine_libraries-src/Includes/GL/glew.h:24418:17: error: ‘PFNGLDEBUGMESSAGEINSERTPROC’ does not name a type; did you mean ‘PFNGLDEBUGMESSAGEINSERTKHRPROC’?
24418 | GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTPROC __glewDebugMessageInsert;
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                 PFNGLDEBUGMESSAGEINSERTKHRPROC
/home/manuel/src/jazz2-native/b5/_deps/ncine_libraries-src/Includes/GL/glew.h:24419:17: error: ‘PFNGLGETDEBUGMESSAGELOGPROC’ does not name a type; did you mean ‘PFNGLGETDEBUGMESSAGELOGKHRPROC’?
24419 | GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGPROC __glewGetDebugMessageLog;
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                 PFNGLGETDEBUGMESSAGELOGKHRPROC
/home/manuel/src/jazz2-native/b5/_deps/ncine_libraries-src/Includes/GL/glew.h:24420:17: error: ‘PFNGLGETOBJECTLABELPROC’ does not name a type; did you mean ‘PFNGLGETOBJECTLABELKHRPROC’?
24420 | GLEW_FUN_EXPORT PFNGLGETOBJECTLABELPROC __glewGetObjectLabel;
      |                 ^~~~~~~~~~~~~~~~~~~~~~~
      |                 PFNGLGETOBJECTLABELKHRPROC
/home/manuel/src/jazz2-native/b5/_deps/ncine_libraries-src/Includes/GL/glew.h:24421:17: error: ‘PFNGLGETOBJECTPTRLABELPROC’ does not name a type; did you mean ‘PFNGLGETOBJECTPTRLABELKHRPROC’?
24421 | GLEW_FUN_EXPORT PFNGLGETOBJECTPTRLABELPROC __glewGetObjectPtrLabel;
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |                 PFNGLGETOBJECTPTRLABELKHRPROC
/home/manuel/src/jazz2-native/b5/_deps/ncine_libraries-src/Includes/GL/glew.h:24422:17: error: ‘PFNGLOBJECTLABELPROC’ does not name a type; did you mean ‘PFNGLOBJECTLABELKHRPROC’?
24422 | GLEW_FUN_EXPORT PFNGLOBJECTLABELPROC __glewObjectLabel;
      |                 ^~~~~~~~~~~~~~~~~~~~
      |                 PFNGLOBJECTLABELKHRPROC
/home/manuel/src/jazz2-native/b5/_deps/ncine_libraries-src/Includes/GL/glew.h:24423:17: error: ‘PFNGLOBJECTPTRLABELPROC’ does not name a type; did you mean ‘PFNGLOBJECTPTRLABELKHRPROC’?
24423 | GLEW_FUN_EXPORT PFNGLOBJECTPTRLABELPROC __glewObjectPtrLabel;
      |                 ^~~~~~~~~~~~~~~~~~~~~~~
      |                 PFNGLOBJECTPTRLABELKHRPROC
/home/manuel/src/jazz2-native/b5/_deps/ncine_libraries-src/Includes/GL/glew.h:24424:17: error: ‘PFNGLPOPDEBUGGROUPPROC’ does not name a type; did you mean ‘PFNGLPOPDEBUGGROUPKHRPROC’?
24424 | GLEW_FUN_EXPORT PFNGLPOPDEBUGGROUPPROC __glewPopDebugGroup;
      |                 ^~~~~~~~~~~~~~~~~~~~~~
      |                 PFNGLPOPDEBUGGROUPKHRPROC
/home/manuel/src/jazz2-native/b5/_deps/ncine_libraries-src/Includes/GL/glew.h:24425:17: error: ‘PFNGLPUSHDEBUGGROUPPROC’ does not name a type; did you mean ‘PFNGLPUSHDEBUGGROUPKHRPROC’?
24425 | GLEW_FUN_EXPORT PFNGLPUSHDEBUGGROUPPROC __glewPushDebugGroup;
      |                 ^~~~~~~~~~~~~~~~~~~~~~~
      |                 PFNGLPUSHDEBUGGROUPKHRPROC
/home/manuel/src/jazz2-native/b5/_deps/ncine_libraries-src/Includes/GL/glew.h:24429:17: error: ‘PFNGLGETNUNIFORMFVPROC’ does not name a type; did you mean ‘PFNGLGETUNIFORMFVPROC’?
24429 | GLEW_FUN_EXPORT PFNGLGETNUNIFORMFVPROC __glewGetnUniformfv;
      |                 ^~~~~~~~~~~~~~~~~~~~~~
      |                 PFNGLGETUNIFORMFVPROC
/home/manuel/src/jazz2-native/b5/_deps/ncine_libraries-src/Includes/GL/glew.h:24430:17: error: ‘PFNGLGETNUNIFORMIVPROC’ does not name a type; did you mean ‘PFNGLGETUNIFORMIVPROC’?
24430 | GLEW_FUN_EXPORT PFNGLGETNUNIFORMIVPROC __glewGetnUniformiv;
      |                 ^~~~~~~~~~~~~~~~~~~~~~
      |                 PFNGLGETUNIFORMIVPROC
/home/manuel/src/jazz2-native/b5/_deps/ncine_libraries-src/Includes/GL/glew.h:24431:17: error: ‘PFNGLGETNUNIFORMUIVPROC’ does not name a type; did you mean ‘PFNGLGETUNIFORMUIVPROC’?
24431 | GLEW_FUN_EXPORT PFNGLGETNUNIFORMUIVPROC __glewGetnUniformuiv;
      |                 ^~~~~~~~~~~~~~~~~~~~~~~
      |                 PFNGLGETUNIFORMUIVPROC
/home/manuel/src/jazz2-native/b5/_deps/ncine_libraries-src/Includes/GL/glew.h:24432:17: error: ‘PFNGLREADNPIXELSPROC’ does not name a type; did you mean ‘PFNGLREADPIXELSPROC’?
24432 | GLEW_FUN_EXPORT PFNGLREADNPIXELSPROC __glewReadnPixels;
      |                 ^~~~~~~~~~~~~~~~~~~~
      |                 PFNGLREADPIXELSPROC
/home/manuel/src/jazz2-native/b5/_deps/ncine_libraries-src/Includes/GL/glew.h:24632:17: error: ‘PFNGLGETUNIFORMUI64VNVPROC’ does not name a type; did you mean ‘PFNGLGETUNIFORMI64VNVPROC’?
24632 | GLEW_FUN_EXPORT PFNGLGETUNIFORMUI64VNVPROC __glewGetUniformui64vNV;
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |                 PFNGLGETUNIFORMI64VNVPROC
/home/manuel/src/jazz2-native/b5/_deps/ncine_libraries-src/Includes/GL/glew.h:24755:17: error: ‘PFNGLGETPATHCOLORGENFVNVPROC’ does not name a type; did you mean ‘PFNGLGETPATHCOORDSNVPROC’?
24755 | GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENFVNVPROC __glewGetPathColorGenfvNV;
deathkiller commented 5 months ago

If I remember correctly, there are some functions that don't exist in GLES, so the performance should be better with OpenGL. But I haven't done any benchmarks, because I'm already running at 1000 FPS, so it's hard to measure.

I added NCINE_WITH_OPENGLES cmake variable to force OpenGL ES instead of OpenGL on Linux. Let me know if it works correctly.

vanfanel commented 5 months ago

@deathkiller With NCINE_WITH_OPENGLES GLES builds are possible when both OpenGL and GLES are present! Thanks a lot for that!

GLES has better perfomance than OpenGL using MESA/Panfrost, and it used to be the case on VC4 (Raspberry Pi series of SBCs) too. So having the chance to build for any of them is a very good thing. Also, OpenGL has more dependencies (libGLVND) and many embedded systems are GLES-only. So, all in all, this is a very good addition! :)

deathkiller commented 5 months ago

That's great. Ah, I didn't know that, I have almost no experience with these low-power devices.