Click here to Skip to main content
14,667,394 members
Home » Discussions » C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: problem with compiler Pin
Jochen Arndt31-Mar-16 0:51
professionalJochen Arndt31-Mar-16 0:51 
Questionproblem with compiler Pin
Ngoc Linh Nguyen29-Mar-16 20:52
MemberNgoc Linh Nguyen29-Mar-16 20:52 
QuestionInitDialog in splitter Pin
Member 1228273828-Mar-16 10:07
MemberMember 1228273828-Mar-16 10:07 
QuestionRe: InitDialog in splitter Pin
Richard MacCutchan28-Mar-16 21:46
mveRichard MacCutchan28-Mar-16 21:46 
AnswerRe: InitDialog in splitter Pin
Victor Nijegorodov29-Mar-16 2:20
MemberVictor Nijegorodov29-Mar-16 2:20 
GeneralRe: InitDialog in splitter Pin
Member 1228273829-Mar-16 3:04
MemberMember 1228273829-Mar-16 3:04 
GeneralRe: InitDialog in splitter Pin
Richard MacCutchan29-Mar-16 4:23
mveRichard MacCutchan29-Mar-16 4:23 
GeneralRe: InitDialog in splitter Pin
Member 1228273829-Mar-16 7:12
MemberMember 1228273829-Mar-16 7:12 
Richard,

The function that I am trying to get to execute is COpenGLControl::oglInitialize() which was called in OnInitDialog in the example template I am following. the oglInitialize function, listed below should setup the OpenGL context. But my case is somewhat different as you can see from my most recent post and I don't know where to place the call to oglInitalize()

void COpenGLControl::oglInitialize()
{
	// Initial Setup:
	//
	static PIXELFORMATDESCRIPTOR pfd =
	{
		sizeof(PIXELFORMATDESCRIPTOR),
		1,
		PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER,
		PFD_TYPE_RGBA,
		32,    // bit depth
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
		16,    // z-buffer depth
		0, 0, 0, 0, 0, 0, 0,
	};

	// Get device context only once.
	hdc = GetDC()->m_hDC;

	// Pixel format.
	m_nPixelFormat = ChoosePixelFormat(hdc, &pfd);
	SetPixelFormat(hdc, m_nPixelFormat, &pfd);

	// Create the OpenGL Rendering Context.
	hrc = wglCreateContext(hdc);
	wglMakeCurrent(hdc, hrc);

	// Basic Setup:
	//
	// Set color to use when clearing the background.
	glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
	glClearDepth(1.0f);

	// Turn on backface culling
	glFrontFace(GL_CCW);
	glCullFace(GL_BACK);

	// Turn on depth testing
	glEnable(GL_DEPTH_TEST);
	glDepthFunc(GL_LEQUAL);

	// Send draw request
	OnDraw(NULL);
}


In that example template I have three classes CMFCOpenGLDlg : public CDialogEx COpenGLControl : public CWnd and CMFCOpenGLApp : public CWinApp in this example the CMFCOpenGLDlg::OnInitDialog() function calls COpenGLControl::oglCreate() and COpenGLControl::OnCreate() calls COpenGLControl::oglInitialize() but I just don't see how to wire this up in my splitt form example where the panes are created from the splitter class.

Thanks,

John

...

// Create OpenGL Control window
m_oglWindow.oglCreate(rect, this);
GeneralRe: InitDialog in splitter Pin
Richard MacCutchan29-Mar-16 7:19
mveRichard MacCutchan29-Mar-16 7:19 
GeneralRe: InitDialog in splitter Pin
Member 1228273829-Mar-16 10:41
MemberMember 1228273829-Mar-16 10:41 
GeneralRe: InitDialog in splitter Pin
David Crow29-Mar-16 14:49
MemberDavid Crow29-Mar-16 14:49 
GeneralRe: InitDialog in splitter Pin
Victor Nijegorodov30-Mar-16 5:09
MemberVictor Nijegorodov30-Mar-16 5:09 
SuggestionRe: InitDialog in splitter Pin
David Crow29-Mar-16 9:11
MemberDavid Crow29-Mar-16 9:11 
Questionarduino sensor Pin
Member 1240312128-Mar-16 7:35
MemberMember 1240312128-Mar-16 7:35 
AnswerRe: arduino sensor Pin
David Crow28-Mar-16 9:40
MemberDavid Crow28-Mar-16 9:40 
AnswerRe: arduino sensor Pin
Richard MacCutchan28-Mar-16 21:44
mveRichard MacCutchan28-Mar-16 21:44 
GeneralRe: arduino sensor Pin
Sascha Lefèvre28-Mar-16 23:31
professionalSascha Lefèvre28-Mar-16 23:31 
GeneralRe: arduino sensor Pin
Member 1240312130-Mar-16 23:19
MemberMember 1240312130-Mar-16 23:19 
GeneralRe: arduino sensor Pin
leon de boer3-Apr-16 6:43
Memberleon de boer3-Apr-16 6:43 
QuestionCOleDateTime Pin
Still learning how to code27-Mar-16 9:48
MemberStill learning how to code27-Mar-16 9:48 
AnswerRe: COleDateTime Pin
Serkan Onat27-Mar-16 12:44
professionalSerkan Onat27-Mar-16 12:44 
GeneralRe: COleDateTime Pin
Still learning how to code27-Mar-16 22:11
MemberStill learning how to code27-Mar-16 22:11 
GeneralRe: COleDateTime Pin
Jochen Arndt28-Mar-16 1:50
professionalJochen Arndt28-Mar-16 1:50 
GeneralRe: COleDateTime Pin
Still learning how to code28-Mar-16 22:58
MemberStill learning how to code28-Mar-16 22:58 
GeneralRe: COleDateTime Pin
Jochen Arndt28-Mar-16 23:08
professionalJochen Arndt28-Mar-16 23:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.