1
General / Re: The created OpenGL context does not fully meet the settings that were requested
« Last post by Hapax on February 01, 2023, 05:29:26 pm »If it is crashing, can you tell us at which point in the code that it stops?
As an aside, it's worth noting that GLclampf is clamped to 0-1 range so checking to see if it's higher that 1 doesn't make sense.
If you do need to 'go over' so you can cycle, use a float (or a GLfloat). Also, it is a bit simpler to just add the value every time and then check if it's over 1 and drop it if it is (again, still using a non-clamped float).
e.g.
As an aside, it's worth noting that GLclampf is clamped to 0-1 range so checking to see if it's higher that 1 doesn't make sense.
If you do need to 'go over' so you can cycle, use a float (or a GLfloat). Also, it is a bit simpler to just add the value every time and then check if it's over 1 and drop it if it is (again, still using a non-clamped float).
e.g.
static float color{ 0.f };
color += 1.f / 256.f;
if (color > 1.f)
color = 0.f;
color += 1.f / 256.f;
if (color > 1.f)
color = 0.f;