comparison Samples/Sdl/RtViewer/RtViewerSdl.cpp @ 1431:1eaf19af15bf

OpenGL: OS X does not seem to support debug output functionality
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 15 May 2020 21:14:35 +0200
parents 5128b448a6ee
children c6bfcc105414
comparison
equal deleted inserted replaced
1430:5128b448a6ee 1431:1eaf19af15bf
42 42
43 #include <SDL.h> 43 #include <SDL.h>
44 44
45 #include <string> 45 #include <string>
46 46
47 #if !defined(GLAPIENTRY) 47
48 // For OS X compatibility 48 #if !defined(__APPLE__)
49 # define GLAPIENTRY 49 /**
50 #endif 50 * OpenGL: "OS X does not seem to support debug output functionality
51 51 * (as gathered online)."
52 * https://learnopengl.com/In-Practice/Debugging
53 **/
52 static void GLAPIENTRY 54 static void GLAPIENTRY
53 OpenGLMessageCallback(GLenum source, 55 OpenGLMessageCallback(GLenum source,
54 GLenum type, 56 GLenum type,
55 GLuint id, 57 GLuint id,
56 GLenum severity, 58 GLenum severity,
63 fprintf(stderr, "GL CALLBACK: %s type = 0x%x, severity = 0x%x, message = %s\n", 65 fprintf(stderr, "GL CALLBACK: %s type = 0x%x, severity = 0x%x, message = %s\n",
64 (type == GL_DEBUG_TYPE_ERROR ? "** GL ERROR **" : ""), 66 (type == GL_DEBUG_TYPE_ERROR ? "** GL ERROR **" : ""),
65 type, severity, message); 67 type, severity, message);
66 } 68 }
67 } 69 }
70 #endif
68 71
69 namespace OrthancStone 72 namespace OrthancStone
70 { 73 {
71 void RtViewerView::EnableGLDebugOutput() 74 void RtViewerView::EnableGLDebugOutput()
72 { 75 {
76 #if !defined(__APPLE__)
73 glEnable(GL_DEBUG_OUTPUT); 77 glEnable(GL_DEBUG_OUTPUT);
74 glDebugMessageCallback(OpenGLMessageCallback, 0); 78 glDebugMessageCallback(OpenGLMessageCallback, 0);
79 #endif
75 } 80 }
76 81
77 boost::shared_ptr<IViewport> RtViewerView::CreateViewport(const std::string& canvasId) 82 boost::shared_ptr<IViewport> RtViewerView::CreateViewport(const std::string& canvasId)
78 { 83 {
79 // False means we do NOT let Windows treat this as a legacy application that needs to be scaled 84 // False means we do NOT let Windows treat this as a legacy application that needs to be scaled