From 30b1ab2addc48cb753c87c68d6fe6602831f88a2 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Tue, 22 Nov 2022 21:48:40 +0300
Subject: [PATCH] removed opengles.
---
CMakeLists.txt | 6 -
Makefile.in | 1 -
VisualC-GDK/SDL/SDL.vcxproj | 1 -
VisualC-GDK/SDL/SDL.vcxproj.filters | 3 -
VisualC/SDL/SDL.vcxproj | 1 -
VisualC/SDL/SDL.vcxproj.filters | 3 -
cmake/sdlchecks.cmake | 9 -
configure | 53 -
configure.ac | 20 -
docs/doxyfile | 1 -
include/SDL_config.h.cmake | 2 -
include/SDL_config.h.in | 2 -
include/SDL_config_android.h | 2 -
include/SDL_config_emscripten.h | 1 -
include/SDL_config_iphoneos.h | 2 -
include/SDL_opengles.h | 39 -
src/render/SDL_render.c | 3 -
src/render/SDL_sysrender.h | 1 -
src/render/opengles/SDL_glesfuncs.h | 62 --
src/render/opengles/SDL_render_gles.c | 1218 ---------------------
src/video/SDL_sysvideo.h | 2 +-
src/video/SDL_video.c | 18 +-
src/video/uikit/SDL_uikitevents.m | 2 +-
src/video/uikit/SDL_uikitopengles.h | 4 +-
src/video/uikit/SDL_uikitopengles.m | 2 +-
src/video/uikit/SDL_uikitopenglview.h | 4 +-
src/video/uikit/SDL_uikitopenglview.m | 2 +-
src/video/uikit/SDL_uikitvideo.m | 2 +-
src/video/uikit/SDL_uikitviewcontroller.m | 2 +-
src/video/uikit/SDL_uikitwindow.m | 2 +-
src/video/x11/SDL_x11window.c | 2 +-
test/Makefile.in | 4 -
test/configure | 35 -
test/configure.ac | 18 -
test/testgles.c | 355 ------
35 files changed, 17 insertions(+), 1867 deletions(-)
delete mode 100644 include/SDL_opengles.h
delete mode 100644 src/render/opengles/SDL_glesfuncs.h
delete mode 100644 src/render/opengles/SDL_render_gles.c
delete mode 100644 test/testgles.c
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 65e276b96ee8..1891154b5660 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1292,8 +1292,6 @@ if(ANDROID)
if(SDL_OPENGLES)
set(SDL_VIDEO_OPENGL_EGL 1)
set(HAVE_OPENGLES TRUE)
- set(SDL_VIDEO_OPENGL_ES 1)
- set(SDL_VIDEO_RENDER_OGL_ES 1)
set(SDL_VIDEO_OPENGL_ES2 1)
set(SDL_VIDEO_RENDER_OGL_ES2 1)
@@ -2144,8 +2142,6 @@ elseif(APPLE)
if(SDL_OPENGLES)
if(IOS OR TVOS)
set(SDL_FRAMEWORK_OPENGLES 1)
- set(SDL_VIDEO_OPENGL_ES 1)
- set(SDL_VIDEO_RENDER_OGL_ES 1)
else()
set(SDL_VIDEO_OPENGL_EGL 1)
endif()
@@ -2460,8 +2456,6 @@ elseif(VITA)
check_include_file(gl4esinit.h HAVE_GL4ES_H)
set(SDL_VIDEO_OPENGL_EGL 1)
set(HAVE_OPENGLES TRUE)
- set(SDL_VIDEO_OPENGL_ES 1)
- set(SDL_VIDEO_RENDER_OGL_ES 1)
set(SDL_VIDEO_OPENGL_ES2 1)
set(SDL_VIDEO_RENDER_OGL_ES2 1)
diff --git a/Makefile.in b/Makefile.in
index f72a044c2ac1..02700ab63047 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -100,7 +100,6 @@ HDRS = \
SDL_name.h \
SDL_opengl.h \
SDL_opengl_glext.h \
- SDL_opengles.h \
SDL_opengles2_gl2ext.h \
SDL_opengles2_gl2.h \
SDL_opengles2_gl2platform.h \
diff --git a/VisualC-GDK/SDL/SDL.vcxproj b/VisualC-GDK/SDL/SDL.vcxproj
index b183f6225680..96885a6e7436 100644
--- a/VisualC-GDK/SDL/SDL.vcxproj
+++ b/VisualC-GDK/SDL/SDL.vcxproj
@@ -329,7 +329,6 @@
<ClInclude Include="..\..\include\SDL_name.h" />
<ClInclude Include="..\..\include\SDL_opengl.h" />
<ClInclude Include="..\..\include\SDL_opengl_glext.h" />
- <ClInclude Include="..\..\include\SDL_opengles.h" />
<ClInclude Include="..\..\include\SDL_opengles2.h" />
<ClInclude Include="..\..\include\SDL_opengles2_gl2.h" />
<ClInclude Include="..\..\include\SDL_opengles2_gl2ext.h" />
diff --git a/VisualC-GDK/SDL/SDL.vcxproj.filters b/VisualC-GDK/SDL/SDL.vcxproj.filters
index 02dc97ef30f0..23b3ec841865 100644
--- a/VisualC-GDK/SDL/SDL.vcxproj.filters
+++ b/VisualC-GDK/SDL/SDL.vcxproj.filters
@@ -285,9 +285,6 @@
<ClInclude Include="..\..\include\SDL_opengl_glext.h">
<Filter>API Headers</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\SDL_opengles.h">
- <Filter>API Headers</Filter>
- </ClInclude>
<ClInclude Include="..\..\include\SDL_opengles2.h">
<Filter>API Headers</Filter>
</ClInclude>
diff --git a/VisualC/SDL/SDL.vcxproj b/VisualC/SDL/SDL.vcxproj
index 64f1341a4e73..d1fcbadecb2b 100644
--- a/VisualC/SDL/SDL.vcxproj
+++ b/VisualC/SDL/SDL.vcxproj
@@ -253,7 +253,6 @@
<ClInclude Include="..\..\include\SDL_name.h" />
<ClInclude Include="..\..\include\SDL_opengl.h" />
<ClInclude Include="..\..\include\SDL_opengl_glext.h" />
- <ClInclude Include="..\..\include\SDL_opengles.h" />
<ClInclude Include="..\..\include\SDL_opengles2.h" />
<ClInclude Include="..\..\include\SDL_opengles2_gl2.h" />
<ClInclude Include="..\..\include\SDL_opengles2_gl2ext.h" />
diff --git a/VisualC/SDL/SDL.vcxproj.filters b/VisualC/SDL/SDL.vcxproj.filters
index 082e257b4547..d0e771a07829 100644
--- a/VisualC/SDL/SDL.vcxproj.filters
+++ b/VisualC/SDL/SDL.vcxproj.filters
@@ -285,9 +285,6 @@
<ClInclude Include="..\..\include\SDL_opengl_glext.h">
<Filter>API Headers</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\SDL_opengles.h">
- <Filter>API Headers</Filter>
- </ClInclude>
<ClInclude Include="..\..\include\SDL_opengles2.h">
<Filter>API Headers</Filter>
</ClInclude>
diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake
index 38e6e13473a4..a8e746f96641 100644
--- a/cmake/sdlchecks.cmake
+++ b/cmake/sdlchecks.cmake
@@ -642,15 +642,6 @@ endmacro()
# - nada
macro(CheckOpenGLES)
if(SDL_OPENGLES)
- check_c_source_compiles("
- #include <GLES/gl.h>
- #include <GLES/glext.h>
- int main (int argc, char** argv) { return 0; }" HAVE_OPENGLES_V1)
- if(HAVE_OPENGLES_V1)
- set(HAVE_OPENGLES TRUE)
- set(SDL_VIDEO_OPENGL_ES 1)
- set(SDL_VIDEO_RENDER_OGL_ES 1)
- endif()
check_c_source_compiles("
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
diff --git a/configure b/configure
index 8681b7953423..e741f52acaa5 100755
--- a/configure
+++ b/configure
@@ -903,7 +903,6 @@ enable_video_dummy
enable_video_offscreen
enable_video_opengl
enable_video_opengles
-enable_video_opengles1
enable_video_opengles2
enable_video_vulkan
enable_libudev
@@ -1690,8 +1689,6 @@ Optional Features:
use offscreen video driver [default=yes]
--enable-video-opengl include OpenGL support [default=yes]
--enable-video-opengles include OpenGL ES support [default=yes]
- --enable-video-opengles1
- include OpenGL ES 1.1 support [default=yes]
--enable-video-opengles2
include OpenGL ES 2.0 support [default=yes]
--enable-video-vulkan include Vulkan support [default=yes]
@@ -24398,14 +24395,6 @@ else $as_nop
enable_video_opengles=yes
fi
-# Check whether --enable-video-opengles1 was given.
-if test ${enable_video_opengles1+y}
-then :
- enableval=$enable_video_opengles1;
-else $as_nop
- enable_video_opengles1=yes
-fi
-
# Check whether --enable-video-opengles2 was given.
if test ${enable_video_opengles2+y}
then :
@@ -24496,42 +24485,6 @@ printf "%s\n" "#define SDL_VIDEO_RENDER_OGL 1" >>confdefs.h
CheckOpenGLES()
{
if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
- if test x$enable_video_opengles1 = xyes; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OpenGL ES v1 headers" >&5
-printf %s "checking for OpenGL ES v1 headers... " >&6; }
- video_opengles_v1=no
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
- #include <GLES/gl.h>
- #include <GLES/glext.h>
-
-int
-main (void)
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"
-then :
- video_opengles_v1=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $video_opengles_v1" >&5
-printf "%s\n" "$video_opengles_v1" >&6; }
- if test x$video_opengles_v1 = xyes; then
-
-printf "%s\n" "#define SDL_VIDEO_OPENGL_ES 1" >>confdefs.h
-
-
-printf "%s\n" "#define SDL_VIDEO_RENDER_OGL_ES 1" >>confdefs.h
-
- SUMMARY_video="${SUMMARY_video} opengl_es1"
- fi
- fi
-
if test x$enable_video_opengles2 = xyes; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for OpenGL ES v2 headers" >&5
printf %s "checking for OpenGL ES v2 headers... " >&6; }
@@ -27705,12 +27658,6 @@ printf "%s\n" "#define SDL_VIDEO_DRIVER_UIKIT 1" >>confdefs.h
printf "%s\n" "#define SDL_VIDEO_OPENGL_ES2 1" >>confdefs.h
-printf "%s\n" "#define SDL_VIDEO_OPENGL_ES 1" >>confdefs.h
-
-
-printf "%s\n" "#define SDL_VIDEO_RENDER_OGL_ES 1" >>confdefs.h
-
-
printf "%s\n" "#define SDL_VIDEO_RENDER_OGL_ES2 1" >>confdefs.h
SOURCES="$SOURCES $srcdir/src/video/uikit/*.m"
diff --git a/configure.ac b/configure.ac
index 7a41dbbd35e3..ac9965913edf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2130,9 +2130,6 @@ dnl Check to see if OpenGL ES support is desired
AC_ARG_ENABLE(video-opengles,
[AS_HELP_STRING([--enable-video-opengles], [include OpenGL ES support [default=yes]])],
, enable_video_opengles=yes)
-AC_ARG_ENABLE(video-opengles1,
-[AS_HELP_STRING([--enable-video-opengles1], [include OpenGL ES 1.1 support [default=yes]])],
- , enable_video_opengles1=yes)
AC_ARG_ENABLE(video-opengles2,
[AS_HELP_STRING([--enable-video-opengles2], [include OpenGL ES 2.0 support [default=yes]])],
, enable_video_opengles2=yes)
@@ -2181,21 +2178,6 @@ dnl Find OpenGL ES
CheckOpenGLES()
{
if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
- if test x$enable_video_opengles1 = xyes; then
- AC_MSG_CHECKING(for OpenGL ES v1 headers)
- video_opengles_v1=no
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
- #include <GLES/gl.h>
- #include <GLES/glext.h>
- ]],[])], [video_opengles_v1=yes],[])
- AC_MSG_RESULT($video_opengles_v1)
- if test x$video_opengles_v1 = xyes; then
- AC_DEFINE(SDL_VIDEO_OPENGL_ES, 1, [ ])
- AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES, 1, [ ])
- SUMMARY_video="${SUMMARY_video} opengl_es1"
- fi
- fi
-
if test x$enable_video_opengles2 = xyes; then
AC_MSG_CHECKING(for OpenGL ES v2 headers)
video_opengles_v2=no
@@ -3901,8 +3883,6 @@ dnl BeOS support removed after SDL 2.0.1. Haiku still works. --ryan.
# The iOS platform requires special setup.
AC_DEFINE(SDL_VIDEO_DRIVER_UIKIT, 1, [ ])
AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
- AC_DEFINE(SDL_VIDEO_OPENGL_ES, 1, [ ])
- AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES, 1, [ ])
AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
SOURCES="$SOURCES $srcdir/src/video/uikit/*.m"
SUMMARY_video="${SUMMARY_video} uikit"
diff --git a/docs/doxyfile b/docs/doxyfile
index a9d837c320aa..fa7d2d4837d5 100644
--- a/docs/doxyfile
+++ b/docs/doxyfile
@@ -637,7 +637,6 @@ EXCLUDE = ../include/SDL_opengles2_gl2ext.h \
../include/SDL_opengl_glext.h \
../include/SDL_opengles2_gl2.h \
../include/SDL_opengles2.h \
- ../include/SDL_opengles.h \
../include/SDL_opengl.h \
../include/SDL_egl.h \
./release_checklist.md \
diff --git a/include/SDL_config.h.cmake b/include/SDL_config.h.cmake
index 5df0fc41c69c..c5ca22625cd0 100644
--- a/include/SDL_config.h.cmake
+++ b/include/SDL_config.h.cmake
@@ -431,7 +431,6 @@
#cmakedefine SDL_VIDEO_RENDER_D3D11 @SDL_VIDEO_RENDER_D3D11@
#cmakedefine SDL_VIDEO_RENDER_D3D12 @SDL_VIDEO_RENDER_D3D12@
#cmakedefine SDL_VIDEO_RENDER_OGL @SDL_VIDEO_RENDER_OGL@
-#cmakedefine SDL_VIDEO_RENDER_OGL_ES @SDL_VIDEO_RENDER_OGL_ES@
#cmakedefine SDL_VIDEO_RENDER_OGL_ES2 @SDL_VIDEO_RENDER_OGL_ES2@
#cmakedefine SDL_VIDEO_RENDER_METAL @SDL_VIDEO_RENDER_METAL@
#cmakedefine SDL_VIDEO_RENDER_VITA_GXM @SDL_VIDEO_RENDER_VITA_GXM@
@@ -440,7 +439,6 @@
/* Enable OpenGL support */
#cmakedefine SDL_VIDEO_OPENGL @SDL_VIDEO_OPENGL@
-#cmakedefine SDL_VIDEO_OPENGL_ES @SDL_VIDEO_OPENGL_ES@
#cmakedefine SDL_VIDEO_OPENGL_ES2 @SDL_VIDEO_OPENGL_ES2@
#cmakedefine SDL_VIDEO_OPENGL_BGL @SDL_VIDEO_OPENGL_BGL@
#cmakedefine SDL_VIDEO_OPENGL_CGL @SDL_VIDEO_OPENGL_CGL@
diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in
index 706acd325ff5..0611c0e5412f 100644
--- a/include/SDL_config.h.in
+++ b/include/SDL_config.h.in
@@ -391,13 +391,11 @@
#undef SDL_VIDEO_RENDER_D3D11
#undef SDL_VIDEO_RENDER_D3D12
#undef SDL_VIDEO_RENDER_OGL
-#undef SDL_VIDEO_RENDER_OGL_ES
#undef SDL_VIDEO_RENDER_OGL_ES2
#undef SDL_VIDEO_RENDER_METAL
/* Enable OpenGL support */
#undef SDL_VIDEO_OPENGL
-#undef SDL_VIDEO_OPENGL_ES
#undef SDL_VIDEO_OPENGL_ES2
#undef SDL_VIDEO_OPENGL_BGL
#undef SDL_VIDEO_OPENGL_CGL
diff --git a/include/SDL_config_android.h b/include/SDL_config_android.h
index 64918ae0b8a5..6707c26d19f3 100644
--- a/include/SDL_config_android.h
+++ b/include/SDL_config_android.h
@@ -171,10 +171,8 @@
#define SDL_VIDEO_DRIVER_ANDROID 1
/* Enable OpenGL ES */
-#define SDL_VIDEO_OPENGL_ES 1
#define SDL_VIDEO_OPENGL_ES2 1
#define SDL_VIDEO_OPENGL_EGL 1
-#define SDL_VIDEO_RENDER_OGL_ES 1
#define SDL_VIDEO_RENDER_OGL_ES2 1
/* Enable Vulkan support */
diff --git a/include/SDL_config_emscripten.h b/include/SDL_config_emscripten.h
index 989e1243a7bb..ea41fc96021f 100644
--- a/include/SDL_config_emscripten.h
+++ b/include/SDL_config_emscripten.h
@@ -199,7 +199,6 @@
/* Enable OpenGL support */
/* #undef SDL_VIDEO_OPENGL */
-/* #undef SDL_VIDEO_OPENGL_ES */
#define SDL_VIDEO_OPENGL_ES2 1
/* #undef SDL_VIDEO_OPENGL_BGL */
/* #undef SDL_VIDEO_OPENGL_CGL */
diff --git a/include/SDL_config_iphoneos.h b/include/SDL_config_iphoneos.h
index 6db16eb4ccfb..57099b814c31 100644
--- a/include/SDL_config_iphoneos.h
+++ b/include/SDL_config_iphoneos.h
@@ -176,8 +176,6 @@
/* Enable OpenGL ES */
#if !TARGET_OS_MACCATALYST
#define SDL_VIDEO_OPENGL_ES2 1
-#define SDL_VIDEO_OPENGL_ES 1
-#define SDL_VIDEO_RENDER_OGL_ES 1
#define SDL_VIDEO_RENDER_OGL_ES2 1
#endif
diff --git a/include/SDL_opengles.h b/include/SDL_opengles.h
deleted file mode 100644
index 8511b9607f11..000000000000
--- a/include/SDL_opengles.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-/**
- * \file SDL_opengles.h
- *
- * This is a simple file to encapsulate the OpenGL ES 1.X API headers.
- */
-#include "SDL_config.h"
-
-#ifdef __IPHONEOS__
-#include <OpenGLES/ES1/gl.h>
-#include <OpenGLES/ES1/glext.h>
-#else
-#include <GLES/gl.h>
-#include <GLES/glext.h>
-#endif
-
-#ifndef APIENTRY
-#define APIENTRY
-#endif
diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c
index d103e958ed95..39fa911ea259 100644
--- a/src/render/SDL_render.c
+++ b/src/render/SDL_render.c
@@ -109,9 +109,6 @@ static const SDL_RenderDriver *render_drivers[] = {
#if SDL_VIDEO_RENDER_OGL_ES2
&GLES2_RenderDriver,
#endif
-#if SDL_VIDEO_RENDER_OGL_ES
- &GLES_RenderDriver,
-#endif
#if SDL_VIDEO_RENDER_PS2 && !SDL_RENDER_DISABLED
&PS2_RenderDriver,
#endif
diff --git a/src/render/SDL_sysrender.h b/src/render/SDL_sysrender.h
index d9b6651c4128..49c682aec7fb 100644
--- a/src/render/SDL_sysrender.h
+++ b/src/render/SDL_sysrender.h
@@ -299,7 +299,6 @@ extern SDL_RenderDriver D3D11_RenderDriver;
extern SDL_RenderDriver D3D12_RenderDriver;
extern SDL_RenderDriver GL_RenderDriver;
extern SDL_RenderDriver GLES2_RenderDriver;
-extern SDL_RenderDriver GLES_RenderDriver;
extern SDL_RenderDriver METAL_RenderDriver;
extern SDL_RenderDriver PS2_RenderDriver;
extern SDL_RenderDriver PSP_RenderDriver;
diff --git a/src/render/opengles/SDL_glesfuncs.h b/src/render/opengles/SDL_glesfuncs.h
deleted file mode 100644
index 40a656455460..000000000000
--- a/src/render/opengles/SDL_glesfuncs.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-
-SDL_PROC(void, glBindTexture, (GLenum, GLuint))
-SDL_PROC(void, glBlendFunc, (GLenum, GLenum))
-SDL_PROC_OES(void, glBlendEquationOES, (GLenum))
-SDL_PROC_OES(void, glBlendEquationSeparateOES, (GLenum, GLenum))
-SDL_PROC_OES(void, glBlendFuncSeparateOES, (GLenum, GLenum, GLenum, GLenum))
-SDL_PROC(void, glClear, (GLbitfield))
-SDL_PROC(void, glClearColor, (GLclampf, GLclampf, GLclampf, GLclampf))
-SDL_PROC(void, glColor4f, (GLfloat, GLfloat, GLfloat, GLfloat))
-SDL_PROC(void, glColorPointer, (GLint, GLenum, GLsizei, const GLvoid *))
-SDL_PROC(void, glDeleteTextures, (GLsizei, const GLuint *))
-SDL_PROC(void, glDisable, (GLenum))
-SDL_PROC(void, glDisableClientState, (GLenum array))
-SDL_PROC(void, glDrawArrays, (GLenum, GLint, GLsizei))
-SDL_PROC_OES(void, glDrawTexfOES, (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat))
-SDL_PROC(void, glEnable, (GLenum))
-SDL_PROC(void, glEnableClientState, (GLenum))
-SDL_PROC(void, glFinish, (void))
-SDL_PROC_OES(void, glGenFramebuffersOES, (GLsizei, GLuint *))
-SDL_PROC(void, glGenTextures, (GLsizei, GLuint *))
-SDL_PROC(GLenum, glGetError, (void))
-SDL_PROC(void, glGetIntegerv, (GLenum, GLint *))
-SDL_PROC(void, glLoadIdentity, (void))
-SDL_PROC(void, glMatrixMode, (GLenum))
-SDL_PROC(void, glOrthof, (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat))
-SDL_PROC(void, glPixelStorei, (GLenum, GLint))
-SDL_PROC(void, glReadPixels, (GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid*))
-SDL_PROC(void, glScissor, (GLint, GLint, GLsizei, GLsizei))
-SDL_PROC(void, glTexCoordPointer, (GLint, GLenum, GLsizei, const GLvoid *))
-SDL_PROC(void, glTexEnvf, (GLenum, GLenum, GLfloat))
-SDL_PROC(void, glTexImage2D, (GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *))
-SDL_PROC(void, glTexParameteri, (GLenum, GLenum, GLint))
-SDL_PROC(void, glTexParameteriv, (GLenum, GLenum, const GLint *))
-SDL_PROC(void, glTexSubImage2D, (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *))
-SDL_PROC(void, glVertexPointer, (GLint, GLenum, GLsizei, const GLvoid *))
-SDL_PROC(void, glViewport, (GLint, GLint, GLsizei, GLsizei))
-SDL_PROC_OES(void, glBindFramebufferOES, (GLenum, GLuint))
-SDL_PROC_OES(void, glFramebufferTexture2DOES, (GLenum, GLenum, GLenum, GLuint, GLint))
-SDL_PROC_OES(GLenum, glCheckFramebufferStatusOES, (GLenum))
-SDL_PROC_OES(void, glDeleteFramebuffersOES, (GLsizei, const GLuint*))
-
-/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/render/opengles/SDL_render_gles.c b/src/render/opengles/SDL_render_gles.c
deleted file mode 100644
index 8e918c665517..000000000000
--- a/src/render/opengles/SDL_render_gles.c
+++ /dev/null
@@ -1,1218 +0,0 @@
-/*
- Simple DirectMedia Layer
- Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-*/
-#include "../../SDL_internal.h"
-
-#if SDL_VIDEO_RENDER_OGL_ES && !SDL_RENDER_DISABLED
-
-#include "SDL_hints.h"
-#include "../../video/SDL_sysvideo.h" /* For SDL_GL_SwapWindowWithResult */
-#include "SDL_opengles.h"
-#include "../SDL_sysrender.h"
-#include "../../SDL_utils_c.h"
-
-/* To prevent unnecessary window recreation,
- * these should match the defaults selected in SDL_GL_ResetAttributes
- */
-
-#define RENDERER_CONTEXT_MAJOR 1
-#define RENDERER_CONTEXT_MINOR 1
-
-/* OpenGL ES 1.1 renderer implementation, based on the OpenGL renderer */
-
-/* Used to re-create the window with OpenGL ES capability */
-extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags);
-
-static const float inv255f = 1.0f / 255.0f;
-
-typedef struct GLES_FBOList GLES_FBOList;
-
-struct GLES_FBOList
-{
- Uint32 w, h;
- GLuint FBO;
- GLES_FBOList *next;
-};
-
-typedef struct
-{
- SDL_Rect viewport;
- SDL_bool viewport_dirty;
- SDL_Texture *texture;
- SDL_Texture *target;
- int drawablew;
- int drawableh;
- SDL_BlendMode blend;
- SDL_bool cliprect_enabled_dirty;
- SDL_bool cliprect_enabled;
- SDL_bool cliprect_dirty;
- SDL_Rect cliprect;
- SDL_bool texturing;
- Uint32 color;
- Uint32 clear_color;
-} GLES_DrawStateCache;
-
-typedef struct
-{
- SDL_GLContext context;
-
-#define SDL_PROC(ret,func,params) ret (APIENTRY *func) params;
-#define SDL_PROC_OES SDL_PROC
-#include "SDL_glesfuncs.h"
-#undef SDL_PROC
-#undef SDL_PROC_OES
- SDL_bool GL_OES_framebuffer_object_supported;
- GLES_FBOList *framebuffers;
- GLuint window_framebuffer;
-
- SDL_bool GL_OES_blend_func_separate_supported;
- SDL_bool GL_OES_blend_equation_separate_supported;
- SDL_bool GL_OES_blend_subtract_supported;
-
- GLES_DrawStateCache drawstate;
-} GLES_RenderData;
-
-typedef struct
-{
- GLuint texture;
- GLenum type;
- GLfloat texw;
- GLfloat texh;
- GLenum format;
- GLenum formattype;
- void *pixels;
- int pitch;
- GLES_FBOList *fbo;
-} GLES_TextureData;
-
-static int
-GLES_SetError(const char *prefix, GLenum result)
-{
- const char *error;
-
- switch (result) {
- case GL_NO_ERROR:
- error = "GL_NO_ERROR";
- break;
- case GL_INVALID_ENUM:
- error = "GL_INVALID_ENUM";
- break;
- case GL_INVALID_VALUE:
- error = "GL_INVALID_VALUE";
- break;
- case GL_INVALID_OPERATION:
- error = "GL_INVALID_OPERATION";
- break;
- case GL_STACK_OVERFLOW:
- error = "GL_STACK_OVERFLOW";
- break;
- case GL_STACK_UNDERFLOW:
- error = "GL_STACK_UNDERFLOW";
- break;
- case GL_OUT_OF_MEMORY:
- error = "GL_OUT_OF_MEMORY";
- break;
- default:
- error = "UNKNOWN";
- break;
- }
- return SDL_SetError("%s: %s", prefix, error);
-}
-
-static int GLES_LoadFunctions(GLES_RenderData * data)
-{
-#if SDL_VIDEO_DRIVER_UIKIT
-#define __SDL_NOGETPROCADDR__
-#elif SDL_VIDEO_DRIVER_ANDROID
-#define __SDL_NOGETPROCADDR__
-#endif
-
-#ifdef __SDL_NOGETPROCADDR__
-#define SDL_PROC(ret,func,params) data->func=func;
-#define SDL_PROC_OES(ret,func,params) data->func=func;
-#else
-#define SDL_PROC(ret,func,params) \
- do { \
- data->func = SDL_GL_GetProcAddress(#func); \
- if ( ! data->func ) { \
- return SDL_SetError("Couldn't load GLES function %s: %s", #func, SDL_GetError()); \
- } \
- } while ( 0 );
-#define SDL_PROC_OES(ret,func,params) \
- do { \
- data->func = SDL_GL_GetProcAddress(#func); \
- } while ( 0 );
-#endif /* __SDL_NOGETPROCADDR__ */
-
-#include "SDL_glesfuncs.h"
-#undef SDL_PROC
-#undef SDL_PROC_OES
- return 0;
-}
-
-static GLES_FBOList *
-GLES_GetFBO(GLES_RenderData *data, Uint32 w, Uint32 h)
-{
- GLES_FBOList *result = data->framebuffers;
- while ((result) && ((result->w != w) || (result->h != h)) ) {
- result = result->next;
- }
- if (result == NULL) {
- result = SDL_malloc(sizeof(GLES_FBOList));
- result->w = w;
- result->h = h;
- data->glGenFramebuffersOES(1, &result->FBO);
- result->next = data->framebuffers;
- data->framebuffers = result;
- }
- return result;
-}
-
-
-static int
-GLES_ActivateRenderer(SDL_Renderer * renderer)
-{
- GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
-
- if (SDL_GL_GetCurrentContext() != data->context) {
- if (SDL_GL_MakeCurrent(renderer->window, data->context) < 0) {
- return -1;
- }
- }
-
- return 0;
-}
-
-static void
-GLES_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event)
-{
- GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
-
- if (event->event == SDL_WINDOWEVENT_MINIMIZED) {
- /* According to Apple documentation, we need to finish drawing NOW! */
- data->glFinish();
- }
-}
-
-static int
-GLES_GetOutputSize(SDL_Renderer * renderer, int *w, int *h)
-{
- SDL_GL_GetDrawableSize(renderer->window, w, h);
- return 0;
-}
-
-static GLenum GetBlendFunc(SDL_BlendFactor factor)
-{
- switch (factor) {
- case SDL_BLENDFACTOR_ZERO:
- return GL_ZERO;
- case SDL_BLENDFACTOR_ONE:
- return GL_ONE;
- case SDL_BLENDFACTOR_SRC_COLOR:
- return GL_SRC_COLOR;
- case SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR:
- return GL_ONE_MINUS_SRC_COLOR;
- case SDL_BLENDFACTOR_SRC_ALPHA:
- return GL_SRC_ALPHA;
- case SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA:
- return GL_ONE_MINUS_SRC_ALPHA;
- case SDL_BLENDFACTOR_DST_COLOR:
- return GL_DST_COLOR;
- case SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR:
- return GL_ONE_MINUS_DST_COLOR;
- case SDL_BLENDFACTOR_DST_ALPHA:
- return GL_DST_ALPHA;
- case SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA:
- return GL_ONE_MINUS_DST_ALPHA;
- default:
- return GL_INVALID_ENUM;
- }
-}
-
-static GLenum GetBlendEquation(SDL_BlendOperation operation)
-{
- switch (operation) {
- case SDL_BLENDOPERATION_ADD:
- return GL_FUNC_ADD_OES;
- case SDL_BLENDOPERATION_SUBTRACT:
- return GL_FUNC_SUBTRACT_OES;
- case SDL_BLENDOPERATION_REV_SUBTRACT:
- return GL_FUNC_REVERSE_SUBTRACT_OES;
- default:
- return GL_INVALID_ENUM;
- }
-}
-
-static SDL_bool
-GLES_SupportsBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode)
-{
- GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
- SDL_BlendFactor srcColorFactor = SDL_GetBlendModeSrcColorFactor(blendMode);
- SDL_BlendFactor srcAlphaFactor = SDL_GetBlendModeSrcAlphaFactor(blendMode);
- SDL_BlendOperation colorOperation = SDL_GetBlendModeColorOperation(blendMode);
- SDL_BlendFactor dstColorFactor = SDL_GetBlendModeDstColorFactor(blendMode);
- SDL_BlendFactor dstAlphaFactor = SDL_GetBlendModeDstAlphaFactor(blendMode);
- SDL_BlendOperation alphaOperation = SDL_GetBlendModeAlphaOperation(blendMode);
-
- if (GetBlendFunc(srcColorFactor) == GL_INVALID_ENUM ||
- GetBlendFunc(srcAlphaFactor) == GL_INVALID_ENUM ||
- GetBlendEquation(colorOperation) == GL_INVALID_ENUM ||
- GetBlendFunc(dstColorFactor) == GL_INVALID_ENUM ||
- GetBlendFunc(dstAlphaFactor) == GL_INVALID_ENUM ||
- GetBlendEquation(alphaOperation) == GL_INVALID_ENUM) {
- return SDL_FALSE;
- }
- if ((srcColorFactor != srcAlphaFactor || dstColorFactor != dstAlphaFactor) && !data->GL_OES_blend_func_separate_supported) {
- return SDL_FALSE;
- }
- if (colorOperation != alphaOperation && !data->GL_OES_blend_equation_separate_supported) {
- return SDL_FALSE;
- }
- if (colorOperation != SDL_BLENDOPERATION_ADD && !data->GL_OES_blend_subtract_supported) {
- return SDL_FALSE;
- }
- return SDL_TRUE;
-}
-
-static int
-GLES_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
-{
- GLES_RenderData *renderdata = (GLES_RenderData *) renderer->driverdata;
- GLES_TextureData *data;
- GLint internalFormat;
- GLenum format, type;
- int texture_w, texture_h;
- GLenum scaleMode;
- GLenum result;
-
- GLES_ActivateRenderer(renderer);
-
- switch (texture->format) {
- case SDL_PIXELFORMAT_ABGR8888:
- internalFormat = GL_RGBA;
- format = GL_RGBA;
- type = GL_UNSIGNED_BYTE;
- break;
- default:
- return SDL_SetError("Texture format not supported");
- }
-
- data = (GLES_TextureData *) SDL_calloc(1, sizeof(*data));
- if (!data) {
- return SDL_OutOfMemory();
- }
-
- if (texture->access == SDL_TEXTUREACCESS_STREAMING) {
- data->pitch = texture->w * SDL_BYTESPERPIXEL(texture->format);
- data->pixels = SDL_calloc(1, texture->h * data->pitch);
- if (!data->pixels) {
- SDL_free(data);
- return SDL_OutOfMemory();
- }
- }
-
-
- if (texture->access == SDL_TEXTUREACCESS_TARGET) {
- if (!renderdata->GL_OES_framebuffer_object_supported) {
- SDL_free(data);
- return SDL_SetError("GL_OES_framebuffer_object not supported");
- }
- data->fbo = GLES_GetFBO(renderer->driverdata, texture->w, texture->h);
- } else {
- data->fbo = NULL;
- }
-
-
- renderdata->glGetError();
- renderdata->glEnable(GL_TEXTURE_2D);
- renderdata->glGenTextures(1, &data->texture);
- result = renderdata->glGetError();
- if (result != GL_NO_ERROR) {
- if (texture->access == SDL_TEXTUREACCE
(Patch may be truncated, please check the link at the top of this post.)