本文整理汇总了Java中org.lwjgl.glfw.GLFWImage.set方法的典型用法代码示例。如果您正苦于以下问题:Java GLFWImage.set方法的具体用法?Java GLFWImage.set怎么用?Java GLFWImage.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.glfw.GLFWImage
的用法示例。
在下文中一共展示了GLFWImage.set方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setPointerIcon
import org.lwjgl.glfw.GLFWImage; //导入方法依赖的package包/类
@Override
public void setPointerIcon(File file, int hotX, int hotY) {
checkMainThread();
Long cursor = FILE2CRSR.get(file);
if(cursor == null) {
try {
IHostImage src = Platform.get().getImageSupport().readHost(new FileInputStream(file), ComponentType.BYTE, ComponentFormat.RGBA, AlphaMode.POST_MULTIPLIED);
GLFWImage image = GLFWImage.malloc();
image.set(src.getWidth(), src.getHeight(), flip(src.getPixels(), src.getHeight()));
cursor = Long.valueOf(GLFW.glfwCreateCursor(image, hotX, hotY));
FILE2CRSR.put(file, cursor);
image.free();
} catch(Throwable t) {
log.warning(t);
}
}
if(cursor != null)
GLFW.glfwSetCursor(window, cursor.longValue());
}
示例2: create
import org.lwjgl.glfw.GLFWImage; //导入方法依赖的package包/类
public void create(int width, int height)
{
setWidth(width);
setHeight(height);
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);
window = glfwCreateWindow(width, height, "OREON ENGINE Programming Tutorial Series", 0, 0);
if(window == 0) {
throw new RuntimeException("Failed to create window");
}
ByteBuffer bufferedImage = ImageLoader.loadImageToByteBuffer("./res/logo/oreon_lwjgl_icon32.png");
GLFWImage image = GLFWImage.malloc();
image.set(32, 32, bufferedImage);
GLFWImage.Buffer images = GLFWImage.malloc(1);
images.put(0, image);
glfwSetWindowIcon(window, images);
glfwMakeContextCurrent(window);
GL.createCapabilities();
glfwShowWindow(window);
}
示例3: setWindowIcon
import org.lwjgl.glfw.GLFWImage; //导入方法依赖的package包/类
/**
* Sets the taskbar and window icon for the game
*/
private void setWindowIcon() {
GLFWImage image = GLFWImage.malloc();
image.set(32, 32, loadIcon("/icon.png"));
GLFWImage.Buffer images = GLFWImage.malloc(1);
images.put(0, image);
glfwSetWindowIcon(window, images);
images.free();
image.free();
}
示例4: setIcon
import org.lwjgl.glfw.GLFWImage; //导入方法依赖的package包/类
public void setIcon(String path){
ByteBuffer bufferedImage = ResourceLoader.loadImageToByteBuffer(path);
GLFWImage image = GLFWImage.malloc();
image.set(32, 32, bufferedImage);
GLFWImage.Buffer images = GLFWImage.malloc(1);
images.put(0, image);
glfwSetWindowIcon(getId(), images);
}