android-project/build.properties
author Sam Lantinga <slouken@libsdl.org>
Wed, 18 Oct 2017 08:52:04 -0700
changeset 11630 ad4b5d85edee
parent 4965 91d0085b7560
permissions -rw-r--r--
Fixed bug 3821 - Allow SDL_CreateWindow and SDL_CreateRenderer with OpenGL ES 3.0 (GLES3) for Angle (Windows)

Carlos

Angle supports GLES3 but when using these functions (SDL_CreateWindow and SDL_CreateRenderer), defaults again to GLES2.0.

A current workaround (hack) to retrieve a GLES3.0 context with Angle is:

1) set

SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);

after InitSDL AND after calling SDL_CreateWindow (before SDL_CreateRenderer)

2) Comment lines 2032-2044 in SDL_render_gles2.c, funtion GLES2_CreateRenderer

window_flags = SDL_GetWindowFlags(window);
if (!(window_flags & SDL_WINDOW_OPENGL) ||
profile_mask != SDL_GL_CONTEXT_PROFILE_ES || major != RENDERER_CONTEXT_MAJOR || minor != RENDERER_CONTEXT_MINOR) {

changed_window = SDL_TRUE;
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, RENDERER_CONTEXT_MAJOR);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, RENDERER_CONTEXT_MINOR);

if (SDL_RecreateWindow(window, window_flags | SDL_WINDOW_OPENGL) < 0) {
goto error;
}
}

This retrives a GLES3 context as confirmed using glGetString(GL_VERSION). This should be fixed by modifying a few if's.
slouken@4965
     1
# This file is used to override default values used by the Ant build system.
slouken@4965
     2
# 
slouken@4965
     3
# This file must be checked in Version Control Systems, as it is
slouken@4965
     4
# integral to the build system of your project.
slouken@4965
     5
slouken@4965
     6
# This file is only used by the Ant script.
slouken@4965
     7
slouken@4965
     8
# You can use this to override default values such as
slouken@4965
     9
#  'source.dir' for the location of your java source folder and
slouken@4965
    10
#  'out.dir' for the location of your output folder.
slouken@4965
    11
slouken@4965
    12
# You can also use it define how the release builds are signed by declaring
slouken@4965
    13
# the following properties:
slouken@4965
    14
#  'key.store' for the location of your keystore and
slouken@4965
    15
#  'key.alias' for the name of the key to use.
slouken@4965
    16
# The password will be asked during the build when you use the 'release' target.
slouken@4965
    17