texture logging
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2024-08-28 22:37:35 -04:00
parent 562541d6d3
commit 2b706a231a

View File

@ -143,8 +143,10 @@ public class Texture {
* @param path The path to the image file * @param path The path to the image file
*/ */
public Texture(OpenGLState openGlState, String path){ public Texture(OpenGLState openGlState, String path){
LoggerInterface.loggerRenderer.DEBUG("Create texture " + path);
this.path = path; this.path = path;
if(!Globals.HEADLESS){ if(!Globals.HEADLESS){
LoggerInterface.loggerRenderer.DEBUG("Setup texture object");
//generate the texture object on gpu //generate the texture object on gpu
this.texturePointer = glGenTextures(); this.texturePointer = glGenTextures();
//bind the new texture //bind the new texture
@ -157,6 +159,8 @@ public class Texture {
//set magnification and minification operation sampling strategies //set magnification and minification operation sampling strategies
this.setMinFilter(openGlState, GL_LINEAR); this.setMinFilter(openGlState, GL_LINEAR);
this.setMagFilter(openGlState, GL_LINEAR); this.setMagFilter(openGlState, GL_LINEAR);
LoggerInterface.loggerRenderer.DEBUG("Create texture data buffers");
//load the image here //load the image here
ByteBuffer data; ByteBuffer data;
width = 1; width = 1;
@ -218,10 +222,13 @@ public class Texture {
data.put((byte)0); data.put((byte)0);
} }
data.flip(); data.flip();
//call if width != height so opengl figures out how to unpack it properly //call if width != height so opengl figures out how to unpack it properly
if(width != height){ if(width != height){
glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
} }
LoggerInterface.loggerRenderer.DEBUG("Upload texture buffer");
//buffer the texture information //buffer the texture information
if(hasTransparency){ if(hasTransparency){
this.pixelFormat = GL_RGBA; this.pixelFormat = GL_RGBA;