Discussion:
Two threads, each creating one rendering contexts with same device context ?
(too old to reply)
Skybuck Flying
2010-07-24 07:28:33 UTC
Permalink
Hello,

Situation is as follows:

1. First thread gets/sets pixel format for DC (I didn't write that code and
hardly understand it) and creates opengl context with wglCreateContext.

2. First thread creates second thread.

3. Second thread when running tries to create another rendering context with
the same device context from the first thread... but this fails ?!?

The handle returned is zero ?!? Is this normal ? Or does the driver not
support it, or does opengl not support it or am I doing something wrong...
hmm...

Does the second thread have to do anything with pixel formats or the dc ?

Bye,
Skybuck.
Skybuck Flying
2010-07-24 07:52:43 UTC
Permalink
Maybe this can help:

http://www.opengl.org/registry/specs/ARB/wgl_create_context.txt

And going to read this:

http://developer.amd.com/gpu_assets/GL3_WhitePaper.pdf

Bye,
Skybuck.
Skybuck Flying
2010-07-24 07:57:12 UTC
Permalink
Post by Skybuck Flying
http://www.opengl.org/registry/specs/ARB/wgl_create_context.txt
http://developer.amd.com/gpu_assets/GL3_WhitePaper.pdf
Nope no multi-threading information in last document.

Bye,
Skybuck.
Skybuck Flying
2010-07-24 08:12:42 UTC
Permalink
Hmm seems like windows can't do what I want:

http://www.codeproject.com/KB/openGL/ogltools.aspx

At the bottom it says:

"
Please also note that under Windows, only one RC may be created for a given
window and this RC cannot be used for another window.
"

I want to create two... but apperently it's not possible ?

So maybe have to create a hidden window which would be quite weird...

I wonder if DirectX is any better for multi threading ?

Bye,
Skybuck.
Skybuck Flying
2010-07-24 08:18:43 UTC
Permalink
Maybe hidden window not necessary.

Maybe bitmaps can be created and provide additional dc's...

Bye,
Skybuck.

Loading...