Skip to content

Commit

Permalink
Not force skipping OpenGL error checks
Browse files Browse the repository at this point in the history
Remove openURL in favor of openURI
Print GLCaps as INFO level
  • Loading branch information
BloCamLimb committed Nov 3, 2024
1 parent f6fb88f commit ef8b3b1
Showing 1 changed file with 6 additions and 22 deletions.
28 changes: 6 additions & 22 deletions core/src/main/java/icyllis/modernui/core/Core.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import java.io.*;
import java.lang.ref.Cleaner;
import java.net.URI;
import java.net.URL;
import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.nio.channels.*;
Expand Down Expand Up @@ -202,7 +201,6 @@ private static ContextOptions initContextOptions(@NonNull ContextOptions options
if (options.mLogger == null || options.mLogger == NOPLogger.NOP_LOGGER) {
options.mLogger = LoggerFactory.getLogger("Arc3D");
}
options.mSkipGLErrorChecks = Boolean.TRUE;
return options;
}

Expand Down Expand Up @@ -249,7 +247,7 @@ public static boolean initOpenGL(@NonNull ContextOptions options) {
LOGGER.info(MARKER, "OpenGL renderer: {}", glRenderer);
LOGGER.info(MARKER, "OpenGL version: {}", glVersion);

LOGGER.debug(MARKER, "OpenGL caps: {}", dc.getCaps());
LOGGER.info(MARKER, "OpenGL caps: {}", dc.getCaps());
return true;
}

Expand Down Expand Up @@ -702,17 +700,17 @@ public static ByteBuffer readIntoNativeBuffer(@NonNull InputStream stream) throw
}

/**
* Launches the associated application to open the URL.
* Launches the associated application to open the URI.
*
* @return true on success, false on failure
*/
public static boolean openURL(@NonNull URL url) {
public static boolean openURI(@NonNull URI uri) {
try {
String s = url.toString();
String s = uri.toString();
String[] cmd = switch (Platform.get()) {
case WINDOWS -> new String[]{"rundll32", "url.dll,FileProtocolHandler", s};
case MACOSX -> new String[]{"open", s};
default -> new String[]{"xdg-open", url.getProtocol().equals("file")
default -> new String[]{"xdg-open", "file".equals(uri.getScheme())
? s.replace("file:", "file://")
: s};
};
Expand All @@ -721,28 +719,14 @@ public static boolean openURL(@NonNull URL url) {
reader.lines().forEach(line -> LOGGER.error(MARKER, line));
}
return true;
} catch (IOException e) {
LOGGER.error(MARKER, "Failed to open URL: {}", url, e);
return false;
}
}

/**
* Launches the associated application to open the URL.
*
* @return true on success, false on failure
*/
public static boolean openURI(@NonNull URI uri) {
try {
return openURL(uri.toURL());
} catch (Exception e) {
LOGGER.error(MARKER, "Failed to open URI: {}", uri, e);
return false;
}
}

/**
* Launches the associated application to open the URL.
* Launches the associated application to open the URI.
*
* @return true on success, false on failure
*/
Expand Down

0 comments on commit ef8b3b1

Please sign in to comment.