Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: GL_INVALID_VALUE generated from glClearColor()?  (Read 4583 times)

0 Members and 1 Guest are viewing this topic.

MrDoomMaster

  • Newbie
  • *
  • Posts: 26
    • View Profile
GL_INVALID_VALUE generated from glClearColor()?
« 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.

Aszarsha

  • Full Member
  • ***
  • Posts: 200
    • MSN Messenger - aszarsha@gmail.com
    • View Profile
GL_INVALID_VALUE generated from glClearColor()?
« Reply #1 on: January 28, 2008, 07:47:50 pm »
Never hapened to me. Do you have a minimal code that show the behavior ?

MrDoomMaster

  • Newbie
  • *
  • Posts: 26
    • View Profile
GL_INVALID_VALUE generated from glClearColor()?
« Reply #2 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;
}

MrDoomMaster

  • Newbie
  • *
  • Posts: 26
    • View Profile
GL_INVALID_VALUE generated from glClearColor()?
« Reply #3 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.

Aszarsha

  • Full Member
  • ***
  • Posts: 200
    • MSN Messenger - aszarsha@gmail.com
    • View Profile
GL_INVALID_VALUE generated from glClearColor()?
« Reply #4 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

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
GL_INVALID_VALUE generated from glClearColor()?
« Reply #5 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:
Laurent Gomila - SFML developer

mayday556

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: GL_INVALID_VALUE generated from glClearColor()?
« Reply #6 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

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: GL_INVALID_VALUE generated from glClearColor()?
« Reply #7 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.  ;)
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

mayday556

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: GL_INVALID_VALUE generated from glClearColor()?
« Reply #8 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

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: GL_INVALID_VALUE generated from glClearColor()?
« Reply #9 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.
Laurent Gomila - SFML developer