Board index » cppbuilder » OpenGL: how to render on 2 different DCs?

OpenGL: how to render on 2 different DCs?

Hello,

    I am trying to render onto 2 different panels that exist on the same
form, but it is not working. Neither one of them renders at all.

    I would like to know what should I do to setup and render on 2
different panels that are placed on the same form!

    TIA!
    Tulius Lima

 

Re:OpenGL: how to render on 2 different DCs?


wglMakeCurrent
Quote
Tulius Lima wrote:
> Hello,

>     I am trying to render onto 2 different panels that exist on the same
> form, but it is not working. Neither one of them renders at all.

>     I would like to know what should I do to setup and render on 2
> different panels that are placed on the same form!

>     TIA!
>     Tulius Lima

Re:OpenGL: how to render on 2 different DCs?


There is only one current rendering context per thread in your
program. So you will need to use wglMakeCurrent to alternate
the DC which drawing commands affect (unless you are using
multithreading). If you were able to get a single panel to work
you should be able to work this out.

I have made a very simple GL panel component which
manages the rendering context for you. You can use multiple
instances of the component on a form. It is available free from
my website.

Arnold the Aardvark
===========================
http://www.foxholly.demon.co.uk
ICQ# 30592054

Other Threads