Correct frag shader when using texture + color
This commit is contained in:
@ -32,7 +32,7 @@ public class ObjectGl {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a rectangle shape
|
||||
* Create a rectangle shape, use setTextureWrap to correctly align the texture with the model
|
||||
* @param z depth of your model the larger it is the more it will be "close" to the camera
|
||||
* @param h height of the rectangle
|
||||
* @param w width of the rectangle
|
||||
@ -112,6 +112,7 @@ public class ObjectGl {
|
||||
}
|
||||
|
||||
public void setTextureWrap(float x, float y, float w, float h){
|
||||
// TODO set sticky property
|
||||
this.vertexArray.swapVertexBufferObject(Primitive.createRectangle(this.zPos, w, h));
|
||||
int texWidth = this.texture.getWidth();
|
||||
int texHeight = this.texture.getHeight();
|
||||
@ -128,7 +129,7 @@ public class ObjectGl {
|
||||
this.setTextureWrap(result);
|
||||
}
|
||||
|
||||
public void setTextureWrap(float[] texture){
|
||||
private void setTextureWrap(float[] texture){
|
||||
this.vertexArray.swapTextureBufferObject(texture);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user