Login
Username:

Password:

Remember me



Lost Password?

Register now!
Sections
Who's Online
47 user(s) are online (41 user(s) are browsing Forums)

Members: 1
Guests: 46

K-L, more...
Support us!
Recent OS4 Files
OS4Depot.net
Report message:*
 

Re: The MiniGL thread

Subject: Re: The MiniGL thread
by Raziel on 2019/3/26 9:03:37

@Daniel

I can only find one line and that is already exactly like you posted
Quote:

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);


Here is the whole part of the code
OpenGLTexture::OpenGLTexture(const Graphics::Surface *surface) {
    
width surface->w;
    
height surface->h;
    
format surface->format;

    
// Pad the textures if non power of two support is unavailable
    
if (OpenGLContext.NPOTSupported) {
        
internalHeight height;
        
internalWidth width;
    } else {
        
internalHeight upperPowerOfTwo(height);
        
internalWidth upperPowerOfTwo(width);
    }

    if (
format.bytesPerPixel == 4) {
        
assert(surface->format == getRGBAPixelFormat());

        
internalFormat GL_RGBA;
        
sourceFormat GL_UNSIGNED_BYTE;
    } else if (
format.bytesPerPixel == 2) {
        
internalFormat GL_RGB;
        
sourceFormat GL_UNSIGNED_SHORT_5_6_5;
    } else
        
error("Unknown pixel format");

    
glGenTextures(1, &id);
    
glBindTexture(GL_TEXTURE_2Did);
    
glTexImage2D(GL_TEXTURE_2D0internalFormatinternalWidthinternalHeight0internalFormatsourceFormat0);
    
glTexParameteri(GL_TEXTURE_2DGL_TEXTURE_MIN_FILTERGL_LINEAR);
    
glTexParameteri(GL_TEXTURE_2DGL_TEXTURE_MAG_FILTERGL_LINEAR);

    
// TODO: If non power of two textures are unavailable this clamping
    // has no effect on the padded sides (resulting in white lines on the edges)
    
glTexParameteri(GL_TEXTURE_2DGL_TEXTURE_WRAP_SGL_CLAMP_TO_EDGE);
    
glTexParameteri(GL_TEXTURE_2DGL_TEXTURE_WRAP_TGL_CLAMP_TO_EDGE);
    
    
update(surface);

}


That "non power of two" comments are regarding to not available ARB shaders, i believe?
Because i get this on start of the game:
Quote:

Initializing OpenGL Renderer
WARNING: GL_ARB_texture_non_power_of_two is not available.!

Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project