This post introduces how to drawing opengl on the mfc dialog.
If we are using COpenGLControl class, this work is very easy and simple.
Fi rstly, get the COpenGLControl class in the web or on this.
1. In the ~Dlg.h, Add header file and member variable
#include "OpenGLControl.h"
~
COpenGLControl m_oglWindow;
2. Add below source code in the OnInitDialog() function.
CRect rect;
// Get size and position of the template textfield we created before in the dialog editor
GetDlgItem(IDC_PIC_OPENGL)->GetWindowRect(rect);
// Convert screen coordinates to client coordinates
ScreenToClient(rect);
// Create OpenGL Control window
m_oglWindow.oglCreate(rect, this);
// Setup the OpenGL Window's timer to render
m_oglWindow.m_unpTimer = m_oglWindow.SetTimer(1, 1, 0);
* You have to set picture box option as "Visible is False".
The source code is here.
8/20/2012
source code - OpenGL Drawing on MFC dlg(using COpenGLControl class)
Subscribe to:
Post Comments (Atom)
-
Logistic Classifier The logistic classifier is similar to equation of the plane. W is weight vector, X is input vector and y is output...
-
AMD GPU Programming Primer Threads · Waves · Memory · Tile Distribution · Vector Loads · MFMA ...
-
Python · Language def append_to(item, target=[]) looks like it starts from an empty list every time. It does not. One list is cr...
-
Created Date : 2009.10. Language : C++ Tool : Visual Studio C++ 2008 Library & Utilized : Point Grey-FlyCapture, Triclops, OpenCV...
-
This is data acquisition source code of LMS511(SICK co.) Source code is made by MFC(vs 2008). The sensor is communicated by TCP/IP. ...
-
C · Python · Linking Two acronyms one letter apart, describing promises made at two different moments. An API is what you agree t...
-
C · Preprocessor C forgets the name of every field the moment it finishes compiling. The X-macro is how a C programmer gets those...
-
π FREE License Plate Recognition API - No Credit Card Required! Want to try ANPR (Automatic Number Plate Recognition) / ALPR (Automatic L...
-
code 1 pip install imgaug . import os import cv2 import imgaug.augmenters as iaa def load_image ( image_path ): return cv2 .imrea...
-
Image size of origin is 320*240. Processing time is 30.96 second took. The result of stitching The resul...
No comments:
Post a Comment