texture logging
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
This commit is contained in:
parent
562541d6d3
commit
2b706a231a
@ -143,8 +143,10 @@ public class Texture {
|
||||
* @param path The path to the image file
|
||||
*/
|
||||
public Texture(OpenGLState openGlState, String path){
|
||||
LoggerInterface.loggerRenderer.DEBUG("Create texture " + path);
|
||||
this.path = path;
|
||||
if(!Globals.HEADLESS){
|
||||
LoggerInterface.loggerRenderer.DEBUG("Setup texture object");
|
||||
//generate the texture object on gpu
|
||||
this.texturePointer = glGenTextures();
|
||||
//bind the new texture
|
||||
@ -157,6 +159,8 @@ public class Texture {
|
||||
//set magnification and minification operation sampling strategies
|
||||
this.setMinFilter(openGlState, GL_LINEAR);
|
||||
this.setMagFilter(openGlState, GL_LINEAR);
|
||||
|
||||
LoggerInterface.loggerRenderer.DEBUG("Create texture data buffers");
|
||||
//load the image here
|
||||
ByteBuffer data;
|
||||
width = 1;
|
||||
@ -218,10 +222,13 @@ public class Texture {
|
||||
data.put((byte)0);
|
||||
}
|
||||
data.flip();
|
||||
|
||||
//call if width != height so opengl figures out how to unpack it properly
|
||||
if(width != height){
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
}
|
||||
|
||||
LoggerInterface.loggerRenderer.DEBUG("Upload texture buffer");
|
||||
//buffer the texture information
|
||||
if(hasTransparency){
|
||||
this.pixelFormat = GL_RGBA;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user