|
@@ -44,13 +44,19 @@ static const char* debug_severity_table[] = {
|
|
|
"Low"
|
|
|
};
|
|
|
|
|
|
-/* ARB and core values are the same. They'll always be linear so no hardcoding. */
|
|
|
-/* The values subtracted are the lowest value in the list of valid values. */
|
|
|
+/* ARB and core values are the same. They'll always be linear so no hardcoding.
|
|
|
+ * The values subtracted are the lowest value in the list of valid values. */
|
|
|
#define GL_DEBUG_SOURCE_OFFSET(x) (x - GL_DEBUG_SOURCE_API_ARB)
|
|
|
#define GL_DEBUG_TYPE_OFFSET(x) (x - GL_DEBUG_TYPE_ERROR_ARB)
|
|
|
#define GL_DEBUG_SEVERITY_OFFSET(x) (x - GL_DEBUG_SEVERITY_HIGH_ARB)
|
|
|
|
|
|
-static APIENTRY void gl_debug_proc(
|
|
|
+#ifdef _WIN32
|
|
|
+#define GLEW_TEMP_API __stdcall
|
|
|
+#else
|
|
|
+#define GLEW_TEMP_API
|
|
|
+#endif
|
|
|
+
|
|
|
+static void GLEW_TEMP_API gl_debug_proc(
|
|
|
GLenum source, GLenum type, GLuint id, GLenum severity,
|
|
|
GLsizei length, const GLchar *message, GLvoid *data )
|
|
|
{
|
|
@@ -72,7 +78,8 @@ static void gl_enable_debug()
|
|
|
else if (GLEW_ARB_debug_output)
|
|
|
glDebugMessageCallbackARB(gl_debug_proc, NULL);
|
|
|
else {
|
|
|
- blog(LOG_DEBUG, "Failed to set GL debug callback as it is not supported.");
|
|
|
+ blog(LOG_DEBUG, "Failed to set GL debug callback as it is "
|
|
|
+ "not supported.");
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -89,14 +96,16 @@ static inline void required_extension_error(const char *extension)
|
|
|
static bool gl_init_extensions(struct gs_device* device)
|
|
|
{
|
|
|
if (!GLEW_VERSION_2_1) {
|
|
|
- blog(LOG_ERROR, "obs-studio requires OpenGL version 2.1 or higher.");
|
|
|
+ blog(LOG_ERROR, "obs-studio requires OpenGL version 2.1 or "
|
|
|
+ "higher.");
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
gl_enable_debug();
|
|
|
|
|
|
if (!GLEW_VERSION_3_0 && !GLEW_ARB_framebuffer_object) {
|
|
|
- blog(LOG_ERROR, "OpenGL extension ARB_framebuffer_object is required.");
|
|
|
+ blog(LOG_ERROR, "OpenGL extension ARB_framebuffer_object "
|
|
|
+ "is required.");
|
|
|
return false;
|
|
|
}
|
|
|
|
|
@@ -105,7 +114,8 @@ static bool gl_init_extensions(struct gs_device* device)
|
|
|
}
|
|
|
|
|
|
if (!GLEW_VERSION_4_1 && !GLEW_ARB_separate_shader_objects) {
|
|
|
- blog(LOG_ERROR, "OpenGL extension ARB_separate_shader_objects is required.");
|
|
|
+ blog(LOG_ERROR, "OpenGL extension ARB_separate_shader_objects "
|
|
|
+ "is required.");
|
|
|
return false;
|
|
|
}
|
|
|
|