-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Model Viewer: Improve mouse capture; code cleanup and add perf metrics
- Loading branch information
1 parent
8a13bdb
commit 9536db0
Showing
15 changed files
with
496 additions
and
514 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
modules/bundle-lwjgl/src/main/java/com/shade/gl/DebugGroup.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.shade.gl; | ||
|
||
import com.shade.util.NotNull; | ||
import org.lwjgl.opengl.GL43; | ||
|
||
/** | ||
* Creates a named debug group for the current OpenGL context. | ||
* <p> | ||
* <b>Note</b>: you can't reuse the same instance of this class. It's meant to be used in a try-with-resources block. | ||
* <blockquote><pre> | ||
* try (var group = new DebugGroup("My Group")) { | ||
* // OpenGL calls | ||
* }</pre> | ||
* </blockquote> | ||
* | ||
* @param name the name of the debug group | ||
*/ | ||
public record DebugGroup(@NotNull String name) implements AutoCloseable { | ||
public DebugGroup { | ||
GL43.glPushDebugGroup(GL43.GL_DEBUG_SOURCE_APPLICATION, 0, name); | ||
} | ||
|
||
@Override | ||
public void close() { | ||
GL43.glPopDebugGroup(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.