本文整理汇总了Java中org.lwjgl.opengl.GL12.GL_CLAMP_TO_EDGE属性的典型用法代码示例。如果您正苦于以下问题:Java GL12.GL_CLAMP_TO_EDGE属性的具体用法?Java GL12.GL_CLAMP_TO_EDGE怎么用?Java GL12.GL_CLAMP_TO_EDGE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.lwjgl.opengl.GL12
的用法示例。
在下文中一共展示了GL12.GL_CLAMP_TO_EDGE属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setTextureParams
private void setTextureParams(){
int filterType = nearestFiltering ? GL11.GL_NEAREST : GL11.GL_LINEAR;
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, filterType);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, filterType);
int wrapType = clampEdges ? GL12.GL_CLAMP_TO_EDGE : GL11.GL_REPEAT;
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, wrapType);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, wrapType);
}
示例2: onLoad
@Override
protected Texture onLoad(JSONObject src) throws Exception
{
Asset<Bitmap> bitmap = this.assets.getAsset("bitmap", this.getString(src, "bitmap"));
String minMagFilterKey = this.getString(src, "minMagFilter");
String wrapModeKey = this.getString(src, "wrapMode");
int minMagFilter;
if ("nearest".equals(minMagFilterKey))
{
minMagFilter = GL11.GL_NEAREST;
}
else if ("linear".equals(minMagFilterKey))
{
minMagFilter = GL11.GL_LINEAR;
}
else
{
throw new IllegalArgumentException("could not find valid value for parameter '" + "minMagFilter" + "'");
}
int wrapMode;
if ("clamp_edge".equals(wrapModeKey))
{
wrapMode = GL12.GL_CLAMP_TO_EDGE;
}
else
{
throw new IllegalArgumentException("could not find valid value for parameter '" + "wrapMode" + "'");
}
return new Texture(bitmap.get(), minMagFilter, wrapMode);
}
示例3: setTextureParams
private void setTextureParams() {
int filterType = nearestFiltering ? GL11.GL_NEAREST : GL11.GL_LINEAR;
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, filterType);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, filterType);
int wrapType = clampEdges ? GL12.GL_CLAMP_TO_EDGE : GL11.GL_REPEAT;
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, wrapType);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, wrapType);
}
示例4: Texture
public Texture(int w, int h, int fillColour) {
this(w, h, fillColour, GL11.GL_LINEAR, GL11.GL_NEAREST, GL12.GL_CLAMP_TO_EDGE);
}