Login
Username:

Password:

Remember me



Lost Password?

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

Members: 1
Guests: 47

nbache, more...
Support us!
Recent OS4 Files
OS4Depot.net
Report message:*
 

Re: SDL2

Subject: Re: SDL2
by kas1e on 2018/12/19 18:22:53

@Capehill
Quote:

Did you try glGetError()?


Yeah, in q3's code/sdl/sdl_glimp.c , we have there GLimp_EndFrame() function which has at top SDL_GL_SwapWindow(). So i made that:

const charglGetErrorString(GLenum error)
{
    switch (
error)
    {
    case 
GL_NO_ERROR:          return "No Error";
    case 
GL_INVALID_ENUM:      return "Invalid Enum";
    case 
GL_INVALID_VALUE:     return "Invalid Value";
    case 
GL_INVALID_OPERATION: return "Invalid Operation";
    case 
GL_INVALID_FRAMEBUFFER_OPERATION: return "Invalid Framebuffer Operation";
    case 
GL_OUT_OF_MEMORY:     return "Out of Memory";
    case 
GL_STACK_UNDERFLOW:   return "Stack Underflow";
    case 
GL_STACK_OVERFLOW:    return "Stack Overflow";
    default:                   return 
"Unknown Error";
    }
}

void _glCheckError(const char *filenameint line)
{
    
GLenum err;
    while ((
err glGetError()) != GL_NO_ERROR)
        
printf("OpenGL Error: %s (%d) [%u] %s\n"filenamelineerrglGetErrorString(err));
}


#define glCheckError() _glCheckError(__FILE__, __LINE__)


And put at top of function, and after SDL_GL_SwapWindow glCheckError():

void GLimp_EndFramevoid )
{
    
glCheckError();
    
// don't flip if drawing to front buffer
    
if ( Q_stricmpr_drawBuffer->string"GL_FRONT" ) != )
    {
        
SDL_GL_SwapWindowSDL_window );
    }
    
glCheckError();

..
blablabl


And it prinfs nothing, like no errors.. Tried both modes and when window fits in wb size, and when didn't, no errors in both cases , just in oversized one black window.

Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project