SFML community forums

Help => Graphics => Topic started by: MrDoomMaster on January 28, 2008, 07:38:06 pm

Title: GL_INVALID_VALUE generated from glClearColor()?
Post by: MrDoomMaster on January 28, 2008, 07:38:06 pm
Hi,

RenderWindow::Display() eventually leads to glClearColor() being called at line 234 in RenderWindow.cpp. the member RenderWindow::myBackgroundColor is:

50,50,50,255

This is a very weird issue and I'm not sure why it would be throwing this error. The values look valid to me.
Title: GL_INVALID_VALUE generated from glClearColor()?
Post by: Aszarsha on January 28, 2008, 07:47:50 pm
Never hapened to me. Do you have a minimal code that show the behavior ?
Title: GL_INVALID_VALUE generated from glClearColor()?
Post by: MrDoomMaster on January 28, 2008, 07:50:13 pm
Quote from: "Aszarsha"
Never hapened to me. Do you have a minimal code that show the behavior ?


First note that I edited my original post to omit the timing weirdness. The issue occurs 100% of the time.

Below is the code for my main loop. It's pretty simple. Let me know if there's anything else I can show you.
Code: [Select]

int main()
{
sf::RenderWindow gameWindow( sf::VideoMode( 800, 600 ), "rocket_test" );
gameWindow.SetBackgroundColor( sf::Color( 50, 50, 50 ) );

Game game( gameWindow.GetWidth(), gameWindow.GetHeight() );

for(;;)
{
if( ProcessEvents( gameWindow ) )
{
break;
}

game.Tick();
game.Draw();

gameWindow.Display();
}

return 0;
}
Title: GL_INVALID_VALUE generated from glClearColor()?
Post by: MrDoomMaster on January 28, 2008, 07:57:45 pm
I figured out the issue. It's too embarrassingly obvious so I'm not going to say what it was lol.

This was not SFML's fault.
Title: GL_INVALID_VALUE generated from glClearColor()?
Post by: Aszarsha on January 28, 2008, 08:19:05 pm
Quote from: "MrDoomMaster"
It's too embarrassingly obvious so I'm not going to say what it was lol.
Héhéhé :P
Title: GL_INVALID_VALUE generated from glClearColor()?
Post by: Laurent on January 29, 2008, 02:32:53 am
Quote
I figured out the issue. It's too embarrassingly obvious so I'm not going to say what it was lol.

No way... we want to know :lol:
Title: Re: GL_INVALID_VALUE generated from glClearColor()?
Post by: mayday556 on June 11, 2014, 06:33:12 am
I figured out the issue. It's too embarrassingly obvious so I'm not going to say what it was lol.

This was not SFML's fault.

Im having the same problem... can ya please tell me what is causing this, it's been bugging me for nearly a month now and it's threatening a deletion of one of my projects
Title: Re: GL_INVALID_VALUE generated from glClearColor()?
Post by: zsbzsb on June 11, 2014, 01:26:53 pm
Im having the same problem... can ya please tell me what is causing this, it's been bugging me for nearly a month now and it's threatening a deletion of one of my projects

Do you realize you just bumped a 6+ year old thread? The OP hasn't even logged in for 6 years also. You should really start a new thread and post a complete and minimal example there.  ;)
Title: Re: GL_INVALID_VALUE generated from glClearColor()?
Post by: mayday556 on June 11, 2014, 07:26:12 pm
Do you realize you just bumped a 6+ year old thread? The OP hasn't even logged in for 6 years also. You should really start a new thread and post a complete and minimal example there.  ;)

Sorry, I just figured it out anyways... I just tried some really heavy debugging for 8 hours straight and finally figured it out... I forgot to divide a number by 2
Title: Re: GL_INVALID_VALUE generated from glClearColor()?
Post by: Laurent on June 11, 2014, 07:59:00 pm
Can you show how not dividing a number by 2 can lead to this OpenGL error in glClearColor? I'm really curious.