🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.tools.mfc
Article #61

MfcOgl to get multiple OpenGL contexts

#61
From: Chuck L. Peterson
Date: Thu, 29 Feb 1996 06:36
27 lines
1407 bytes
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
Technical Details
Message-ID: <3135497E.2AE@alumni.cse.ucsc.edu>
Path: arc1-ca.pugleaf.net!darkstar.UCSC.EDU!usenet

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!darkstar.UCSC.EDU!usenet
From: "Chuck L. Peterson" <clp@alumni.cse.ucsc.edu>
Newsgroups: comp.os.ms-windows.programmer.tools.mfc,comp.lang.c++,comp.graphics.api.opengl
Subject: MfcOgl to get multiple OpenGL contexts
Date: Wed, 28 Feb 1996 22:36:46 -0800
Organization: Multi-Trek Control Center
Message-ID: <3135497E.2AE@alumni.cse.ucsc.edu>
NNTP-Posting-Host: 204.160.104.18
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 2.0GoldB1 (Win95; I)