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


Java GL33类代码示例

本文整理汇总了Java中org.lwjgl.opengl.GL33的典型用法代码示例。如果您正苦于以下问题:Java GL33类的具体用法?Java GL33怎么用?Java GL33使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


GL33类属于org.lwjgl.opengl包,在下文中一共展示了GL33类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: load

import org.lwjgl.opengl.GL33; //导入依赖的package包/类
private void load(ByteBuffer pixels) {
	int target = GL11.GL_TEXTURE_2D;
	int type = TYPE_MAP[getComponentType().ordinal()];
	int internalFormat = INTERNAL_FORMAT_MAP[getComponentType().ordinal()][getComponentFormat().ordinal()];
	int format = FORMAT_MAP[getComponentFormat().ordinal()];

	switch (getComponentFormat()) {
	case G:
		GL11.glTexParameteri(target, GL33.GL_TEXTURE_SWIZZLE_R, GL11.GL_RED);
		GL11.glTexParameteri(target, GL33.GL_TEXTURE_SWIZZLE_G, GL11.GL_RED);
		GL11.glTexParameteri(target, GL33.GL_TEXTURE_SWIZZLE_B, GL11.GL_RED);
		break;
	case GA:
		GL11.glTexParameteri(target, GL33.GL_TEXTURE_SWIZZLE_R, GL11.GL_RED);
		GL11.glTexParameteri(target, GL33.GL_TEXTURE_SWIZZLE_G, GL11.GL_RED);
		GL11.glTexParameteri(target, GL33.GL_TEXTURE_SWIZZLE_B, GL11.GL_RED);
		GL11.glTexParameteri(target, GL33.GL_TEXTURE_SWIZZLE_A, GL11.GL_GREEN);
		break;
	default:
	}
	GL11.glTexImage2D(target, 0, internalFormat, getWidth(), getHeight(), 0, format, type, pixels);
}
 
开发者ID:arisona,项目名称:ether,代码行数:23,代码来源:GLGPUImage.java

示例2: bind

import org.lwjgl.opengl.GL33; //导入依赖的package包/类
/**
 * Bind this attrib, automatically binds multiple attribs for more than 4 compnent objects
 * @param attrib The starting attrib
 * @return The ending attrib
 */
public int bind(int attrib) {
	int sizeNeeded = size;
	vbo.bind();
	for (int i = 0; i < requiredAttribs(); i++) {
		GL20.glEnableVertexAttribArray(attrib);
		GL20.glVertexAttribPointer(attrib, Math.min(sizeNeeded, 4), type, normalized, stride, offset + extraOffset * i);
		if (instanced)
			GL33.glVertexAttribDivisor(attrib, 1);
		attrib++;
		sizeNeeded -= 4;
	}
	vbo.unbind();
	return attrib;
}
 
开发者ID:warlockcodes,项目名称:Null-Engine,代码行数:20,代码来源:VertexAttribPointer.java

示例3: buildMapping

import org.lwjgl.opengl.GL33; //导入依赖的package包/类
private static void buildMapping() {
	if (mapping != null) return;
	Multimap<Integer, String> map = HashMultimap.create();
	List<Class<?>> classes = ImmutableList.of(
			GL11.class, GL12.class, GL13.class, GL14.class, GL15.class,
			GL20.class, GL21.class, GL30.class, GL31.class, GL32.class,
			GL33.class, GL40.class, GL41.class, GL42.class, GL43.class,
			GL44.class, GL45.class, GLFW.class
			);
	for (Class<?> clazz : classes) {
		for (Field f : clazz.getDeclaredFields()) {
			if (f.getName().toUpperCase(Locale.ROOT).equals(f.getName()) &&
					f.getType() == int.class && Modifier.isPublic(f.getModifiers()) && Modifier.isStatic(f.getModifiers())) {
				List<String> li = Splitter.on('_').splitToList(f.getName());
				li = li.subList(1, li.size());
				String clean =
					Joiner.on(' ').join(
						li.stream()
							.map(Errors::toTitleCase)
							.iterator());
				try {
					map.put(f.getInt(null), clean);
				} catch (Throwable t) {
					t.printStackTrace();
				}
			}
		}
	}
	mapping = map;
}
 
开发者ID:surgeplay,项目名称:Visage,代码行数:31,代码来源:Errors.java

示例4: addInstancedAttribute

import org.lwjgl.opengl.GL33; //导入依赖的package包/类
public void addInstancedAttribute(int vao, int vbo, int attribute, int dataSize, int instancedDataLength,
		int offset) {
	GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, vbo);
	GL30.glBindVertexArray(vao);
	GL20.glVertexAttribPointer(attribute, dataSize, GL11.GL_FLOAT, false, instancedDataLength * 4, offset * 4);
	GL33.glVertexAttribDivisor(attribute, 1);
	GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, 0);
	GL30.glBindVertexArray(0);
}
 
开发者ID:Radseq,项目名称:Mystic-Bastion,代码行数:10,代码来源:Loader.java

示例5: glVertexAttribDivisor

