|
-
November 26th, 2004, 03:14 AM
#1
OpenGL in a SDI
can anyone provide me some simple source code on how to initialize OpenGL in a SDI view (and draw 1 line ) ?
Thanks!
-
November 26th, 2004, 04:37 AM
#2
Re: OpenGL in a SDI
Well, the procedure is always equal everywhere you are...
First you you must create the device context, with CClienDC *m_pDC to CView:
--
private:
ClientDC *m_pDC;
--
When the app starts:
CView::Init...()
{
m_pDC = new CClientDC(this); //create DC
//now set pixel format, create rendering context and init OpenGL
//After you can create a timer and set itself for rendering functions such this:
SetTimer(IDC_TIMER_RENDERING, 10, NULL);
}
//and set your draw function in timer function:
..OnTimer()
{
DrawMyGL();
}
//don't forget to detere the rendering context and release DC before exit...
Bye
Last edited by Elementer; June 27th, 2005 at 05:51 AM.
-
November 26th, 2004, 05:38 PM
#3
Re: OpenGL in a SDI
thanks.. I'm new to OpenGL . I'll try it!
-
December 10th, 2004, 11:37 PM
#4
Re: OpenGL in a SDI
I found the tutorials at http://nehe.gamedev.net/ to be particularly helpful in using OpenGL with the Win32 API. However, IIRC, there weren't any MFC-specific tutorials there. You might find the examples at http://pws.prserv.net/mfcogl/ to be helpful in that regard.
-
December 11th, 2004, 03:11 AM
#5
Re: OpenGL in a SDI
Help me help you ... rate this article if any good!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|