Skip to content

Commit

Permalink
Merge branch 'Development' into node-groups
Browse files Browse the repository at this point in the history
  • Loading branch information
pragma37 committed Sep 14, 2024
2 parents c88fa73 + 3d473cf commit 31e2a21
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
3 changes: 0 additions & 3 deletions BlenderMalt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,6 @@ def register():
def unregister():
for _class in reversed(classes): bpy.utils.unregister_class(_class)

if version_missmatch():
return

unregister_plugins()

for module in reversed(get_modules()):
Expand Down
23 changes: 23 additions & 0 deletions Bridge/Server.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,21 @@ def render(self):

PROFILE = False

@GLDEBUGPROC
def gl_debug_callback(source, type, id, severity, length, message, user_param):
def fmt(enum):
try:
return GL_ENUMS[enum].removeprefix("GL_DEBUG_").removesuffix("_KHR").removesuffix("_ARB").replace("_"," ")
except:
return "(format error)"
msg = f"OPENGL DEBUG CALLBACK ({id}):\n{fmt(type)} > {fmt(severity)} > {fmt(source)}\n{message.decode('utf-8')}"
if type == GL_DEBUG_TYPE_ERROR:
LOG.error(msg)
elif severity == GL_DEBUG_SEVERITY_NOTIFICATION:
LOG.info(msg)
else:
LOG.warning(msg)

def main(pipeline_path, viewport_bit_depth, connection_addresses,
shared_dic, lock, log_path, debug_mode, plugins_paths, docs_path):
LOG.info('DEBUG MODE: {}'.format(debug_mode))
Expand All @@ -290,8 +305,16 @@ def main(pipeline_path, viewport_bit_depth, connection_addresses,
glfw.window_hint(glfw.CONTEXT_VERSION_MINOR, 5)
glfw.window_hint(glfw.OPENGL_PROFILE, glfw.OPENGL_CORE_PROFILE)

if debug_mode:
glfw.window_hint(glfw.OPENGL_DEBUG_CONTEXT, True)

window = glfw.create_window(256, 256, 'Malt', None, None)
glfw.make_context_current(window)

if debug_mode:
glEnable(GL_DEBUG_OUTPUT)
glDebugMessageCallback(gl_debug_callback, None)

# Don't hide for better OS/Drivers schedule priority
#glfw.hide_window(window)
# Minimize instead:
Expand Down

0 comments on commit 31e2a21

Please sign in to comment.