import org.lwjgl.opengl.GL33; //导入依赖的package包/类
public static void glVertexAttribDivisor(int index, int divisor) {
	if(GL_VERSION >= 33) {
		GL33.glVertexAttribDivisor(index, divisor);
	} else if(GLContext.getCapabilities().GL_ARB_instanced_arrays) {
		ARBInstancedArrays.glVertexAttribDivisorARB(index, divisor);
	} else {
		throw new UnsupportedOperationException("GL_ARB_instanced_arrays not supported on this system.");
	}
}
 
开发者ID:ra4king,项目名称:LWJGL-OpenGL-Utils,代码行数:10,代码来源:RenderUtils.java

示例6: glGenSampler

import org.lwjgl.opengl.GL33; //导入依赖的package包/类
public static int glGenSampler() throws GLException
{
	int ret = GL33.glGenSamplers();
	
	RenderHelper.checkForGLError();
	
	return ret;
}
 
开发者ID:Elusivehawk,项目名称:JCaelum,代码行数:9,代码来源:GL3.java

示例7: glGetFragDataIndex

import org.lwjgl.opengl.GL33; //导入依赖的package包/类
public static int glGetFragDataIndex(int program, String name) throws GLException
{
	int ret = GL33.glGetFragDataIndex(program, name);
	
	RenderHelper.checkForGLError();
	
	return ret;
}
 
开发者ID:Elusivehawk,项目名称:JCaelum,代码行数:9,代码来源:GL3.java

示例8: glGetQueryObjecti64

import org.lwjgl.opengl.GL33; //导入依赖的package包/类
public static long glGetQueryObjecti64(int id, int pname) throws GLException
{
	long ret = GL33.glGetQueryObjecti64(id, pname);
	
	RenderHelper.checkForGLError();
	
	return ret;
}
 
开发者ID:Elusivehawk,项目名称:JCaelum,代码行数:9,代码来源:GL3.java

示例9: glGetQueryObjectui64

import org.lwjgl.opengl.GL33; //导入依赖的package包/类
public static long glGetQueryObjectui64(int id, int pname) throws GLException
{
	long ret = GL33.glGetQueryObjectui64(id, pname);
	
	RenderHelper.checkForGLError();
	
	return ret;
}
 
开发者ID:Elusivehawk,项目名称:JCaelum,代码行数:9,代码来源:GL3.java

示例10: glGetSamplerParameterf

import org.lwjgl.opengl.GL33; //导入依赖的package包/类
public static float glGetSamplerParameterf(int sampler, int pname) throws GLException
{
	float ret = GL33.glGetSamplerParameterf(sampler, pname);
	
	RenderHelper.checkForGLError();
	
	return ret;
}
 
开发者ID:Elusivehawk,项目名称:JCaelum,代码行数:9,代码来源:GL3.java

示例11: glGetSamplerParameteri

import org.lwjgl.opengl.GL33; //导入依赖的package包/类
public static int glGetSamplerParameteri(int sampler, int pname) throws GLException
{
	int ret = GL33.glGetSamplerParameteri(sampler, pname);
	
	RenderHelper.checkForGLError();
	
	return ret;
}
 
开发者ID:Elusivehawk,项目名称:JCaelum,代码行数:9,代码来源:GL3.java

示例12: glGetSamplerParameterIi

import org.lwjgl.opengl.GL33; //导入依赖的package包/类
public static int glGetSamplerParameterIi(int sampler, int pname) throws GLException
{
	int ret = GL33.glGetSamplerParameterIi(sampler, pname);
	
	RenderHelper.checkForGLError();
	
	return ret;
}
 
开发者ID:Elusivehawk,项目名称:JCaelum,代码行数:9,代码来源:GL3.java

示例13: glGetSamplerParameterIui

import org.lwjgl.opengl.GL33; //导入依赖的package包/类
public static int glGetSamplerParameterIui(int sampler, int pname) throws GLException
{
	int ret = GL33.glGetSamplerParameterIui(sampler, pname);
	
	RenderHelper.checkForGLError();
	
	return ret;
}
 
开发者ID:Elusivehawk,项目名称:JCaelum,代码行数:9,代码来源:GL3.java

示例14: glGenSamplers

import org.lwjgl.opengl.GL33; //导入依赖的package包/类
@Override
public void glGenSamplers (int count, int[] samplers, int offset) {
	for(int i = offset; i < offset + count; i++) {
		samplers[i] = GL33.glGenSamplers();
	}
}
 
开发者ID:Arcnor,项目名称:gdx-backend-jglfw,代码行数:7,代码来源:JglfwGL30.java

示例15: glDeleteSamplers

import org.lwjgl.opengl.GL33; //导入依赖的package包/类
@Override
public void glDeleteSamplers (int count, int[] samplers, int offset) {
	for(int i = offset; i < offset + count; i++) {
		GL33.glDeleteSamplers(samplers[i]);
	}
}
 
开发者ID:Arcnor,项目名称:gdx-backend-jglfw,代码行数:7,代码来源:JglfwGL30.java


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