acinclude/ltversion.m4
author Sam Lantinga <slouken@libsdl.org>
Wed, 18 Oct 2017 08:52:04 -0700
changeset 11630 ad4b5d85edee
parent 6442 2d3caa191dc4
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@3342
     1
# ltversion.m4 -- version numbers			-*- Autoconf -*-
slouken@3342
     2
#
slouken@3342
     3
#   Copyright (C) 2004 Free Software Foundation, Inc.
slouken@3342
     4
#   Written by Scott James Remnant, 2004
slouken@3342
     5
#
slouken@3342
     6
# This file is free software; the Free Software Foundation gives
slouken@3342
     7
# unlimited permission to copy and/or distribute it, with or without
slouken@3342
     8
# modifications, as long as this notice is preserved.
slouken@3342
     9
slouken@6442
    10
# @configure_input@
slouken@3342
    11
slouken@6442
    12
# serial 3337 ltversion.m4
slouken@3342
    13
# This file is part of GNU Libtool
slouken@3342
    14
slouken@6442
    15
m4_define([LT_PACKAGE_VERSION], [2.4.2])
slouken@6442
    16
m4_define([LT_PACKAGE_REVISION], [1.3337])
slouken@3342
    17
slouken@3342
    18
AC_DEFUN([LTVERSION_VERSION],
slouken@6442
    19
[macro_version='2.4.2'
slouken@6442
    20
macro_revision='1.3337'
slouken@3342
    21
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
slouken@3342
    22
_LT_DECL(, macro_revision, 0)
slouken@3342
    23
])