Begin implementing legacy OpenGL renderer

This commit is contained in:
mrkubax10 2023-07-24 11:17:35 +00:00
parent 2a85327a8e
commit 87e1a9aee0
3 changed files with 13 additions and 2 deletions

View File

@ -56,8 +56,16 @@ else()
set(RENDERER_GL_DEFAULT ON) set(RENDERER_GL_DEFAULT ON)
endif() endif()
option(RENDERER_GL "Enable OpenGL renderer" ${RENDERER_GL_DEFAULT}) option(RENDERER_GL "Enable OpenGL renderer" ${RENDERER_GL_DEFAULT})
if(SERENITYOS)
set(RENDERER_LEGACY_GL_DEFAULT ON)
else()
set(RENDERER_LEGACY_GL_DEFAULT OFF)
endif()
# Please note that LEGACY_GL renderer should be only used on hardware/operating systems that do not support OpenGL 2.0+
option(RENDERER_LEGACY_GL "Enable legacy OpenGL renderer" ${RENDERER_LEGACY_GL_DEFAULT})
if(NOT BUILD_CLIENT) if(NOT BUILD_CLIENT)
set(RENDERER_GL OFF) set(RENDERER_GL OFF)
set(RENDERER_LEGACY_GL OFF)
endif() endif()
if(WIN32) if(WIN32)

View File

@ -26,6 +26,7 @@ SOFTWARE.
#cmakedefine BUILD_SERVER #cmakedefine BUILD_SERVER
#cmakedefine RENDERER_GL #cmakedefine RENDERER_GL
#cmakedefine RENDERER_LEGACY_GL
#cmakedefine WINDOW_WIN32 #cmakedefine WINDOW_WIN32
#cmakedefine WINDOW_X11 #cmakedefine WINDOW_X11

View File

@ -10,7 +10,9 @@
started from command line using `server` argument, example: `./polygun server`. started from command line using `server` argument, example: `./polygun server`.
If `BUILD_SERVER` is only configuration enabled then executable name will be changed to `polygun_server`. If `BUILD_SERVER` is only configuration enabled then executable name will be changed to `polygun_server`.
- `RENDERER_GL`, if true rendering with OpenGL support. This option is only valid if `BUILD_CLIENT` is enabled. - `RENDERER_GL`, if true rendering with OpenGL support. This option is only valid if `BUILD_CLIENT` is enabled.
By default enabled on every platform except Apple operating systems (i.e. macOS and iOS). By default enabled on every platform except Apple operating systems (i.e. macOS and iOS) and SerenityOS.
- `RENDERER_LEGACY_GL`, if true rendering with OpenGL 1.x will be enabled. Only valid if `BUILD_CLIENT` is enabled.
By default only enabled on SerenityOS. If your hardware/operating system supports OpenGL 2.0+ then use RENDERER_GL instead.
- `WINDOW_WIN32`, if true window creation using Win32 API will be enabled. It's Windows only and enabled there by default. - `WINDOW_WIN32`, if true window creation using Win32 API will be enabled. It's Windows only and enabled there by default.
- `WINDOW_X11`, if true window creation using X11 will be enabled. It's only valid on Unix-like systems and is detected there automatically. - `WINDOW_X11`, if true window creation using X11 will be enabled. It's only valid on Unix-like systems and is detected there automatically.
- `WINDOW_WAYLAND`, if true window creation using Wayland will be enabled. It's only valid on Linux and is detected there automatically. - `WINDOW_WAYLAND`, if true window creation using Wayland will be enabled. It's only valid on Linux and is detected there automatically.
@ -50,7 +52,7 @@
For `BUILD_CLIENT`: For `BUILD_CLIENT`:
| Library | Description | Required for | Custom CMake variables | | Library | Description | Required for | Custom CMake variables |
|----------------------------------------------------------------------------|--------------------------------|----------------------------------|------------------------------------------------------------| |----------------------------------------------------------------------------|--------------------------------|----------------------------------|------------------------------------------------------------|
| OpenGL | Rendering via OpenGL api | `RENDERER_GL` | *none* | | OpenGL | Rendering via OpenGL api | `RENDERER_{LEGACY}_GL` | *none* |
| [Xlib](https://www.x.org/wiki) | Window creation using X11 | `WINDOW_X11` | - `X11_INCLUDE_DIR`<br>- `X11_LIBRARIES` | | [Xlib](https://www.x.org/wiki) | Window creation using X11 | `WINDOW_X11` | - `X11_INCLUDE_DIR`<br>- `X11_LIBRARIES` |
| [libwayland-client](https://wayland.freedesktop.org) | Window creation using Wayland | `WINDOW_WAYLAND` | - `WaylandClient_INCLUDE_DIR`<br>- `WaylandClient_LIBRARY` | | [libwayland-client](https://wayland.freedesktop.org) | Window creation using Wayland | `WINDOW_WAYLAND` | - `WaylandClient_INCLUDE_DIR`<br>- `WaylandClient_LIBRARY` |
| [libwayland-egl](https://wayland.freedesktop.org) | Using EGL with Wayland | `WINDOW_WAYLAND` + `RENDERER_GL` | - `WaylandEGL_INCLUDE_DIR`<br>- `WaylandClient_LIBRARY` | | [libwayland-egl](https://wayland.freedesktop.org) | Using EGL with Wayland | `WINDOW_WAYLAND` + `RENDERER_GL` | - `WaylandEGL_INCLUDE_DIR`<br>- `WaylandClient_LIBRARY` |