Commit Graph

18 Commits

Author SHA1 Message Date
Stefanos Stefanidis
2045b67c4b Use OpenGLES for iOS, OpenGL for macOS. 2025-11-03 18:17:56 +02:00
Stefanos Stefanidis
48db410acc Fix build errors on macOS 26. 2025-11-02 16:51:46 +02:00
Anders Jenbo
94c2d16180
Add OpenGL ES 2.0 renderer (#678) 2025-08-15 16:26:06 +00:00
Christian Semmler
a5a3c4ec83
Upgrade OpenGL ES renderer to 3.0, add option for MSAA (#636) 2025-07-23 18:00:48 +00:00
VoxelTek
bf3820c054
Fix debug mode when OpenGL is set as graphics device (#615) 2025-07-16 08:22:36 +00:00
Anders Jenbo
f8cc5b9651
Use FBO in WebGL (#547) 2025-07-08 00:48:00 +02:00
Anders Jenbo
af9f7cd791
3DS: Account for sprite scaling when resizing UI (#503) 2025-07-05 01:48:13 +02:00
Anders Jenbo
c63d725b64
Port WipeDown and Window to use DDBLT_COLORFILL (#506) 2025-07-03 22:20:31 +00:00
Anders Jenbo
55c13cd140
Implement dithering where relevant (#473) 2025-07-02 12:07:20 +02:00
Anders Jenbo
7b06ee5ae6
Add support for POT-only GPUs, fix VBO (#468) 2025-07-02 00:45:25 +02:00
Anders Jenbo
586327b584
Destry shader before the context (#463) 2025-07-01 04:15:02 +02:00
Anders Jenbo
e2ff65cf91
Expose window during device probing (#462) 2025-07-01 02:23:13 +02:00
Anders Jenbo
ab48ce60b0
OpenGL ES 2.0 Only lookup shader locations once (#460) 2025-06-30 23:38:44 +02:00
Anders Jenbo
225adda309
Rendering refactoring (#459)
* Hint texture intent to renderer

* improve transparancy for 32bit rendering

* Align OpenGL ES 2.0 with SDL_GPU's 2D rendering
2025-06-30 22:51:26 +02:00
David Gow
e87184b502
Fix the OpenGL backends on non-glx Linux platforms (and remove GLEW dependency) (#446)
* Work around issues with depth-buffer size on EGL-based platforms

The OpenGL 1.1 and OpenGL ES 2.0 backends can break on EGL-based platforms,
such as Wayland, or X11 with SDL_VIDEO_FORCE_EGL=1. One of the reasons for
this (the other being glew on the GL1.1 backend) is that SDL/egl get very
confused by the way we set OpenGL attributes, particularly SDL_GL_DEPTH_SIZE,
resulting in SDL_GL_CreateContext() failing with EGL_BAD_MATCH.

The exact cause of this is unknown, but it seems to be a combination of:
- SDL_GL_SetAttribute() is supposed to be called _before_ the window is
  created, and we're calling it afterward.
- Creating several test windows during the enumeration process, mixing
  and matching between OpenGL and OpenGL ES profiles.

The "most correct" solution is probably to delay creating the game window
until the backend creation process, rather than before the enumeration
occurs. But that's a real refactor, which could cause other issues.

Instead, set the 24-bit bit depth (which we've hardcoded anyway) before
creating the window, and use SDL_GL_ResetAttributes() when creating backends.

This seems to work here in all of the cases I was able to try (modulo the GLEW
dependency, which is removed in the next patch).

* miniwin: Remove GLEW dependency for OpenGL 1.1

GLEW normally backs directly onto glXGetProcAddress on Linux, which is broken
on non-GLX setups, such as Wayland (but also X11 with EGL, and presumably KMSDRM).

Replace it with manual calls to SDL_GL_GetProcAddress() for the VBO path.

Note, however, that SDL_opengl.h includes "windows.h", so conflicts with the
miniwin implementation, which breaks builds on windows.

In order to work around this, we do what the Direct3D9 implementation does and
push all of the OpenGL calls to a separate file, actual.cpp.

Going forward, it may make sense to load _all_ OpenGL entry points via SDL,
which would allow us to avoid linking directly with libGL/libOpenGL, and
therefore eliminate the separate build dependency altogether, as well as
allowing more runtime configurability as to the OpenGL library to load.

(But that's definitely a bit uglier, and also useful very rarely.)
2025-06-29 17:47:09 +02:00
Anders Jenbo
b65284a7a0
Move 2D drawing and upscaling to the renderer (#348) 2025-06-25 19:45:26 +02:00
Anders Jenbo
e9c5e5b9ba
Use extensions to probe for 24 or 32bit depth buffer (#329) 2025-06-17 17:50:36 +02:00
Anders Jenbo
eab95514d6
Add an OpenGL ES 2.0 renderer (#287) 2025-06-17 03:47:23 +02:00