From a2f877175bb2846013564096fed54909da8fce57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89lo=C3=AFse=20Brosseau?= <54746458+eloisebrosseau@users.noreply.github.com> Date: Sat, 21 Dec 2024 13:13:13 -0500 Subject: [PATCH] Fix AJA not working on Windows (#657) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Fix AJA not working on Windows ### Summarize your change. The GLEW library was not initialized before using other GLEW extension ### Describe the reason for the change. The AJA output module was having the same issue as the one mention in the following PR with BlackMagic: [[#116](https://git.autodesk.com/media-and-entertainment/rv/pull/116)](https://git.autodesk.com/media-and-entertainment/rv/pull/116). ### Describe what you have tested and on which operating system. Starting the presentation mode on Windows 11 with an AJA Io 4K Plus device does not make RV crash anymore. Signed-off-by: Éloïse Brosseau --- src/plugins/output/AJADevices/AJAModule.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/plugins/output/AJADevices/AJAModule.cpp b/src/plugins/output/AJADevices/AJAModule.cpp index 55663b485..230aae3ae 100644 --- a/src/plugins/output/AJADevices/AJAModule.cpp +++ b/src/plugins/output/AJADevices/AJAModule.cpp @@ -80,6 +80,17 @@ namespace AJADevices deviceIndex++; } + +#ifdef PLATFORM_WINDOWS + GLenum error = glewInit(nullptr); + if (error != GLEW_OK) + { + std::string message = "AJA: GLEW initialization failed: "; + throw std::runtime_error( + message + reinterpret_cast(glewGetErrorString(error)) + ); + } +#endif } void AJAModule::close()