Article View: comp.os.ms-windows.programmer.tools.mfc
Article #65Re: MfcOgl to get multiple OpenGL contexts
From: Dale Rogerson
Date: Sat, 02 Mar 1996 01:25
Date: Sat, 02 Mar 1996 01:25
51 lines
2122 bytes
2122 bytes
In article <3135497E.2AE@alumni.cse.ucsc.edu>, clp@alumni.cse.ucsc.edu
says...
>
>I've been using the CMfcOglView class provided with the
>Microsoft MFCOGL with great success.
>
>But now I want to create 2 or 3 OpenGL context regions
>all within the same Window. How would I go about doing this?
>
>This routine goes right into setting up the OpenGL context
>without even giving me a chance to specify/setup other windows:
>
>void CMfcOglView::Init()
>{
> PIXELFORMATDESCRIPTOR pfd;
> int n;
> HGLRC hrc;
> m_pDC = new CClientDC(this);
> if (!bSetupPixelFormat())
> return;
> n = ::GetPixelFormat(m_pDC->GetSafeHdc());
> ::DescribePixelFormat(m_pDC->GetSafeHdc(), n, sizeof(pfd), &pfd);
> CreateRGBPalette();
>
> // create a rendering context and make it current
> hrc = wglCreateContext(m_pDC->GetSafeHdc());
> wglMakeCurrent(m_pDC->GetSafeHdc(), hrc);
>
>Any help would be greatly appreciated.
>clp@alumni.cse.ucsc.edu
The MSDN article "OpenGL III: Building an OpenGL C++ Class" presents a
different method for handling multiple OpenGL contexts.
If you don't have a subscription to MSDN, you can view the article at the
following location:
http://www.microsoft.com/MSDN/LIBRARY/TECHNOTE
There are other articles about OpenGL in the same location.
The source code was written for Visual C++ version 2.0 and may need to be
tweaked for Visual C++ version 4.0.
Dale Rogerson
Microsoft
--
The opinions expressed in this message are my own personal views
and do not reflect the official views of Microsoft Corporation.
Technical Details
Message-ID:
<4h881e$7r9@news.microsoft.com>Path:
arc1-ca.pugleaf.net!news.microsoft.com!newsReferences:
<3135497E.2AE@alumni.cse.ucsc.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!news.microsoft.com!news From: dalero@microsoft.com (Dale Rogerson) Newsgroups: comp.os.ms-windows.programmer.tools.mfc,comp.lang.c++,comp.graphics.api.opengl Subject: Re: MfcOgl to get multiple OpenGL contexts Date: 2 Mar 1996 01:25:02 GMT Organization: Microsoft Corporation Message-ID: <4h881e$7r9@news.microsoft.com> References: <3135497E.2AE@alumni.cse.ucsc.edu> NNTP-Posting-Host: 157.55.73.6 Mime-Version: 1.0 X-Newsreader: WinVN 0.93.14