diff --git a/.efrocachemap b/.efrocachemap index c58e53c1..9c6ef01f 100644 --- a/.efrocachemap +++ b/.efrocachemap @@ -444,8 +444,8 @@ "build/assets/ba_data/data/languages/korean.json": "ca1122a9ee551da3f75ae632012bd0e2", "build/assets/ba_data/data/languages/malay.json": "832562ce997fc70704b9234c95fb2e38", "build/assets/ba_data/data/languages/persian.json": "4f448b29ba04f2b789329600cb7f9ab7", - "build/assets/ba_data/data/languages/polish.json": "8bb8f7baa5efcf6cdd627140d209c2b2", - "build/assets/ba_data/data/languages/portuguese.json": "93070dbcc020d6879b3a8b163bb833b4", + "build/assets/ba_data/data/languages/polish.json": "b9a58b70ed5e99d8b7fa2392b2eb0cda", + "build/assets/ba_data/data/languages/portuguese.json": "556af4e8170356ad239412e1743e20d5", "build/assets/ba_data/data/languages/romanian.json": "aeebdd54f65939c2facc6ac50c117826", "build/assets/ba_data/data/languages/russian.json": "e120993371f52edd2d99f2236188933c", "build/assets/ba_data/data/languages/serbian.json": "d7452dd72ac0e51680cb39b5ebaa1c69", @@ -4056,50 +4056,50 @@ "build/assets/windows/Win32/ucrtbased.dll": "2def5335207d41b21b9823f6805997f1", "build/assets/windows/Win32/vc_redist.x86.exe": "b08a55e2e77623fe657bea24f223a3ae", "build/assets/windows/Win32/vcruntime140d.dll": "865b2af4d1e26a1a8073c89acb06e599", - "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "04cc9672b68549229d886d3a96c559f8", - "build/prefab/full/linux_arm64_gui/release/ballisticakit": "60bc7a1b793cb8c7cc9ee2305a75953b", - "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "eb68b04ffb489e7f54e4b13eabc0c416", - "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "5a84d5cfb73f0e0ece21e1770297cbb3", - "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "d738dcba7e385ef2f33b7fa99f67a1cf", - "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "f77cca19be423f9f336e16aafd7d0a5c", - "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "f9b295df29fd33143b2f22f493b6bc7b", - "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "c001b5a1209f65915cb5fb5e535ce53f", - "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "e14f263b6b6de064bf511793c6daf475", - "build/prefab/full/mac_arm64_gui/release/ballisticakit": "ba8114d593ba4bba116fc2c80187e38c", - "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "04abddf234a1a24769a80c5338600cd0", - "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "2f0a86b778a4bd1e6d9030c8e487667b", - "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "ea3c80e71f0f9649316b25c463d0cca1", - "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "5466299bc6a5441e163f8b0d20cf46b8", - "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "2db72fb3a266978da20f771942c0522d", - "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "46d9588afa767ac1d42e9ea8410ce479", - "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "a4b700a36f77b981187292d875062fb1", - "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "f029c6193ff74de24294bc36c747e42e", - "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "c9c886f24652bccb21eae3916d156733", - "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "9d6dee5923fdad2444e4980421b61cff", - "build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "d13fe92c2320101a4181492268ba70ca", - "build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "0a2c9c29c146659e06c0d759de0470a3", - "build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "d13fe92c2320101a4181492268ba70ca", - "build/prefab/lib/linux_arm64_server/release/libballisticaplus.a": "0a2c9c29c146659e06c0d759de0470a3", - "build/prefab/lib/linux_x86_64_gui/debug/libballisticaplus.a": "35ea11934b942d4e324cf33a7f7db1dd", - "build/prefab/lib/linux_x86_64_gui/release/libballisticaplus.a": "df851b6dd6df1ffb00695faf8e33cc5d", - "build/prefab/lib/linux_x86_64_server/debug/libballisticaplus.a": "35ea11934b942d4e324cf33a7f7db1dd", - "build/prefab/lib/linux_x86_64_server/release/libballisticaplus.a": "df851b6dd6df1ffb00695faf8e33cc5d", - "build/prefab/lib/mac_arm64_gui/debug/libballisticaplus.a": "157a0fd47c7b48c66be6058e76743620", - "build/prefab/lib/mac_arm64_gui/release/libballisticaplus.a": "9e89c86c7d5a525ce08193fced92145e", - "build/prefab/lib/mac_arm64_server/debug/libballisticaplus.a": "157a0fd47c7b48c66be6058e76743620", - "build/prefab/lib/mac_arm64_server/release/libballisticaplus.a": "9e89c86c7d5a525ce08193fced92145e", - "build/prefab/lib/mac_x86_64_gui/debug/libballisticaplus.a": "0cfbed48c5d2500ae087b4a3416589f0", - "build/prefab/lib/mac_x86_64_gui/release/libballisticaplus.a": "d036dfa710783e8b7948c656902660f8", - "build/prefab/lib/mac_x86_64_server/debug/libballisticaplus.a": "f453e38d79316914e6caeb0eb077c439", - "build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "d036dfa710783e8b7948c656902660f8", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "be8918e4c25df2ca78754e73e8acb2d3", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "09c0a5d4fb356b39959091185500e100", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "9fd25d104cbe1cf2c11ae5ffd45bd5b6", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "3af52572a283f2a7c1c52cb069e02828", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "c62abf065085981e6a34298abe457a59", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "acacc1c19b703e2358efde714eeab986", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "35e4e4162ba4d34cda62fef2699b20a7", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "862b132df7db2003ff505113d446e089", + "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "19f758d463a96209e647e651c611d1b9", + "build/prefab/full/linux_arm64_gui/release/ballisticakit": "49506eff59a21d3cfb6fc55db4edeeae", + "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "1cd9dfdc832995ba84386803c2eb3d7e", + "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "f9786e628a44b5d14dbd842e29f37b4d", + "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "a21e3ab1ec336eb8f957deeee96926e4", + "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "e93a34b23530cf29d443529af6a42d4c", + "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "2ecbe46fb8b6ddb96340e35e53d7e73e", + "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "37d5f679d73736214f8d12980028511d", + "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "b09fbdc4f44383ed0111ac19b13371dd", + "build/prefab/full/mac_arm64_gui/release/ballisticakit": "b8332772459f472a559e05002ce6921c", + "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "5e0cfb078710084739280d17cbc86732", + "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "6b25f48718896540a46e9aef9f993c51", + "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "940db05971335a1a8a84e96adc948a84", + "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "98ab1223c634600b44e2c407b3cee6e2", + "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "3c1be40378854bffa24a2e118979e252", + "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "a1a8830a0892b6a8ed8827241cf848aa", + "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "27b755855aa9ebe54e536ad04a82b867", + "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "f291bcc463de9b5172904304774d1c12", + "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "16bb769fd794945b09d6ed40ab11a411", + "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "83a5455b631ececcddf5330693c2d38a", + "build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "ac33b224e5b4e35712eb98fcc20cab5b", + "build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "81ac92010f7957feffde3573745976d2", + "build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "ac33b224e5b4e35712eb98fcc20cab5b", + "build/prefab/lib/linux_arm64_server/release/libballisticaplus.a": "81ac92010f7957feffde3573745976d2", + "build/prefab/lib/linux_x86_64_gui/debug/libballisticaplus.a": "1d2d67df52456863593f5a32ee591c5f", + "build/prefab/lib/linux_x86_64_gui/release/libballisticaplus.a": "4360984cf0a0e1664bd052894ebc522e", + "build/prefab/lib/linux_x86_64_server/debug/libballisticaplus.a": "1d2d67df52456863593f5a32ee591c5f", + "build/prefab/lib/linux_x86_64_server/release/libballisticaplus.a": "4360984cf0a0e1664bd052894ebc522e", + "build/prefab/lib/mac_arm64_gui/debug/libballisticaplus.a": "f86bc9554c44e6a3041ee06ff7690ae2", + "build/prefab/lib/mac_arm64_gui/release/libballisticaplus.a": "c6815480bdfcbbb30ffe06bfc25a3fd2", + "build/prefab/lib/mac_arm64_server/debug/libballisticaplus.a": "f86bc9554c44e6a3041ee06ff7690ae2", + "build/prefab/lib/mac_arm64_server/release/libballisticaplus.a": "c6815480bdfcbbb30ffe06bfc25a3fd2", + "build/prefab/lib/mac_x86_64_gui/debug/libballisticaplus.a": "8e3f285a0d05918175c6054b3841621e", + "build/prefab/lib/mac_x86_64_gui/release/libballisticaplus.a": "5ec40f0445bc6415d9327c5b1cb0f645", + "build/prefab/lib/mac_x86_64_server/debug/libballisticaplus.a": "2793d3aea54fc937322393dd779412a7", + "build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "5ec40f0445bc6415d9327c5b1cb0f645", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "d254bb364aa44360cac2003934af76f6", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "0db2f48d7a46826de315df7ce473ab52", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "5ec488e800f024c0827deb229e4e1efc", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "430045c8d5f966488628ab5de5452e10", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "892c0eb2ec182ccbdcb604713d5d5ba9", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "3b2917f0882ac5889c12f2ca83269063", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "bef209af05f0af8ee5fe6d33246d846d", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "93a8f27c51283913e35b0e2d8b8a37b0", "src/assets/ba_data/python/babase/_mgen/__init__.py": "f885fed7f2ed98ff2ba271f9dbe3391c", "src/assets/ba_data/python/babase/_mgen/enums.py": "28323912b56ec07701eda3d41a6a4101", "src/ballistica/base/mgen/pyembed/binding_base.inc": "72bfed2cce8ff19741989dec28302f3f", diff --git a/CHANGELOG.md b/CHANGELOG.md index 3fdd1001..94d91285 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,14 @@ -### 1.7.29 (build 21609, api 8, 2023-11-18) +### 1.7.29 (build 21612, api 8, 2023-11-20) - Simply continued work on the big 1.7.28 update. I finally got the Mac App Store version of the game updated (it had been stuck at 1.4!), and it turns out that Apple AppStore submissions require the version number to increase each time and not just the build number, so we may start seeing more minor version bumps for that reason. +- Windows builds should now die with a clear error when the OpenGL version is + too old (OpenGL 3.0 or newer is required). Previously they could die with more + cryptic error messages such as "OpenGL function 'glActiveTexture2D' not + found". ### 1.7.28 (build 21599, api 8, 2023-11-16) diff --git a/src/assets/ba_data/python/baenv.py b/src/assets/ba_data/python/baenv.py index 284fdda6..837fa6a7 100644 --- a/src/assets/ba_data/python/baenv.py +++ b/src/assets/ba_data/python/baenv.py @@ -52,7 +52,7 @@ if TYPE_CHECKING: # Build number and version of the ballistica binary we expect to be # using. -TARGET_BALLISTICA_BUILD = 21609 +TARGET_BALLISTICA_BUILD = 21612 TARGET_BALLISTICA_VERSION = '1.7.29' diff --git a/src/assets/ba_data/python/bauiv1lib/account/v2proxy.py b/src/assets/ba_data/python/bauiv1lib/account/v2proxy.py index 51d48061..a9ba5279 100644 --- a/src/assets/ba_data/python/bauiv1lib/account/v2proxy.py +++ b/src/assets/ba_data/python/bauiv1lib/account/v2proxy.py @@ -62,14 +62,11 @@ class V2ProxySignInWindow(bui.Window): label=bui.Lstr(resource='cancelText'), on_activate_call=self._done, autoselect=True, - color=(0.55, 0.5, 0.6), - textcolor=(0.75, 0.7, 0.8), ) - if bool(False): - bui.containerwidget( - edit=self._root_widget, cancel_button=self._cancel_button - ) + bui.containerwidget( + edit=self._root_widget, cancel_button=self._cancel_button + ) self._update_timer: bui.AppTimer | None = None diff --git a/src/ballistica/base/graphics/gl/gl_sys.cc b/src/ballistica/base/graphics/gl/gl_sys.cc index 5d6e42ab..be6b3d40 100644 --- a/src/ballistica/base/graphics/gl/gl_sys.cc +++ b/src/ballistica/base/graphics/gl/gl_sys.cc @@ -52,7 +52,7 @@ bool g_sys_gl_inited{}; // Provide an empty implementation of this if noone provided a real one. #ifndef BA_HAS_SYS_GL_INIT -void SysGLInit() { assert(!g_sys_gl_inited); } +void SysGLInit(RendererGL* renderer) { assert(!g_sys_gl_inited); } #endif // BA_HAS_SYS_GL_INIT diff --git a/src/ballistica/base/graphics/gl/gl_sys.h b/src/ballistica/base/graphics/gl/gl_sys.h index e2519c70..a33eac0c 100644 --- a/src/ballistica/base/graphics/gl/gl_sys.h +++ b/src/ballistica/base/graphics/gl/gl_sys.h @@ -220,6 +220,7 @@ inline void glDepthRange(double min, double max) { #endif namespace ballistica::base { +class RendererGL; extern bool g_sys_gl_inited; @@ -228,7 +229,7 @@ extern bool g_sys_gl_inited; // called only once and then g_sys_gl_inited set. A platform that defines // this should define BA_HAS_SYS_GL_INIT; otherwise a default empty // implementation will be defined. -void SysGLInit(); +void SysGLInit(RendererGL* renderer); } // namespace ballistica::base diff --git a/src/ballistica/base/graphics/gl/gl_sys_windows.cc b/src/ballistica/base/graphics/gl/gl_sys_windows.cc index f627bcd1..ae65f49e 100644 --- a/src/ballistica/base/graphics/gl/gl_sys_windows.cc +++ b/src/ballistica/base/graphics/gl/gl_sys_windows.cc @@ -5,19 +5,22 @@ #include "SDL.h" #include "ballistica/base/graphics/gl/gl_sys.h" +#include "ballistica/base/graphics/gl/renderer_gl.h" #include "ballistica/shared/ballistica.h" #pragma comment(lib, "opengl32.lib") -// #pragma comment(lib, "glu32.lib") PFNGLGETINTERNALFORMATIVPROC glGetInternalformativ{}; PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glGetFramebufferAttachmentParameteriv{}; PFNGLBLENDFUNCSEPARATEPROC glBlendFuncSeparate{}; + +PFNGLCOMPRESSEDTEXIMAGE2DPROC glCompressedTexImage2DBA{}; PFNGLACTIVETEXTUREPROC glActiveTextureBA{}; +// PFNGLCOMPRESSEDTEXIMAGE2DPROC glCompressedTexImageARB{}; // PFNGLCLIENTACTIVETEXTUREARBPROC glClientActiveTextureARB{}; + PFNGLPOINTPARAMETERFVARBPROC glPointParameterfvARB{}; -// PFNGLPOINTPARAMETERFARBPROC glPointParameterfARB{}; PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT{}; PFNGLCREATEPROGRAMPROC glCreateProgram{}; PFNGLCREATESHADERPROC glCreateShader{}; @@ -57,7 +60,6 @@ PFNGLENABLEVERTEXATTRIBARRAYPROC glEnableVertexAttribArray{}; PFNGLDISABLEVERTEXATTRIBARRAYPROC glDisableVertexAttribArray{}; PFNGLUNIFORMMATRIX4FVARBPROC glUniformMatrix4fv{}; PFNGLBINDATTRIBLOCATIONPROC glBindAttribLocation{}; -PFNGLCOMPRESSEDTEXIMAGE2DPROC glCompressedTexImage2DBA{}; PFNGLGETSHADERIVPROC glGetShaderiv{}; PFNGLGETPROGRAMIVPROC glGetProgramiv{}; PFNGLDELETESHADERPROC glDeleteShader{}; @@ -90,11 +92,16 @@ static auto GetGLFunc_(const char* name, bool required) -> void* { #define GET2(PTRTYPE, FUNC, REQUIRED) \ FUNC##BA = (PTRTYPE)GetGLFunc_(#FUNC, REQUIRED) -void SysGLInit() { +void SysGLInit(RendererGL* renderer) { assert(!g_sys_gl_inited); SDL_GL_LoadLibrary(nullptr); + // Check overall GL version here before loading any extended functions. + // We'd rather die with a 'Your OpenGL is too old' error rather than a + // 'Could not load function foofDinglePlop2XZ'. + renderer->CheckGLVersion(); + void* testval{}; PFNGLGETINTERNALFORMATIVPROC fptr; @@ -104,18 +111,13 @@ void SysGLInit() { // so we can survive without it. GET(PFNGLGETINTERNALFORMATIVPROC, glGetInternalformativ, false); - // For checking srgb stuff. + GET(PFNGLBLENDFUNCSEPARATEPROC, glBlendFuncSeparate, true); GET(PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC, - glGetFramebufferAttachmentParameteriv, false); - - // Needed for VR overlay. - GET(PFNGLBLENDFUNCSEPARATEPROC, glBlendFuncSeparate, false); - + glGetFramebufferAttachmentParameteriv, true); + GET(PFNGLGETSTRINGIPROC, glGetStringi, true); GET2(PFNGLACTIVETEXTUREPROC, glActiveTexture, true); - // GET(PFNGLCLIENTACTIVETEXTUREARBPROC, glClientActiveTextureARB, true); GET(PFNWGLSWAPINTERVALEXTPROC, wglSwapIntervalEXT, true); GET(PFNGLPOINTPARAMETERFVARBPROC, glPointParameterfvARB, true); - // GET(PFNGLPOINTPARAMETERFARBPROC, glPointParameterfARB, true); GET(PFNGLCREATEPROGRAMPROC, glCreateProgram, true); GET(PFNGLCREATESHADERPROC, glCreateShader, true); GET(PFNGLSHADERSOURCEPROC, glShaderSource, true); @@ -159,7 +161,6 @@ void SysGLInit() { GET(PFNGLDETACHSHADERPROC, glDetachShader, true); GET(PFNGLGETSHADERINFOLOGPROC, glGetShaderInfoLog, true); GET(PFNGLGETPROGRAMINFOLOGPROC, glGetProgramInfoLog, true); - GET(PFNGLGETSTRINGIPROC, glGetStringi, true); GET(PFNGLBINDVERTEXARRAYPROC, glBindVertexArray, true); GET(PFNGLGENVERTEXARRAYSPROC, glGenVertexArrays, true); GET(PFNGLDELETEVERTEXARRAYSPROC, glDeleteVertexArrays, true); diff --git a/src/ballistica/base/graphics/gl/gl_sys_windows.h b/src/ballistica/base/graphics/gl/gl_sys_windows.h index 228543aa..60ce107e 100644 --- a/src/ballistica/base/graphics/gl/gl_sys_windows.h +++ b/src/ballistica/base/graphics/gl/gl_sys_windows.h @@ -31,9 +31,13 @@ extern PFNGLGETINTERNALFORMATIVPROC glGetInternalformativ; extern PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glGetFramebufferAttachmentParameteriv; extern PFNGLBLENDFUNCSEPARATEPROC glBlendFuncSeparate; + +// Hopefully can switch this back if SDL gets fixed. extern PFNGLACTIVETEXTUREPROC glActiveTextureBA; +extern PFNGLCOMPRESSEDTEXIMAGE2DPROC glCompressedTexImage2DBA; // extern PFNGLCLIENTACTIVETEXTUREARBPROC glClientActiveTextureARB; // extern PFNGLPOINTPARAMETERFARBPROC glPointParameterfARB; + extern PFNGLPOINTPARAMETERFVARBPROC glPointParameterfvARB; extern PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT; extern PFNGLCREATEPROGRAMPROC glCreateProgram; @@ -74,7 +78,6 @@ extern PFNGLENABLEVERTEXATTRIBARRAYPROC glEnableVertexAttribArray; extern PFNGLDISABLEVERTEXATTRIBARRAYPROC glDisableVertexAttribArray; extern PFNGLUNIFORMMATRIX4FVARBPROC glUniformMatrix4fv; extern PFNGLBINDATTRIBLOCATIONPROC glBindAttribLocation; -extern PFNGLCOMPRESSEDTEXIMAGE2DPROC glCompressedTexImage2DBA; extern PFNGLGETSHADERIVPROC glGetShaderiv; extern PFNGLGETPROGRAMIVPROC glGetProgramiv; extern PFNGLDELETESHADERPROC glDeleteShader; diff --git a/src/ballistica/base/graphics/gl/renderer_gl.cc b/src/ballistica/base/graphics/gl/renderer_gl.cc index c24db341..75fa0dae 100644 --- a/src/ballistica/base/graphics/gl/renderer_gl.cc +++ b/src/ballistica/base/graphics/gl/renderer_gl.cc @@ -72,7 +72,7 @@ RendererGL::RendererGL() { // Run any one-time setup the platform might need to do // (grabbing function pointers, etc.) if (!g_sys_gl_inited) { - SysGLInit(); + SysGLInit(this); g_sys_gl_inited = true; } @@ -152,10 +152,33 @@ static auto CheckGLExtension(const std::vector& exts, return false; } +// This is split into its own call because systems that load GL calls +// dynamically may want to run the check before trying to load said GL +// calls. It's better to die with a 'Your OpenGL is too old' error rather +// than a 'Could not load function foofDinglePlop2XZ'. +void RendererGL::CheckGLVersion() { + if (checked_gl_version_) { + return; + } + const char* version_str = (const char*)glGetString(GL_VERSION); + BA_PRECONDITION_FATAL(version_str); + // Do a rough check to make sure we're running 3 or newer of GL/GLES. + // This query should be available even on older versions. + if (version_str[0] != '3' && version_str[0] != '4') { + FatalError( + std::string("Your OpenGL version is too old (") + version_str + + "). We require 3.0 or later. Try updating your graphics drivers."); + } + checked_gl_version_ = true; +} + void RendererGL::CheckGLCapabilities_() { BA_DEBUG_CHECK_GL_ERROR; assert(g_base->app_adapter->InGraphicsContext()); + // Die if our overall GL version is too old. + CheckGLVersion(); + const char* renderer = (const char*)glGetString(GL_RENDERER); BA_PRECONDITION_FATAL(renderer); const char* vendor = (const char*)glGetString(GL_VENDOR); @@ -163,15 +186,9 @@ void RendererGL::CheckGLCapabilities_() { const char* version_str = (const char*)glGetString(GL_VERSION); BA_PRECONDITION_FATAL(version_str); - // Do a rough check to make sure we're running 3 or newer of GL/GLES. - // This query should be available even on older versions. - if (version_str[0] != '3' && version_str[0] != '4') { - FatalError(std::string("Invalid OpenGL version found (") + version_str - + "). We require 3.0 or later."); - } - // Now fetch exact major/minor versions. This query requires version 3.0 - // or newer which is why we checked that above. + // or newer which is why we checked overall version in CheckGLVersion() + // above. glGetError(); // Clear any existing error so we don't die on it here. glGetIntegerv(GL_MAJOR_VERSION, &gl_version_major_); BA_PRECONDITION_FATAL(glGetError() == GL_NO_ERROR); diff --git a/src/ballistica/base/graphics/gl/renderer_gl.h b/src/ballistica/base/graphics/gl/renderer_gl.h index c3afef5a..bc0a3cf7 100644 --- a/src/ballistica/base/graphics/gl/renderer_gl.h +++ b/src/ballistica/base/graphics/gl/renderer_gl.h @@ -64,6 +64,7 @@ class RendererGL : public Renderer { class ProgramSpriteGL; public: + void CheckGLVersion(); static void CheckGLError(const char* file, int line); static auto GLErrorToString(GLenum err) -> std::string; static auto GetGLTextureFormat(TextureFormat f) -> GLenum; @@ -259,22 +260,24 @@ class RendererGL : public Renderer { void SetBlend(bool b); void SetBlendPremult(bool b); - bool blend_{}; - bool blend_premult_{}; - bool first_extension_check_{true}; - bool is_tegra_4_{}; - bool is_tegra_k1_{}; - bool is_recent_adreno_{}; - bool is_adreno_{}; - bool enable_msaa_{}; - bool draw_at_equal_depth_{}; - bool depth_writing_enabled_{}; - bool depth_testing_enabled_{}; - bool data_loaded_{}; - bool draw_front_{}; - bool got_screen_framebuffer_{}; - bool double_sided_{}; - bool invalidate_framebuffer_support_{}; + GraphicsQuality vignette_quality_{}; + bool blend_ : 1 {}; + bool blend_premult_ : 1 {}; + bool first_extension_check_ : 1 {true}; + bool is_tegra_4_ : 1 {}; + bool is_tegra_k1_ : 1 {}; + bool is_recent_adreno_ : 1 {}; + bool is_adreno_ : 1 {}; + bool enable_msaa_ : 1 {}; + bool draw_at_equal_depth_ : 1 {}; + bool depth_writing_enabled_ : 1 {}; + bool depth_testing_enabled_ : 1 {}; + bool data_loaded_ : 1 {}; + bool draw_front_ : 1 {}; + bool got_screen_framebuffer_ : 1 {}; + bool double_sided_ : 1 {}; + bool invalidate_framebuffer_support_ : 1 {}; + bool checked_gl_version_ : 1 {}; GLint gl_version_major_{}; GLint gl_version_minor_{}; int last_blur_res_count_{}; @@ -291,7 +294,6 @@ class RendererGL : public Renderer { GLint screen_framebuffer_{}; GLuint random_tex_{}; GLuint vignette_tex_{}; - GraphicsQuality vignette_quality_{}; GLint viewport_x_{}; GLint viewport_y_{}; GLint viewport_width_{}; diff --git a/src/ballistica/shared/ballistica.cc b/src/ballistica/shared/ballistica.cc index 66948a27..197a4514 100644 --- a/src/ballistica/shared/ballistica.cc +++ b/src/ballistica/shared/ballistica.cc @@ -39,7 +39,7 @@ auto main(int argc, char** argv) -> int { namespace ballistica { // These are set automatically via script; don't modify them here. -const int kEngineBuildNumber = 21609; +const int kEngineBuildNumber = 21612; const char* kEngineVersion = "1.7.29"; const int kEngineApiVersion = 8;