当前位置: 首页>>代码示例>>Java>>正文


Java GLFWImage.set方法代码示例

本文整理汇总了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());
}
 
开发者ID:arisona,项目名称:ether,代码行数:20,代码来源:GLFWWindow.java

示例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);
}
 
开发者ID:oreonengine,项目名称:Lwjgl3-Game-Engine-Programming-Series,代码行数:32,代码来源:Window.java

示例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();
}
 
开发者ID:mattgd,项目名称:Laser-Amazer,代码行数:15,代码来源:Window.java

示例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);
}
 
开发者ID:oreonengine,项目名称:oreon-engine,代码行数:14,代码来源:Window.java


注:本文中的org.lwjgl.glfw.GLFWImage.set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。