0

In my application, it crashes when I try to create wglCreateContextAttribsARB for the 128th time. It is always the 128th time, I always pass the same arguments, and it always returns 0x2095(ERROR_INVALID_VERSION_ARB). I know that it is a valid version, due to the fact that it works the first 127 times.

Is there any reason for this function call failing at this specific number?

Programmdude
  • 533
  • 5
  • 22
  • Since this happens for a repeatedly allocated then deallocated resource you've dicovered a driver bug. Please report it to the vendor. Add your test program for validation. – datenwolf Mar 16 '12 at 11:42

1 Answers1

3

I'd bet on driver limitation, aka a bug.

That said, ask yourself why you need so many calls to the context creation function. A typical application uses 1. Many applications use 1 per window. What are you trying to do that requires 128 contexts?

Bahbar
  • 16,994
  • 38
  • 60
  • This was more a curiosity then a need to solve it. I was re-creating the game window over and over to check for memory leaks and all that. – Programmdude Mar 16 '12 at 07:43
  • That's one thing that wasn't clear in your question. From your comment it sounds like you're deleting your context before re-creating a new one. If that's the case it's more serious, and I'd agree with @datenwolf that you should report a defect to the vendor. It can be an issue with long-lived apps... – Bahbar Mar 17 '12 at 19:41
  • I will test it on another computer's graphics card. I am using ATI, so I will see if I can borrow one of my friends NVidia ones. Then I will simplify the program as much as possible, double check that I am deleting the context, etc. If this all checks out I will see about posting this bug on the ATI forums. – Programmdude Mar 18 '12 at 07:50