E/libEGL: validate_display:92 error 3008 (EGL_BAD_DISPLAY)

Edit: Its working now without having changed anything as far as I can tell =/

Here is the error I get shortly after creating a window.

E/libEGL: validate_display:92 error 3008 (EGL_BAD_DISPLAY)

I’m using Android Studio, and building with the CMakeLists.txt file for SDL. Everything compiles fine, and my native app lib gets loaded correctly. Going through the code step by step, the error occurs when I make the following call.

SDL_Window *window =
SDL_CreateWindow(
    "Test",
    SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
    0, 0,
    SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN
);

Any modifications I can think of to the the parameters has no effect. Then, after I’ve created a renderer, I can set a random screen clear color, and it will clear the screen, but I can’t actually draw anything. It also gives me this error.

E/emuglGLESv2_enc: device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glBufferSubData:558 GL error 0x501

Here is my main code in full.

#include "SDL.h"

int main(int argc, char *argv[]) {
if ((SDL_Init(SDL_INIT_VIDEO) < 0)) {
    SDL_Log("SDL could not initialize!\nSDL Error: %s", SDL_GetError());
    return 1;
}
//    SDL_InitSubSystem(SDL_INIT_VIDEO); // This doesn't work either

SDL_Window *window =
SDL_CreateWindow(
    "Test",
    SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
    0, 0,
    SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN
);

if (window == NULL) {
    SDL_Log("Window could not be created!\nSDL Error: %s", SDL_GetError());
    return 1;
}

SDL_Renderer *renderer =
SDL_CreateRenderer(
    window,
    -1,
    SDL_RENDERER_ACCELERATED
);

if (renderer == NULL) {
    SDL_Log("Renderer could not be created!\nSDL Error: %s", SDL_GetError());
    return 1;
}

while (true) {
    Uint8 r = rand() % 255;
    Uint8 g = rand() % 255;
    Uint8 b = rand() % 255;
    SDL_SetRenderDrawColor(renderer, r, g, b, 0xFF);
    SDL_RenderClear(renderer);
    SDL_RenderPresent(renderer);
    SDL_Delay(500);
}

CMakeLists.txt

cmake_minimum_required(VERSION 3.4.1)
project("Game")
set(SDL2_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/SDL2")
add_subdirectory(SDL2)
include_directories( SDL2/include/ )

add_library(
    game
    SHARED

    main.cpp
)
target_link_libraries(
    game
    SDL2
)

This occurs whether I’m running on an emulator, or on a real device. I’ve tried switching between versions 2.0.6, 2.0.7, etc, and the mecurial head.

Note that this is just a sample project. I’ve had code use libsdl in the past, with version 2.0.5, but that was a suuuper hacked together system I had, and I’m trying to use sdl the way it was intended.

Here is the cmake configuration output.

debug|x86 :-- Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE) 
debug|x86 :-- Performing Test HAVE_GCC_WALL
debug|x86 :-- Performing Test HAVE_GCC_WALL - Success
debug|x86 :-- Performing Test HAVE_GCC_NO_STRICT_ALIASING
debug|x86 :-- Performing Test HAVE_GCC_NO_STRICT_ALIASING - Success
debug|x86 :-- Performing Test HAVE_GCC_WDECLARATION_AFTER_STATEMENT
debug|x86 :-- Performing Test HAVE_GCC_WDECLARATION_AFTER_STATEMENT - Success
debug|x86 :-- Performing Test HAVE_GCC_WERROR_DECLARATION_AFTER_STATEMENT
debug|x86 :-- Performing Test HAVE_GCC_WERROR_DECLARATION_AFTER_STATEMENT - Success
debug|x86 :-- Performing Test HAVE_GCC_ATOMICS
debug|x86 :-- Performing Test HAVE_GCC_ATOMICS - Success
debug|x86 :-- Performing Test HAVE_GCC_PREFERRED_STACK_BOUNDARY
debug|x86 :-- Performing Test HAVE_GCC_PREFERRED_STACK_BOUNDARY - Failed
debug|x86 :-- Performing Test HAVE_GCC_FVISIBILITY
debug|x86 :-- Performing Test HAVE_GCC_FVISIBILITY - Success
debug|x86 :-- Performing Test HAVE_GCC_WSHADOW
debug|x86 :-- Performing Test HAVE_GCC_WSHADOW - Success
debug|x86 :-- Performing Test HAVE_NO_UNDEFINED
debug|x86 :-- Performing Test HAVE_NO_UNDEFINED - Success
debug|x86 :-- Performing Test HAVE_MMX
debug|x86 :-- Performing Test HAVE_MMX - Success
debug|x86 :-- Performing Test HAVE_3DNOW
debug|x86 :-- Performing Test HAVE_3DNOW - Success
debug|x86 :-- Performing Test HAVE_SSE
debug|x86 :-- Performing Test HAVE_SSE - Success
debug|x86 :-- Looking for immintrin.h
debug|x86 :-- Looking for immintrin.h - found
debug|x86 :-- Performing Test HAVE_ALTIVEC_H_HDR
debug|x86 :-- Performing Test HAVE_ALTIVEC_H_HDR - Failed
debug|x86 :-- Performing Test HAVE_ALTIVEC
debug|x86 :-- Performing Test HAVE_ALTIVEC - Failed
debug|x86 :-- Looking for sys/types.h
debug|x86 :-- Looking for sys/types.h - found
debug|x86 :-- Looking for stdio.h
debug|x86 :-- Looking for stdio.h - found
debug|x86 :-- Looking for stdlib.h
debug|x86 :-- Looking for stdlib.h - found
debug|x86 :-- Looking for stddef.h
debug|x86 :-- Looking for stddef.h - found
debug|x86 :-- Looking for stdarg.h
debug|x86 :-- Looking for stdarg.h - found
debug|x86 :-- Looking for malloc.h
debug|x86 :-- Looking for malloc.h - found
debug|x86 :-- Looking for memory.h
debug|x86 :-- Looking for memory.h - found
debug|x86 :-- Looking for string.h
debug|x86 :-- Looking for string.h - found
debug|x86 :-- Looking for limits.h
debug|x86 :-- Looking for limits.h - found
debug|x86 :-- Looking for strings.h
debug|x86 :-- Looking for strings.h - found
debug|x86 :-- Looking for wchar.h
debug|x86 :-- Looking for wchar.h - found
debug|x86 :-- Looking for inttypes.h
debug|x86 :-- Looking for inttypes.h - found
debug|x86 :-- Looking for stdint.h
debug|x86 :-- Looking for stdint.h - found
debug|x86 :-- Looking for ctype.h
debug|x86 :-- Looking for ctype.h - found
debug|x86 :-- Looking for math.h
debug|x86 :-- Looking for math.h - found
debug|x86 :-- Looking for iconv.h
debug|x86 :-- Looking for iconv.h - found
debug|x86 :-- Looking for signal.h
debug|x86 :-- Looking for signal.h - found
debug|x86 :-- Looking for libunwind.h
debug|x86 :-- Looking for libunwind.h - not found
debug|x86 :-- Looking for 8 include files dlfcn.h, ..., float.h
debug|x86 :-- Looking for 8 include files dlfcn.h, ..., float.h - found
debug|x86 :-- Check size of size_t
debug|x86 :-- Check size of size_t - done
debug|x86 :-- Looking for M_PI
debug|x86 :-- Looking for M_PI - found
debug|x86 :-- Performing Test HAVE_MPROTECT
debug|x86 :-- Performing Test HAVE_MPROTECT - Success
debug|x86 :-- Looking for strtod
debug|x86 :-- Looking for strtod - found
debug|x86 :-- Looking for malloc
debug|x86 :-- Looking for malloc - found
debug|x86 :-- Looking for calloc
debug|x86 :-- Looking for calloc - found
debug|x86 :-- Looking for realloc
debug|x86 :-- Looking for realloc - found
debug|x86 :-- Looking for free
debug|x86 :-- Looking for free - found
debug|x86 :-- Looking for getenv
debug|x86 :-- Looking for getenv - found
debug|x86 :-- Looking for setenv
debug|x86 :-- Looking for setenv - found
debug|x86 :-- Looking for putenv
debug|x86 :-- Looking for putenv - found
debug|x86 :-- Looking for unsetenv
debug|x86 :-- Looking for unsetenv - found
debug|x86 :-- Looking for qsort
debug|x86 :-- Looking for qsort - found
debug|x86 :-- Looking for abs
debug|x86 :-- Looking for abs - not found
debug|x86 :-- Looking for bcopy
debug|x86 :-- Looking for bcopy - not found
debug|x86 :-- Looking for memset
debug|x86 :-- Looking for memset - found
debug|x86 :-- Looking for memcpy
debug|x86 :-- Looking for memcpy - found
debug|x86 :-- Looking for memmove
debug|x86 :-- Looking for memmove - found
debug|x86 :-- Looking for memcmp
debug|x86 :-- Looking for memcmp - found
debug|x86 :-- Looking for strlen
debug|x86 :-- Looking for strlen - found
debug|x86 :-- Looking for strlcpy
debug|x86 :-- Looking for strlcpy - found
debug|x86 :-- Looking for strlcat
debug|x86 :-- Looking for strlcat - found
debug|x86 :-- Looking for _strrev
debug|x86 :-- Looking for _strrev - not found
debug|x86 :-- Looking for _strupr
debug|x86 :-- Looking for _strupr - not found
debug|x86 :-- Looking for _strlwr
debug|x86 :-- Looking for _strlwr - not found
debug|x86 :-- Looking for strchr
debug|x86 :-- Looking for strchr - found
debug|x86 :-- Looking for strrchr
debug|x86 :-- Looking for strrchr - found
debug|x86 :-- Looking for strstr
debug|x86 :-- Looking for strstr - found
debug|x86 :-- Looking for itoa
debug|x86 :-- Looking for itoa - not found
debug|x86 :-- Looking for _ltoa
debug|x86 :-- Looking for _ltoa - not found
debug|x86 :-- Looking for _uitoa
debug|x86 :-- Looking for _uitoa - not found
debug|x86 :-- Looking for _ultoa
debug|x86 :-- Looking for _ultoa - not found
debug|x86 :-- Looking for strtol
debug|x86 :-- Looking for strtol - found
debug|x86 :-- Looking for strtoul
debug|x86 :-- Looking for strtoul - found
debug|x86 :-- Looking for _i64toa
debug|x86 :-- Looking for _i64toa - not found
debug|x86 :-- Looking for _ui64toa
debug|x86 :-- Looking for _ui64toa - not found
debug|x86 :-- Looking for strtoll
debug|x86 :-- Looking for strtoll - found
debug|x86 :-- Looking for strtoull
debug|x86 :-- Looking for strtoull - found
debug|x86 :-- Looking for atoi
debug|x86 :-- Looking for atoi - found
debug|x86 :-- Looking for atof
debug|x86 :-- Looking for atof - not found
debug|x86 :-- Looking for strcmp
debug|x86 :-- Looking for strcmp - found
debug|x86 :-- Looking for strncmp
debug|x86 :-- Looking for strncmp - found
debug|x86 :-- Looking for _stricmp
debug|x86 :-- Looking for _stricmp - not found
debug|x86 :-- Looking for strcasecmp
debug|x86 :-- Looking for strcasecmp - found
debug|x86 :-- Looking for _strnicmp
debug|x86 :-- Looking for _strnicmp - not found
debug|x86 :-- Looking for strncasecmp
debug|x86 :-- Looking for strncasecmp - found
debug|x86 :-- Looking for vsscanf
debug|x86 :-- Looking for vsscanf - found
debug|x86 :-- Looking for vsnprintf
debug|x86 :-- Looking for vsnprintf - found
debug|x86 :-- Looking for fopen64
debug|x86 :-- Looking for fopen64 - not found
debug|x86 :-- Looking for fseeko
debug|x86 :-- Looking for fseeko - found
debug|x86 :-- Looking for fseeko64
debug|x86 :-- Looking for fseeko64 - not found
debug|x86 :-- Looking for sigaction
debug|x86 :-- Looking for sigaction - found
debug|x86 :-- Looking for setjmp
debug|x86 :-- Looking for setjmp - found
debug|x86 :-- Looking for nanosleep
debug|x86 :-- Looking for nanosleep - found
debug|x86 :-- Looking for sysconf
debug|x86 :-- Looking for sysconf - found
debug|x86 :-- Looking for sysctlbyname
debug|x86 :-- Looking for sysctlbyname - not found
debug|x86 :-- Looking for getauxval
debug|x86 :-- Looking for getauxval - not found
debug|x86 :-- Looking for poll
debug|x86 :-- Looking for poll - found
debug|x86 :-- Looking for _Exit
debug|x86 :-- Looking for _Exit - not found
debug|x86 :-- Looking for pow in m
debug|x86 :-- Looking for pow in m - found
debug|x86 :-- Looking for atan
debug|x86 :-- Looking for atan - found
debug|x86 :-- Looking for atan2
debug|x86 :-- Looking for atan2 - found
debug|x86 :-- Looking for ceil
debug|x86 :-- Looking for ceil - found
debug|x86 :-- Looking for copysign
debug|x86 :-- Looking for copysign - found
debug|x86 :-- Looking for cos
debug|x86 :-- Looking for cos - found
debug|x86 :-- Looking for cosf
debug|x86 :-- Looking for cosf - found
debug|x86 :-- Looking for fabs
debug|x86 :-- Looking for fabs - found
debug|x86 :-- Looking for floor
debug|x86 :-- Looking for floor - found
debug|x86 :-- Looking for log
debug|x86 :-- Looking for log - found
debug|x86 :-- Looking for pow
debug|x86 :-- Looking for pow - found
debug|x86 :-- Looking for scalbn
debug|x86 :-- Looking for scalbn - found
debug|x86 :-- Looking for sin
debug|x86 :-- Looking for sin - found
debug|x86 :-- Looking for sinf
debug|x86 :-- Looking for sinf - found
debug|x86 :-- Looking for sqrt
debug|x86 :-- Looking for sqrt - found
debug|x86 :-- Looking for sqrtf
debug|x86 :-- Looking for sqrtf - found
debug|x86 :-- Looking for tan
debug|x86 :-- Looking for tan - found
debug|x86 :-- Looking for tanf
debug|x86 :-- Looking for tanf - found
debug|x86 :-- Looking for acos
debug|x86 :-- Looking for acos - found
debug|x86 :-- Looking for asin
debug|x86 :-- Looking for asin - found
debug|x86 :-- Looking for iconv_open in iconv
debug|x86 :-- Looking for iconv_open in iconv - not found
debug|x86 :-- Looking for alloca.h
debug|x86 :-- Looking for alloca.h - found
debug|x86 :-- Looking for alloca
debug|x86 :-- Looking for alloca - not found
debug|x86 :-- Performing Test HAVE_SA_SIGACTION
debug|x86 :-- Performing Test HAVE_SA_SIGACTION - Success
debug|x86 :-- Looking for dlopen
debug|x86 :-- Looking for dlopen - found
debug|x86 :-- Performing Test HAVE_ARM_MODE
debug|x86 :-- Performing Test HAVE_ARM_MODE - Success
debug|x86 :-- Performing Test VULKAN_PASSED_ANDROID_CHECKS
debug|x86 :-- Performing Test VULKAN_PASSED_ANDROID_CHECKS - Success
debug|x86 :-- Performing Test HAVE_RECURSIVE_MUTEXES
debug|x86 :-- Performing Test HAVE_RECURSIVE_MUTEXES - Success
debug|x86 :-- Performing Test HAVE_PTHREADS_SEM
debug|x86 :-- Performing Test HAVE_PTHREADS_SEM - Success
debug|x86 :-- Performing Test HAVE_SEM_TIMEDWAIT
debug|x86 :-- Performing Test HAVE_SEM_TIMEDWAIT - Success
debug|x86 :-- Performing Test HAVE_PTHREAD_NP_H
debug|x86 :-- Performing Test HAVE_PTHREAD_NP_H - Failed
debug|x86 :-- Looking for pthread_setname_np
debug|x86 :-- Looking for pthread_setname_np - found
debug|x86 :-- Looking for pthread_set_name_np
debug|x86 :-- Looking for pthread_set_name_np - not found
debug|x86 :-- 
debug|x86 :-- SDL2 was configured with the following options:
debug|x86 :-- 
debug|x86 :-- Platform: Android-1
debug|x86 :-- 64-bit:   FALSE
debug|x86 :-- Compiler: C:/Users/asdf/development/sdks/android/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
debug|x86 :-- 
debug|x86 :-- Subsystems:
debug|x86 :--   Atomic:	ON
debug|x86 :--   Audio:	ON
debug|x86 :--   Video:	ON
debug|x86 :--   Render:	ON
debug|x86 :--   Events:	ON
debug|x86 :--   Joystick:	ON
debug|x86 :--   Haptic:	ON
debug|x86 :--   Power:	ON
debug|x86 :--   Threads:	ON
debug|x86 :--   Timers:	ON
debug|x86 :--   File:	ON
debug|x86 :--   Loadso:	ON
debug|x86 :--   CPUinfo:	ON
debug|x86 :--   Filesystem:	ON
debug|x86 :--   Dlopen:	ON
debug|x86 :--   Sensor:	ON
debug|x86 :-- 
debug|x86 :-- Options:
debug|x86 :--   3DNOW                  (Wanted: ON): ON
debug|x86 :--   ALSA                   (Wanted: ON): OFF
debug|x86 :--   ALSA_SHARED            (Wanted: ON): OFF
debug|x86 :--   ALTIVEC                (Wanted: ON): OFF
debug|x86 :--   ARTS                   (Wanted: ON): OFF
debug|x86 :--   ARTS_SHARED            (Wanted: ON): OFF
debug|x86 :--   ASSEMBLY               (Wanted: ON): ON
debug|x86 :--   ASSERTIONS             (Wanted: auto): auto
debug|x86 :--   BACKGROUNDING_SIGNAL   (Wanted: OFF): OFF
debug|x86 :--   CLOCK_GETTIME          (Wanted: OFF): OFF
debug|x86 :--   DIRECTFB_SHARED        (Wanted: OFF): OFF
debug|x86 :--   DIRECTX                (Wanted: OFF): OFF
debug|x86 :--   DISKAUDIO              (Wanted: ON): ON
debug|x86 :--   DUMMYAUDIO             (Wanted: ON): ON
debug|x86 :--   ESD                    (Wanted: ON): OFF
debug|x86 :--   ESD_SHARED             (Wanted: ON): OFF
debug|x86 :--   FOREGROUNDING_SIGNAL   (Wanted: OFF): OFF
debug|x86 :--   FUSIONSOUND            (Wanted: OFF): OFF
debug|x86 :--   FUSIONSOUND_SHARED     (Wanted: OFF): OFF
debug|x86 :--   GCC_ATOMICS            (Wanted: ON): ON
debug|x86 :--   HIDAPI                 (Wanted: ON): ON
debug|x86 :--   INPUT_TSLIB            (Wanted: ON): OFF
debug|x86 :--   JACK                   (Wanted: ON): OFF
debug|x86 :--   JACK_SHARED            (Wanted: ON): OFF
debug|x86 :--   KMSDRM_SHARED          (Wanted: ON): OFF
debug|x86 :--   LIBC                   (Wanted: ON): ON
debug|x86 :--   LIBSAMPLERATE          (Wanted: ON): OFF
debug|x86 :--   LIBSAMPLERATE_SHARED   (Wanted: ON): OFF
debug|x86 :--   MMX                    (Wanted: ON): ON
debug|x86 :--   NAS                    (Wanted: ON): OFF
debug|x86 :--   NAS_SHARED             (Wanted: ON): OFF
debug|x86 :--   OSS                    (Wanted: ON): OFF
debug|x86 :--   PTHREADS               (Wanted: ON): ON
debug|x86 :--   PTHREADS_SEM           (Wanted: ON): ON
debug|x86 :--   PULSEAUDIO             (Wanted: ON): OFF
debug|x86 :--   PULSEAUDIO_SHARED      (Wanted: ON): OFF
debug|x86 :--   RENDER_D3D             (Wanted: OFF): OFF
debug|x86 :--   RENDER_METAL           (Wanted: OFF): OFF
debug|x86 :--   RPATH                  (Wanted: ON): OFF
debug|x86 :--   SDL_DLOPEN             (Wanted: ON): ON
debug|x86 :--   SDL_STATIC_PIC         (Wanted: OFF): OFF
debug|x86 :--   SDL_TEST               (Wanted: OFF): OFF
debug|x86 :--   SNDIO                  (Wanted: ON): OFF
debug|x86 :--   SSE                    (Wanted: ON): ON
debug|x86 :--   SSE2                   (Wanted: OFF): OFF
debug|x86 :--   SSE3                   (Wanted: OFF): OFF
debug|x86 :--   SSEMATH                (Wanted: OFF): ON
debug|x86 :--   VIDEO_COCOA            (Wanted: OFF): OFF
debug|x86 :--   VIDEO_DIRECTFB         (Wanted: OFF): OFF
debug|x86 :--   VIDEO_DUMMY            (Wanted: ON): ON
debug|x86 :--   VIDEO_KMSDRM           (Wanted: ON): OFF
debug|x86 :--   VIDEO_METAL            (Wanted: OFF): OFF
debug|x86 :--   VIDEO_OFFSCREEN        (Wanted: OFF): OFF
debug|x86 :--   VIDEO_OPENGL           (Wanted: ON): OFF
debug|x86 :--   VIDEO_OPENGLES         (Wanted: ON): ON
debug|x86 :--   VIDEO_RPI              (Wanted: ON): OFF
debug|x86 :--   VIDEO_VIVANTE          (Wanted: ON): OFF
debug|x86 :--   VIDEO_VULKAN           (Wanted: ON): ON
debug|x86 :--   VIDEO_WAYLAND          (Wanted: ON): OFF
debug|x86 :--   VIDEO_WAYLAND_QT_TOUCH (Wanted: ON): OFF
debug|x86 :--   VIDEO_X11              (Wanted: ON): OFF
debug|x86 :--   VIDEO_X11_XCURSOR      (Wanted: ON): OFF
debug|x86 :--   VIDEO_X11_XINERAMA     (Wanted: ON): OFF
debug|x86 :--   VIDEO_X11_XINPUT       (Wanted: ON): OFF
debug|x86 :--   VIDEO_X11_XRANDR       (Wanted: ON): OFF
debug|x86 :--   VIDEO_X11_XSCRNSAVER   (Wanted: ON): OFF
debug|x86 :--   VIDEO_X11_XSHAPE       (Wanted: ON): OFF
debug|x86 :--   VIDEO_X11_XVM          (Wanted: ON): OFF
debug|x86 :--   WASAPI                 (Wanted: OFF): OFF
debug|x86 :--   WAYLAND_SHARED         (Wanted: ON): OFF
debug|x86 :--   X11_SHARED             (Wanted: ON): OFF
debug|x86 :-- 
debug|x86 :--  CFLAGS:        -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -mstackrealign -fno-addrsig -Wa,--noexecstack -Wformat -Werror=format-security  -idirafter C:/Users/asdf/development/projects/example_game/app/src/main/cpp/SDL2/src/video/khronos  -IC:/Users/asdf/development/projects/example_game/app/src/main/cpp/SDL2/src/hidapi/hidapi
debug|x86 :--  EXTRA_CFLAGS:  -msse -m3dnow -mmmx -Wshadow -fvisibility=hidden -Wdeclaration-after-statement -Werror=declaration-after-statement -fno-strict-aliasing -Wall 
debug|x86 :--  EXTRA_LDFLAGS: -Wl,--no-undefined
debug|x86 :--  EXTRA_LIBS:    m;C:/Users/asdf/development/sdks/android/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/lib/i686-linux-android/16/libdl.so;C:/Users/asdf/development/sdks/android/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/lib/i686-linux-android/16/liblog.so;C:/Users/asdf/development/sdks/android/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/lib/i686-linux-android/16/libandroid.so;hidapi;C:/Users/asdf/development/sdks/android/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/lib/i686-linux-android/16/libGLESv1_CM.so;C:/Users/asdf/development/sdks/android/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/lib/i686-linux-android/16/libGLESv2.so
debug|x86 :-- 
debug|x86 :--  Build Shared Library: ON
debug|x86 :--  Build Static Library: ON
debug|x86 :--  Build Static Library with Position Independent Code: OFF
debug|x86 :-- 
debug|x86 :-- If something was not detected, although the libraries
debug|x86 :-- were installed, then make sure you have set the
debug|x86 :-- CFLAGS and LDFLAGS environment variables correctly.
debug|x86 :-- 
debug|x86 :-- Configuring done
debug|x86 :-- Generating done
debug|x86 :-- Build files have been written to: C:/Users/asdf/development/projects/example_game/app/.cxx/cmake/debug/x86

And here is the logcat output when running, ending with the errors when clearing the screen.

2019-10-13 19:24:35.182 5155-5155/? I/zygote: Not late-enabling -Xcheck:jni (already on)
2019-10-13 19:24:35.191 5155-5155/? W/zygote: Unexpected CPU variant for X86 using defaults: x86
2019-10-13 19:24:35.340 5155-5155/com.company.example_game V/SDL: Device: generic_x86
2019-10-13 19:24:35.341 5155-5155/com.company.example_game V/SDL: Model: Android SDK built for x86
2019-10-13 19:24:35.341 5155-5155/com.company.example_game V/SDL: onCreate()
2019-10-13 19:24:35.346 5155-5155/com.company.example_game V/SDL: nativeSetupJNI()
2019-10-13 19:24:35.346 5155-5155/com.company.example_game V/SDL: AUDIO nativeSetupJNI()
2019-10-13 19:24:35.346 5155-5155/com.company.example_game V/SDL: CONTROLLER nativeSetupJNI()
2019-10-13 19:24:35.357 5155-5155/com.company.example_game D/hidapi: Initializing Bluetooth
2019-10-13 19:24:35.358 5155-5155/com.company.example_game D/hidapi: Couldn't initialize Bluetooth, missing android.permission.BLUETOOTH
2019-10-13 19:24:35.404 5155-5155/com.company.example_game V/SDL: onStart()
2019-10-13 19:24:35.408 5155-5155/com.company.example_game V/SDL: onResume()
2019-10-13 19:24:35.426 5155-5178/com.company.example_game D/OpenGLRenderer: HWUI GL Pipeline
2019-10-13 19:24:35.498 5155-5178/com.company.example_game I/zygote: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
2019-10-13 19:24:35.498 5155-5178/com.company.example_game I/OpenGLRenderer: Initialized EGL, version 1.4
2019-10-13 19:24:35.498 5155-5178/com.company.example_game D/OpenGLRenderer: Swap behavior 1
2019-10-13 19:24:35.499 5155-5178/com.company.example_game W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
2019-10-13 19:24:35.499 5155-5178/com.company.example_game D/OpenGLRenderer: Swap behavior 0
2019-10-13 19:24:35.537 5155-5178/com.company.example_game D/EGL_emulation: eglCreateContext: 0xdfd2bee0: maj 3 min 1 rcv 4
2019-10-13 19:24:35.543 5155-5178/com.company.example_game D/EGL_emulation: eglMakeCurrent: 0xdfd2bee0: ver 3 1 (tinfo 0xde663cb0)
2019-10-13 19:24:35.551 5155-5155/com.company.example_game V/SDL: surfaceCreated()
2019-10-13 19:24:35.552 5155-5155/com.company.example_game V/SDL: surfaceChanged()
2019-10-13 19:24:35.552 5155-5155/com.company.example_game V/SDL: pixel format RGB_565
2019-10-13 19:24:35.552 5155-5155/com.company.example_game V/SDL: Window size: 1024x528
2019-10-13 19:24:35.553 5155-5155/com.company.example_game V/SDL: Device size: 1024x600
2019-10-13 19:24:35.557 5155-5178/com.company.example_game E/eglCodecCommon: glUtilsParamSize: unknow param 0x000082da
2019-10-13 19:24:35.559 5155-5178/com.company.example_game E/eglCodecCommon: glUtilsParamSize: unknow param 0x000082da
2019-10-13 19:24:35.567 5155-5179/com.company.example_game V/SDL: Running main function SDL_main from library /data/app/com.company.example_game-cNmmHDgEUZmBjQJGH7iqWg==/lib/x86/libgame.so
2019-10-13 19:24:35.567 5155-5179/com.company.example_game V/SDL: nativeRunMain()
2019-10-13 19:24:35.595 5155-5178/com.company.example_game D/EGL_emulation: eglMakeCurrent: 0xdfd2bee0: ver 3 1 (tinfo 0xde663cb0)
2019-10-13 19:24:35.626 5155-5179/com.company.example_game E/libEGL: validate_display:92 error 3008 (EGL_BAD_DISPLAY)
2019-10-13 19:24:35.627 5155-5179/com.company.example_game V/SDL: setOrientation() orientation=6 width=1024 height=600 resizable=false hint=
2019-10-13 19:24:35.652 5155-5155/com.company.example_game V/SDL: onWindowFocusChanged(): true
2019-10-13 19:24:36.187 5155-5179/com.company.example_game D/EGL_emulation: eglCreateContext: 0xe00050c0: maj 3 min 1 rcv 4
2019-10-13 19:24:36.190 5155-5179/com.company.example_game D/EGL_emulation: eglMakeCurrent: 0xe00050c0: ver 3 1 (tinfo 0xe00033b0)
2019-10-13 19:24:36.197 5155-5179/com.company.example_game E/eglCodecCommon: glUtilsParamSize: unknow param 0x000082da
2019-10-13 19:24:36.197 5155-5179/com.company.example_game E/eglCodecCommon: glUtilsParamSize: unknow param 0x000082da
2019-10-13 19:24:36.204 5155-5179/com.company.example_game E/emuglGLESv2_enc: device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glBufferSubData:558 GL error 0x501
2019-10-13 19:24:36.204 5155-5155/com.company.example_game V/SDL: nativeFocusChanged()
2019-10-13 19:24:36.243 5155-5155/com.company.example_game I/Choreographer: Skipped 34 frames!  The application may be doing too much work on its main thread.
2019-10-13 19:24:36.267 5155-5178/com.company.example_game D/EGL_emulation: eglMakeCurrent: 0xdfd2bee0: ver 3 1 (tinfo 0xde663cb0)
2019-10-13 19:24:36.276 5155-5155/com.company.example_game V/SDL: surfaceChanged()
2019-10-13 19:24:36.276 5155-5155/com.company.example_game V/SDL: pixel format RGB_565
2019-10-13 19:24:36.278 5155-5155/com.company.example_game V/SDL: Window size: 1024x600
2019-10-13 19:24:36.278 5155-5155/com.company.example_game V/SDL: Device size: 1024x600
2019-10-13 19:24:36.291 5155-5178/com.company.example_game D/EGL_emulation: eglMakeCurrent: 0xdfd2bee0: ver 3 1 (tinfo 0xde663cb0)
2019-10-13 19:24:36.730 5155-5179/com.company.example_game E/emuglGLESv2_enc: device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glBufferSubData:558 GL error 0x501
2019-10-13 19:24:37.239 5155-5179/com.company.example_game E/emuglGLESv2_enc: device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glBufferSubData:558 GL error 0x501
2019-10-13 19:24:37.755 5155-5179/com.company.example_game E/emuglGLESv2_enc: device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glBufferSubData:558 GL error 0x501
1 Like

may you need to poll events ?

int quit = 0;
 while(!quit)
  {
    SDL_Event e;
    while(SDL_PollEvent(&e)) {
      switch(e.type) {
        case SDL_QUIT:
          quit = 1;
          break;
      }  

    Uint8 r = rand() % 255;
    Uint8 g = rand() % 255;
    Uint8 b = rand() % 255;
    SDL_SetRenderDrawColor(renderer, r, g, b, 0xFF);
    SDL_RenderClear(renderer);
    SDL_RenderPresent(renderer);
    SDL_Delay(500);
    }