本文整理匯總了Java中org.lwjgl.glfw.GLFWErrorCallback.createPrint方法的典型用法代碼示例。如果您正苦於以下問題:Java GLFWErrorCallback.createPrint方法的具體用法?Java GLFWErrorCallback.createPrint怎麽用?Java GLFWErrorCallback.createPrint使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.lwjgl.glfw.GLFWErrorCallback
的用法示例。
在下文中一共展示了GLFWErrorCallback.createPrint方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: init
import org.lwjgl.glfw.GLFWErrorCallback; //導入方法依賴的package包/類
/**
* Initializes the game.
*/
public void init() {
/* Set error callback */
errorCallback = GLFWErrorCallback.createPrint();
glfwSetErrorCallback(errorCallback);
/* Initialize GLFW */
if (!glfwInit()) {
throw new IllegalStateException("Unable to initialize GLFW!");
}
/* Create GLFW window */
window = new Window(640, 480, "Simple Game - Pong", true);
/* Initialize timer */
timer.init();
/* Initialize renderer */
renderer.init();
/* Initialize states */
initStates();
/* Initializing done, set running to true */
running = true;
}
示例2: init
import org.lwjgl.glfw.GLFWErrorCallback; //導入方法依賴的package包/類
/**
* Creates and sets the GLFW error callback to {@link System.err}.
* Initializes the GLFW library.
*
* <b>This is required before the graphicslab windowing system is able to be
* used.</b>
*
* Returns true if successful or throws {@link IllegalStateException} in
* case GLFW failed to initialize.
*/
protected static boolean init() {
if (isActive()) {
return true;
}
errorCallback = GLFWErrorCallback.createPrint(System.err);
errorCallback.set();
if (!(isActive = glfwInit())) {
throw new IllegalStateException("Unable to initialize GLFW.");
}
return true;
}
示例3: setErrorCallbackToPrintToSterr
import org.lwjgl.glfw.GLFWErrorCallback; //導入方法依賴的package包/類
/** Convenience method to print a message out to System.err when an error occurs */
public static void setErrorCallbackToPrintToSterr() {
GLFWErrorCallback tmp = GLFWErrorCallback.createPrint(System.err);
GLFW.glfwSetErrorCallback(tmp);
errorCallback = tmp;
}
示例4: GLFWPlatform
import org.lwjgl.glfw.GLFWErrorCallback; //導入方法依賴的package包/類
protected GLFWPlatform(IImageSupport imageSupport) {
this.errorCallback = GLFWErrorCallback.createPrint(System.err);
this.imageSupport = imageSupport;
this.mainThread = Thread.currentThread();
}
示例5: finishInitialization
import org.lwjgl.glfw.GLFWErrorCallback; //導入方法依賴的package包/類
@RequiresNonNull("this.mav")
@EnsuresNonNull("this.canvas")
@UIEffect
private void finishInitialization(boolean es) {
GLFWErrorCallback ecb = GLFWErrorCallback.createPrint(System.err);
mav.keepAlive(ecb);
glfwSetErrorCallback(ecb);
GLFWWindowSizeCallback scb = GLFWWindowSizeCallback.create(this::updateWindowSize);
mav.keepAlive(scb);
glfwSetWindowSizeCallback(window, scb);
updateWindowSize(window, DEFAULT_WIDTH, DEFAULT_HEIGHT);
String version = getGLVersion(es);
int major = version.charAt(0)-'0';
int minor = version.charAt(2)-'0';
if (es) {
if (major >= 3) {
log.info("Using OpenGL ES 3 rendering");
canvas = new NanoVGGLES3Canvas(mav);
} else if (major >= 2) {
log.info("Using OpenGL ES 2 rendering");
canvas = new NanoVGGLES2Canvas(mav);
} else {
throw new Panic("panic.noSuitableContext", I18n.get("panic.noSuitableContext.onlyGlEs", version));
}
} else {
if (major >= 3) {
log.info("Using OpenGL 3 rendering");
canvas = new NanoVGGL3Canvas(mav);
} else if (major >= 2) {
log.info("Using OpenGL 2 rendering");
canvas = new NanoVGGL2Canvas(mav);
} else {
throw new Panic("panic.noSuitableContext", I18n.get("panic.noSuitableContext.onlyGl", version));
}
}
glfwShowWindow(window);
if (glfwExtensionSupported("WGL_EXT_swap_control_tear") || glfwExtensionSupported("GLX_EXT_swap_control_tear")) {
log.info("Using tearing prevention");
glfwSwapInterval(-1);
} else {
glfwSwapInterval(1);
}
}