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

Author Topic: CreateContext/OpenGL question  (Read 2257 times)

0 Members and 1 Guest are viewing this topic.

slotdev

  • Sr. Member
  • ****
  • Posts: 385
    • View Profile
CreateContext/OpenGL question
« on: April 08, 2015, 10:18:24 am »
Hi,

A bit of an odd question about OpenGL contexts from a developer I work with, can someone help?

"In some cases CreateContext() returns handles like 0x1000 but sometimes they are 0x2000. I do not understand what this means... is 0x2000 secondary contexts?!  - means any DC but the first digit - number of contexts created for this DC? so 0x3000(X) - the third context ...and so on...."

Many Thanks
Ed
SFML 2.1

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: CreateContext/OpenGL question
« Reply #1 on: April 08, 2015, 10:27:18 am »
As far as I can tell, they don't have any documented meaning. According to Microsoft documentation wglCreateContext() returns a non-NULL HGLRC on success. HANDLEs are really just numbers that identify resources within the current process. They aren't supposed to have any meaning. The only constraints that have to hold are that 2 contexts which are not the same are not allowed to have equal HGLRCs and that HGLRCs that identify valid contexts must not be equal to NULL.

And, now I am just itching to ask: What does this have to do with SFML exactly? ::) You would have been better off asking this on the MSDN forums, StackOverflow, gamedev.net, or any other place that has more specialists than the SFML forum.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

slotdev

  • Sr. Member
  • ****
  • Posts: 385
    • View Profile
Re: CreateContext/OpenGL question
« Reply #2 on: April 08, 2015, 04:22:16 pm »
Thanks for the answer :)

What does it have to do with SFML? Well, we use it all the time in our projects and the developer who wanted to know is writing a system that can overlays graphics on the game from an external process. He was having some "fun" with device contexts and stuff on various old hardware we have to support...

Also SFML forums are full of people with good knowledge, so makes sense to ask here first ;)
SFML 2.1