本文整理了Java中org.lwjgl.glfw.GLFW.glfwWindowHint()
方法的一些代码示例,展示了GLFW.glfwWindowHint()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GLFW.glfwWindowHint()
方法的具体详情如下:
包路径:org.lwjgl.glfw.GLFW
类名称:GLFW
方法名:glfwWindowHint
[英]Sets hints for the next call to #glfwCreateWindow. The hints, once set, retain their values until changed by a call to this function or #glfwDefaultWindowHints, or until the library is terminated.
Only integer value hints can be set with this function. String value hints are set with #glfwWindowHintString.
This function does not check whether the specified hint values are valid. If you set hints to invalid values this will instead be reported by the next call to #glfwCreateWindow.
Some hints are platform specific. These may be set on any platform but they will only affect their specific platform. Other platforms will ignore them. Setting these hints requires no platform specific headers or functions.
NameDefault valueSupported values#GLFW_RESIZABLE#GLFW_TRUE#GLFW_TRUE or #GLFW_FALSE#GLFW_VISIBLE#GLFW_TRUE#GLFW_TRUE or #GLFW_FALSE#GLFW_DECORATED#GLFW_TRUE#GLFW_TRUE or #GLFW_FALSE#GLFW_FOCUSED#GLFW_TRUE#GLFW_TRUE or #GLFW_FALSE#GLFW_AUTO_ICONIFY#GLFW_TRUE#GLFW_TRUE or #GLFW_FALSE#GLFW_FLOATING#GLFW_FALSE#GLFW_TRUE or #GLFW_FALSE#GLFW_MAXIMIZED#GLFW_FALSE#GLFW_TRUE or #GLFW_FALSE#GLFW_CENTER_CURSOR#GLFW_TRUE#GLFW_TRUE or #GLFW_FALSE#GLFW_TRANSPARENT_FRAMEBUFFER#GLFW_FALSE#GLFW_TRUE or #GLFW_FALSE#GLFW_FOCUS_ON_SHOW#GLFW_TRUE#GLFW_TRUE or #GLFW_FALSE#GLFW_SCALE_TO_MONITOR#GLFW_FALSE#GLFW_TRUE or #GLFW_FALSE#GLFW_RED_BITS80 to Integer#MAX_VALUE or #GLFW_DONT_CARE#GLFW_GREEN_BITS80 to Integer#MAX_VALUE or #GLFW_DONT_CARE#GLFW_BLUE_BITS80 to Integer#MAX_VALUE or #GLFW_DONT_CARE#GLFW_ALPHA_BITS80 to Integer#MAX_VALUE or #GLFW_DONT_CARE#GLFW_DEPTH_BITS240 to Integer#MAX_VALUE or #GLFW_DONT_CARE#GLFW_STENCIL_BITS80 to Integer#MAX_VALUE or #GLFW_DONT_CARE#GLFW_ACCUM_RED_BITS00 to Integer#MAX_VALUE or #GLFW_DONT_CARE#GLFW_ACCUM_GREEN_BITS00 to Integer#MAX_VALUE or #GLFW_DONT_CARE#GLFW_ACCUM_BLUE_BITS00 to Integer#MAX_VALUE or #GLFW_DONT_CARE#GLFW_ACCUM_ALPHA_BITS00 to Integer#MAX_VALUE or #GLFW_DONT_CARE#GLFW_AUX_BUFFERS00 to Integer#MAX_VALUE#GLFW_SAMPLES00 to Integer#MAX_VALUE#GLFW_REFRESH_RATE#GLFW_DONT_CARE0 to Integer#MAX_VALUE or #GLFW_DONT_CARE#GLFW_STEREO#GLFW_FALSE#GLFW_TRUE or #GLFW_FALSE#GLFW_SRGB_CAPABLE#GLFW_FALSE#GLFW_TRUE or #GLFW_FALSE#GLFW_DOUBLEBUFFER#GLFW_TRUE#GLFW_TRUE or #GLFW_FALSE#GLFW_CLIENT_API#GLFW_OPENGL_API#GLFW_NO_API #GLFW_OPENGL_API #GLFW_OPENGL_ES_API#GLFW_CONTEXT_CREATION_API#GLFW_NATIVE_CONTEXT_API#GLFW_NATIVE_CONTEXT_API #GLFW_EGL_CONTEXT_API #GLFW_OSMESA_CONTEXT_API#GLFW_CONTEXT_VERSION_MAJOR1Any valid major version number of the chosen client API#GLFW_CONTEXT_VERSION_MINOR0Any valid minor version number of the chosen client API#GLFW_CONTEXT_ROBUSTNESS#GLFW_NO_ROBUSTNESS#GLFW_NO_ROBUSTNESS #GLFW_NO_RESET_NOTIFICATION #GLFW_LOSE_CONTEXT_ON_RESET#GLFW_CONTEXT_RELEASE_BEHAVIOR#GLFW_ANY_RELEASE_BEHAVIOR#GLFW_ANY_RELEASE_BEHAVIOR #GLFW_RELEASE_BEHAVIOR_FLUSH #GLFW_RELEASE_BEHAVIOR_NONE#GLFW_CONTEXT_NO_ERROR#GLFW_FALSE#GLFW_TRUE or #GLFW_FALSE#GLFW_OPENGL_FORWARD_COMPAT#GLFW_FALSE#GLFW_TRUE or #GLFW_FALSE#GLFW_OPENGL_DEBUG_CONTEXT#GLFW_FALSE#GLFW_TRUE or #GLFW_FALSE#GLFW_OPENGL_PROFILE#GLFW_OPENGL_ANY_PROFILE#GLFW_OPENGL_ANY_PROFILE #GLFW_OPENGL_CORE_PROFILE #GLFW_OPENGL_COMPAT_PROFILE#GLFW_COCOA_RETINA_FRAMEBUFFER#GLFW_TRUE#GLFW_TRUE or #GLFW_FALSE#GLFW_COCOA_GRAPHICS_SWITCHING#GLFW_FALSE#GLFW_TRUE or #GLFW_FALSE
This function must only be called from the main thread.
[中]设置下一次调用#glfwCreateWindow的提示。设置提示后,这些提示将保留其值,直到通过调用此函数或#glfwDefaultWindowHits进行更改,或者直到库终止。
此函数只能设置整数值提示。字符串值提示用#glfwWindowHintString设置。
此函数不检查指定的提示值是否有效。如果将提示设置为无效值,则下一次调用#glfwCreateWindow时会报告此情况。
有些提示是特定于平台的。可在任何平台上设置,但仅影响其特定平台。其他平台将忽略它们。设置这些提示不需要特定于平台的标题或函数。
#####支持的值和默认值
(3)GLFW)真实或(3)GLFW对真实或(3)GLFW对真实或(3)GLFW对假,GLFW对假,GLFW对假,GLFW对假,GLFW对假,GLFW对假(3)GLFW对假(3)GLFW对值值支持值默认值值支持值(3)农村农村农村农村农村农村农村义务义务默认值默认值默认值默认值默认值默认值默认值默认值默认值默认值默认值值默认值值值值值值值(3)农村暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力可见可见,暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力可见,暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力可见,暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力可见,暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力可见,暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力暴力或#GLFW#u假#GLFW#u自动#GLFW#u真#GLFW#u真或#GLFW#u假#GLFW#u浮动#GLFW#u假#GLFW#u真或#“GLFW#对假假(GLFWţ对假(GLFW对假)假假(GLFW对假)假(GLFW对假)假(GLFW对假)假(GLFW对假)假(GLFW对假)假,GLFW对假(GLFW对假)对假(GLFW对假)最大化(GLFW对假)对假(GLFW对假)对假)对假(对假)对假)对假,GLFW对中的中心对鼠标光标的光标的中心对光标的光标,GLFW对上,对上下下下一个中心对上下一个光标,GLFW对真,对真,对真,对真,对真,对真,对真,对真,对真,对真,对真,对真,对真,对真,对真,对真,对真,对真,对真,对真,对真,对真或对真或对真,TRUE#GLFW#U TRUE或#GLFW#U FALSE#GLFW#U缩放#U到#监视器#GLFW#U FALSE#GLFW#U RED#位80到整数#最大值或#GLFW表示不关心的,GLFW表示不关心的,GLFW表示不关心的,GLFW表示不关心的,GLFW表示不关心的,GLFW表示不关心的,GLFW表示不关心的,GLFW表示不蓝色表示不关心的,GLFW表示不蓝色表示不关心的,GLFW表示蓝色表示不关心的。GLFW表示绿色的绿色的绿色比特8 0到整数到整数的0到整数整数,最大值或者,或者,GLFW表示不关心的值或者,GLFW表示不关心的,GLFW表示不关心的,GLFW表示字母字母的0到整数的0到整数的0到整数,最大值,最大值或者是整数,最大值,最大值或者是最大值,或者是最大值或者,或者是,或者是。GLFW表示不关心的值或者是,或者是,或者是,GLFW表示不关心的。GLFW表示不关心的。GLFW表示不关心的。GLFW表示不关心的,#GLFW_模具_位80到整数#最大值或#GLFW_不在乎#GLFW_累计红色#位00到“GLFW(美国存废存存绿)比特币0到整数,最大值,最大值,最大值,最大值,最大值,最大值,最大值,最大值,最大值,最大值,最大值,最大值,最大值,最大值,最大值,最大值,绿色环保,绿色比特币0 0到整数,到整数,最大值,最大值,绿色比特币0到整数,到整数,最大值,最大值,最大值,绿色环保,绿色比特0 0到整数,到整数,到整数,最大值,最大值,最大值,最大值,最大值,最大值,最大值,最大值,或者,最大值,最大值,最大值,最大值,绿色比特0到整数,绿色比特0到整数,绿色比特0 0到整数,绿色比特0到整数,到整数,绿色比特0到整数,绿色比特0到整数,到整数,到整数,到整数,到整数,到整数,最大值,最大值,最大值,最大值,最大值,最大值,最大值,最大值,绿色环保环保0到整数#最大值#GLFW#样本00到整数#最大值#GLFW#刷新率#GLFW#不插入0到(3)GLFW-U立体声(35)GLFWţ你们们的立体声(3)GLFW你们们假假(3)GLFWţ;你们们政政政政政政政政政波值、最大值值或者或者(3)最大值整整整整整整整整整数值或者(3)你们们的最大值值值值值或者(3)最大值值,最大值值值值整整整整整整整整数值或者或者或者或者或者或者(3)GLFW你们们对或者或者或者或者或者(3)你们们对或者或者或者或者(5)可能可能,GLFW你们你们们对或者或者或者或者(3)对或者或者或者(3)整整整整整整整整整整整整整整整整整整整整数值或者或者或者或者或者或者或者或者或者或者或者或者或者或者,GLFW\\35;#;,GLFW你们们是是是是是是客户端API#GLFW#OPENGL#API#GLFW#NO#API#GLFW#OPENGL#API#GLFW#上下文#创建API#GLFW#本机上下文#GLFW本机上下文#API#GLFW_EGL_CONTEXT_API#GLFW_OSMESA_CONTEXT_API#GLFW_CONTEXT_VERSION#所选客户端API的任何有效主要版本号#GLFW_CONTEXT_VERSION#GLFW_CONTEXT_健壮性#GLFW#无健壮性#GLFW#无健壮性#GLFW#无重置通知#GLFW(GLFW)在一次失信(GLFW)在一次失信(GLFW)在一次失信(GLFW)在一次失信(GLFW)在一次失信(GLFW)在一次失信(GLFW)在一次失信(GLFW)在一次背景调查(GLFW)在一次背景调查和释放(发布)发布行为行为行为(行为)的行为(GLFW(GLFW)在上,GLFW(GLFW(GLFW)在任何发布任何人发布任何任何发布行为)行为的任何发布行为(行为)在行为(行为)在一次发布任何发布任何发布行为(行为行为)在一次行为行为,GLFW在一次发布行为行为,GLFW行为,GLFW,GLFW,GLFW,GLFW在任何发布任何发布任何发布任何发布任何发布任何发布任何发布任何发布任何发布任何发布任何发布发布行为行为行为行为行为行为行为行为行为行为行为(行为U FALSE#GLFW#TRUE或#GLFW#FALSE#GLFW#OPENGL#调试#上下文#GLFW#FALSE#GLFW#TRUE或#GLFW和OPENGL的任何一个轮廓线(GLFW和OPENGL的任何一个轮廓线(GLFW)和GLFW和OPENGL的任何一个轮廓线(GLFW和GLFW和OPENGL的任何一个任何一个轮廓线(GLFW和OPENGL的任何一个假轮廓线)、GLFW和OPENGL的任何一个假轮廓线(GLFW)和OPENGL的一个OPENGL的一个OPENGL的一个图形和一个轮廓线(GLFW)的OPENGL的OPENGL的一个OPENGL的一个OPENGL的一个OPENGL的一个轮廓线(轮廓线)轮廓线)的任何一个轮廓线,GLFW和一个OPENGL的任何一个OPENGL的任何一个OPENGL的任何一个OPENGL的任何一个OPENGL的任何一个OPENGL的任何一个OPENGL的任何一个OPENGL的任何一个OPENGL的任何一个轮廓线的任何一个轮廓线的任何一个轮廓线的任何一个;GLFW_正确或#GLFW_错误
只能从主线程调用此函数。
代码示例来源:origin: libgdx/libgdx
static long createGlfwWindow(Lwjgl3ApplicationConfiguration config, long sharedContextWindow) {
GLFW.glfwDefaultWindowHints();
GLFW.glfwWindowHint(GLFW.GLFW_VISIBLE, GLFW.GLFW_FALSE);
GLFW.glfwWindowHint(GLFW.GLFW_RESIZABLE, config.windowResizable ? GLFW.GLFW_TRUE : GLFW.GLFW_FALSE);
GLFW.glfwWindowHint(GLFW.GLFW_MAXIMIZED, config.windowMaximized ? GLFW.GLFW_TRUE : GLFW.GLFW_FALSE);
GLFW.glfwWindowHint(GLFW.GLFW_AUTO_ICONIFY, config.autoIconify ? GLFW.GLFW_TRUE : GLFW.GLFW_FALSE);
GLFW.glfwWindowHint(GLFW.GLFW_RED_BITS, config.r);
GLFW.glfwWindowHint(GLFW.GLFW_GREEN_BITS, config.g);
GLFW.glfwWindowHint(GLFW.GLFW_BLUE_BITS, config.b);
GLFW.glfwWindowHint(GLFW.GLFW_ALPHA_BITS, config.a);
GLFW.glfwWindowHint(GLFW.GLFW_STENCIL_BITS, config.stencil);
GLFW.glfwWindowHint(GLFW.GLFW_DEPTH_BITS, config.depth);
GLFW.glfwWindowHint(GLFW.GLFW_SAMPLES, config.samples);
GLFW.glfwWindowHint(GLFW.GLFW_CONTEXT_VERSION_MAJOR, config.gles30ContextMajorVersion);
GLFW.glfwWindowHint(GLFW.GLFW_CONTEXT_VERSION_MINOR, config.gles30ContextMinorVersion);
if (SharedLibraryLoader.isMac) {
GLFW.glfwWindowHint(GLFW.GLFW_OPENGL_FORWARD_COMPAT, GLFW.GLFW_TRUE);
GLFW.glfwWindowHint(GLFW.GLFW_OPENGL_PROFILE, GLFW.GLFW_OPENGL_CORE_PROFILE);
GLFW.glfwWindowHint(GLFW.GLFW_TRANSPARENT_FRAMEBUFFER, GLFW.GLFW_TRUE);
GLFW.glfwWindowHint(GLFW.GLFW_OPENGL_DEBUG_CONTEXT, GLFW.GLFW_TRUE);
GLFW.glfwWindowHint(GLFW.GLFW_DECORATED, config.windowDecorated? GLFW.GLFW_TRUE: GLFW.GLFW_FALSE);
windowHandle = GLFW.glfwCreateWindow(config.windowWidth, config.windowHeight, config.title, 0, sharedContextWindow);
代码示例来源:origin: libgdx/libgdx
static long createGlfwWindow(Lwjgl3ApplicationConfiguration config, long sharedContextWindow) {
GLFW.glfwDefaultWindowHints();
GLFW.glfwWindowHint(GLFW.GLFW_VISIBLE, GLFW.GLFW_FALSE);
GLFW.glfwWindowHint(GLFW.GLFW_RESIZABLE, config.windowResizable ? GLFW.GLFW_TRUE : GLFW.GLFW_FALSE);
GLFW.glfwWindowHint(GLFW.GLFW_MAXIMIZED, config.windowMaximized ? GLFW.GLFW_TRUE : GLFW.GLFW_FALSE);
GLFW.glfwWindowHint(GLFW.GLFW_AUTO_ICONIFY, config.autoIconify ? GLFW.GLFW_TRUE : GLFW.GLFW_FALSE);
GLFW.glfwWindowHint(GLFW.GLFW_RED_BITS, config.r);
GLFW.glfwWindowHint(GLFW.GLFW_GREEN_BITS, config.g);
GLFW.glfwWindowHint(GLFW.GLFW_BLUE_BITS, config.b);
GLFW.glfwWindowHint(GLFW.GLFW_ALPHA_BITS, config.a);
GLFW.glfwWindowHint(GLFW.GLFW_STENCIL_BITS, config.stencil);
GLFW.glfwWindowHint(GLFW.GLFW_DEPTH_BITS, config.depth);
GLFW.glfwWindowHint(GLFW.GLFW_SAMPLES, config.samples);
GLFW.glfwWindowHint(GLFW.GLFW_CONTEXT_VERSION_MAJOR, config.gles30ContextMajorVersion);
GLFW.glfwWindowHint(GLFW.GLFW_CONTEXT_VERSION_MINOR, config.gles30ContextMinorVersion);
if (SharedLibraryLoader.isMac) {
GLFW.glfwWindowHint(GLFW.GLFW_OPENGL_FORWARD_COMPAT, GLFW.GLFW_TRUE);
GLFW.glfwWindowHint(GLFW.GLFW_OPENGL_PROFILE, GLFW.GLFW_OPENGL_CORE_PROFILE);
GLFW.glfwWindowHint(GLFW.GLFW_TRANSPARENT_FRAMEBUFFER, GLFW.GLFW_TRUE);
GLFW.glfwWindowHint(GLFW.GLFW_OPENGL_DEBUG_CONTEXT, GLFW.GLFW_TRUE);
GLFW.glfwWindowHint(GLFW.GLFW_DECORATED, config.windowDecorated? GLFW.GLFW_TRUE: GLFW.GLFW_FALSE);
windowHandle = GLFW.glfwCreateWindow(config.windowWidth, config.windowHeight, config.title, 0, sharedContextWindow);
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_TRUE);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_FALSE);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_ANY_PROFILE);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
}).run();
glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GLFW_TRUE);
glfwWindowHint(GLFW_SRGB_CAPABLE, GLFW_TRUE);
glfwWindowHint(GLFW_VISIBLE, GL_FALSE);
glfwWindowHint(GLFW_RESIZABLE, settings.isResizable() ? GLFW_TRUE : GLFW_FALSE);
glfwWindowHint(GLFW_DEPTH_BITS, settings.getDepthBits());
glfwWindowHint(GLFW_STENCIL_BITS, settings.getStencilBits());
glfwWindowHint(GLFW_SAMPLES, settings.getSamples());
glfwWindowHint(GLFW_STEREO, settings.useStereo3D() ? GLFW_TRUE : GLFW_FALSE);
glfwWindowHint(GLFW_REFRESH_RATE, settings.getFrequency());
glfwWindowHint(GLFW_RED_BITS, 8);
glfwWindowHint(GLFW_GREEN_BITS, 8);
glfwWindowHint(GLFW_BLUE_BITS, 8);
} else if (settings.getBitsPerPixel() == 16) {
glfwWindowHint(GLFW_RED_BITS, 5);
glfwWindowHint(GLFW_GREEN_BITS, 6);
glfwWindowHint(GLFW_BLUE_BITS, 5);
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GLFW_TRUE);
glfwWindowHint(GLFW_SRGB_CAPABLE, GLFW_TRUE);
glfwWindowHint(GLFW_VISIBLE, GL_FALSE);
glfwWindowHint(GLFW_RESIZABLE, settings.isResizable() ? GLFW_TRUE : GLFW_FALSE);
glfwWindowHint(GLFW_DOUBLEBUFFER, GLFW_TRUE);
glfwWindowHint(GLFW_DEPTH_BITS, settings.getDepthBits());
glfwWindowHint(GLFW_STENCIL_BITS, settings.getStencilBits());
glfwWindowHint(GLFW_SAMPLES, settings.getSamples());
glfwWindowHint(GLFW_STEREO, settings.useStereo3D() ? GLFW_TRUE : GLFW_FALSE);
glfwWindowHint(GLFW_REFRESH_RATE, settings.getFrequency());
glfwWindowHint(GLFW_RED_BITS, 8);
glfwWindowHint(GLFW_GREEN_BITS, 8);
glfwWindowHint(GLFW_BLUE_BITS, 8);
} else if (settings.getBitsPerPixel() == 16) {
glfwWindowHint(GLFW_RED_BITS, 5);
glfwWindowHint(GLFW_GREEN_BITS, 6);
glfwWindowHint(GLFW_BLUE_BITS, 5);
glfwWindowHint(GLFW_ALPHA_BITS, settings.getAlphaBits());
代码示例来源:origin: sriharshachilakapati/SilenceEngine
/**
* This method sets the window hints that would affect the next newly created window. The hints, once set, retain
* their values until changed by a call to {@link Window#setHint(int, boolean)} or {@link Window#setDefaultHints()}
* or this method. These are also cleared by terminating the GLFW library with {@link GLFW3#terminate()}.
*
* @param hint The window hint to be set. These hints are integer constants provided in the {@link GLFW} class.
* @param value The new value of the window hint.
*/
public static void setHint(int hint, int value)
{
glfwWindowHint(hint, value);
}
代码示例来源:origin: Renanse/Ardor3D
@Override
public void init() {
if (_inited) {
return;
}
GLFWErrorCallback.createPrint(System.err).set();
if (!GLFW.glfwInit()) {
throw new IllegalStateException("Unable to initialize GLFW");
}
try {
GLFW.glfwDefaultWindowHints();
GLFW.glfwWindowHint(GLFW.GLFW_RESIZABLE, GL11C.GL_FALSE);
GLFW.glfwWindowHint(GLFW.GLFW_VISIBLE, GL11C.GL_FALSE);
GLFW.glfwWindowHint(GLFW.GLFW_CONTEXT_VERSION_MAJOR, 3);
GLFW.glfwWindowHint(GLFW.GLFW_CONTEXT_VERSION_MINOR, 3);
GLFW.glfwWindowHint(GLFW.GLFW_OPENGL_DEBUG_CONTEXT, GLFW.GLFW_TRUE);
GLFW.glfwWindowHint(GLFW.GLFW_OPENGL_PROFILE, GLFW.GLFW_OPENGL_CORE_PROFILE);
GLFW.glfwWindowHint(GLFW.GLFW_OPENGL_FORWARD_COMPAT, GLFW.GLFW_TRUE);
GLFW.glfwSetErrorCallback(_errorCallback = GLFWErrorCallback.createPrint(System.err));
_windowId = GLFW.glfwCreateWindow(_settings.getWidth(), _settings.getHeight(), "Ardor3D", 0, 0);
} catch (final Exception e) {
logger.severe("Cannot create window");
logger.logp(Level.SEVERE, this.getClass().toString(), "initDisplay()", "Exception", e);
throw new Ardor3dException("Cannot create window: " + e.getMessage());
}
_canvasRenderer.init(_settings, true); // true - do swap in renderer.
_inited = true;
}
代码示例来源:origin: jsettlers/settlers-remake
public void async_init() {
if(debug) {
ec = GLFWErrorCallback.createPrint(System.err);
GLFW.glfwSetErrorCallback(ec);
}
if(!GLFW.glfwInit()) throw new Error("glfwInit() failed!");
GLFW.glfwWindowHint(GLFW.GLFW_OPENGL_DEBUG_CONTEXT, debug ? GLFW.GLFW_TRUE : GLFW.GLFW_DONT_CARE);
GLFW.glfwWindowHint(GLFW.GLFW_STENCIL_BITS, 1);
glfw_wnd = GLFW.glfwCreateWindow(width + 1, width + 1, "lwjgl-offscreen", 0, 0);
GLFW.glfwMakeContextCurrent(glfw_wnd);
GLFW.glfwSwapInterval(0);
event_converter.registerCallbacks();
}
代码示例来源:origin: fynnfluegge/oreon-engine
public void create()
{
glfwWindowHint(GLFW_RESIZABLE, GL_TRUE);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
setId(glfwCreateWindow(getWidth(), getHeight(), getTitle(), 0, 0));
if(getId() == 0) {
throw new RuntimeException("Failed to create window");
}
setIcon("textures/logo/oreon_lwjgl_icon32.png");
glfwMakeContextCurrent(getId());
glfwSwapInterval(0);
GL.createCapabilities();
}
代码示例来源:origin: fynnfluegge/oreon-engine
@Override
public void create() {
glfwDefaultWindowHints();
glfwWindowHint(GLFW_RESIZABLE, GL_TRUE);
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
setId(glfwCreateWindow(getWidth(), getHeight(), getTitle(), 0, 0));
if(getId() == 0) {
throw new RuntimeException("Failed to create window");
}
setIcon("textures/logo/oreon_lwjgl_icon32.png");
}
代码示例来源:origin: lwjglgamedev/lwjglbook
glfwWindowHint(GLFW_VISIBLE, GL_FALSE); // the window will stay hidden after creation
glfwWindowHint(GLFW_RESIZABLE, GL_TRUE); // the window will be resizable
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
代码示例来源:origin: lwjglgamedev/lwjglbook
glfwWindowHint(GLFW_VISIBLE, GL_FALSE); // the window will stay hidden after creation
glfwWindowHint(GLFW_RESIZABLE, GL_TRUE); // the window will be resizable
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
代码示例来源:origin: lwjglgamedev/lwjglbook
glfwWindowHint(GLFW_VISIBLE, GL_FALSE); // the window will stay hidden after creation
glfwWindowHint(GLFW_RESIZABLE, GL_TRUE); // the window will be resizable
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
代码示例来源:origin: lwjglgamedev/lwjglbook
glfwWindowHint(GLFW_VISIBLE, GL_FALSE); // the window will stay hidden after creation
glfwWindowHint(GLFW_RESIZABLE, GL_TRUE); // the window will be resizable
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
代码示例来源:origin: lwjglgamedev/lwjglbook
glfwWindowHint(GLFW_VISIBLE, GL_FALSE); // the window will stay hidden after creation
glfwWindowHint(GLFW_RESIZABLE, GL_TRUE); // the window will be resizable
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
代码示例来源:origin: lwjglgamedev/lwjglbook
glfwWindowHint(GLFW_VISIBLE, GL_FALSE); // the window will stay hidden after creation
glfwWindowHint(GLFW_RESIZABLE, GL_TRUE); // the window will be resizable
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
代码示例来源:origin: lwjglgamedev/lwjglbook
glfwWindowHint(GLFW_VISIBLE, GL_FALSE); // the window will stay hidden after creation
glfwWindowHint(GLFW_RESIZABLE, GL_TRUE); // the window will be resizable
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
代码示例来源:origin: lwjglgamedev/lwjglbook
glfwWindowHint(GLFW_VISIBLE, GL_FALSE); // the window will stay hidden after creation
glfwWindowHint(GLFW_RESIZABLE, GL_TRUE); // the window will be resizable
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
代码示例来源:origin: badlogic/lwjgl3-maven-gradle
glfwWindowHint(GLFW_VISIBLE, GL_FALSE); // the window will stay hidden after creation
glfwWindowHint(GLFW_RESIZABLE, GL_TRUE); // the window will be resizable
代码示例来源:origin: badlogic/lwjgl3-maven-gradle
glfwWindowHint(GLFW_VISIBLE, GL_FALSE); // the window will stay hidden after creation
glfwWindowHint(GLFW_RESIZABLE, GL_TRUE); // the window will be resizable
代码示例来源:origin: playn/playn
glfwWindowHint(GLFW_VISIBLE, GL_FALSE);
glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);
window = glfwCreateWindow(width, height, config.appName, monitor, 0);
if (window == 0) throw new RuntimeException("Failed to create window; see error log.");
内容来源于网络,如有侵权,请联系作者删除!