Click here to Skip to main content
15,900,325 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Need To Create a crawler/spider in vc++ Pin
Ash_VCPP20-Feb-09 2:43
Ash_VCPP20-Feb-09 2:43 
QuestionNeed help on drawling line in OnPaint function Pin
John50218-Feb-09 19:59
John50218-Feb-09 19:59 
AnswerRe: Need help on drawling line in OnPaint function Pin
Cedric Moonen18-Feb-09 20:11
Cedric Moonen18-Feb-09 20:11 
GeneralRe: Need help on drawling line in OnPaint function Pin
John50218-Feb-09 20:45
John50218-Feb-09 20:45 
GeneralRe: Need help on drawling line in OnPaint function Pin
Cedric Moonen18-Feb-09 21:04
Cedric Moonen18-Feb-09 21:04 
GeneralRe: Need help on drawling line in OnPaint function Pin
John50218-Feb-09 22:25
John50218-Feb-09 22:25 
AnswerRe: Need help on drawling line in OnPaint function Pin
Iain Clarke, Warrior Programmer18-Feb-09 23:04
Iain Clarke, Warrior Programmer18-Feb-09 23:04 
QuestionOnMouseMove swap and clear problem Pin
Member 337533418-Feb-09 19:57
Member 337533418-Feb-09 19:57 
Hello,
i need help with this onMouseMove function... what i am doing here is drawing a line on the left and right side. On the left it;s all OpenGL AVI on the right i am calling my own function to draw the same lines as i move a mouse... however my problem is with MakeCurrent and clear screen here... because when i draw a line and rotate it ... there are bunch of lines all around. I don't know what i am doing wrong and where i need this swap buffer.... can someone please tell me how to get rid of those multiple lines when i move my mouse:

void CtestopenglView::OnMouseMove(UINT nFlags, CPoint point)
{
	// TODO: Add your message handler code here and/or call default
	wglMakeCurrent(m_hDC,m_hRC);
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
	glClear(GL_COLOR_BUFFER_BIT);
	::SwapBuffers(m_hDC);
	if(m_drawenabled)
	{ 
		m_start = point;
		glPushMatrix();
		glColor3f(0.0,0.0,0.0);
		DrawLine(m_start.x+300, m_start.y, m_end.x+300, m_end.y);

		glBegin(GL_LINES);
		glVertex3d(m_start.x, m_start.y,0);
		glVertex3d(m_end.x, m_end.y,0);
		glEnd();
		glPopMatrix();

		m_start = point;
		glPushMatrix();
		glColor3f(1.0,1.0,1.0);
		DrawLine(m_start.x+300, m_start.y, m_end.x+300, m_end.y);
		
		glBegin(GL_LINES);
		glVertex3d(m_start.x, m_start.y,0);
		glVertex3d(m_end.x, m_end.y,0);
		glEnd();
		glPopMatrix();
	}
	CView::OnMouseMove(nFlags, point);
	wglMakeCurrent(m_hDC,NULL);
	wglMakeCurrent(m_hDC,m_hRC);
	glFlush();
	::SwapBuffers(m_hDC);
}



thanks
AnswerRe: OnMouseMove swap and clear problem Pin
Stuart Dootson18-Feb-09 21:15
professionalStuart Dootson18-Feb-09 21:15 
GeneralRe: OnMouseMove swap and clear problem Pin
Member 337533419-Feb-09 1:56
Member 337533419-Feb-09 1:56 
AnswerRe: OnMouseMove swap and clear problem Pin
cmk19-Feb-09 20:12
cmk19-Feb-09 20:12 
Questionaccessing webcam using VC++ Pin
dhruw18-Feb-09 19:55
dhruw18-Feb-09 19:55 
AnswerRe: accessing webcam using VC++ Pin
_AnsHUMAN_ 18-Feb-09 20:34
_AnsHUMAN_ 18-Feb-09 20:34 
Questionhow to protect my process from being closed? Pin
tyr200018-Feb-09 19:47
tyr200018-Feb-09 19:47 
AnswerRe: how to protect my process from being closed? Pin
Cedric Moonen18-Feb-09 20:13
Cedric Moonen18-Feb-09 20:13 
GeneralRe: how to protect my process from being closed? Pin
CPallini18-Feb-09 21:30
mveCPallini18-Feb-09 21:30 
GeneralRe: how to protect my process from being closed? Pin
tyr200021-Feb-09 17:58
tyr200021-Feb-09 17:58 
QuestionRe: how to protect my process from being closed? Pin
CPallini22-Feb-09 0:51
mveCPallini22-Feb-09 0:51 
GeneralRe: how to protect my process from being closed? Pin
tyr200021-Feb-09 17:55
tyr200021-Feb-09 17:55 
QuestionNeed urgent help in vc++ Pin
priyankapriyanka18-Feb-09 19:08
priyankapriyanka18-Feb-09 19:08 
AnswerRe: Need urgent help in vc++ Pin
Hamid_RT18-Feb-09 19:15
Hamid_RT18-Feb-09 19:15 
GeneralRe: Need urgent help in vc++ Pin
priyankapriyanka19-Feb-09 18:37
priyankapriyanka19-Feb-09 18:37 
AnswerRe: Need urgent help in vc++ Pin
Cedric Moonen18-Feb-09 20:15
Cedric Moonen18-Feb-09 20:15 
GeneralRe: Need urgent help in vc++ Pin
priyankapriyanka19-Feb-09 18:39
priyankapriyanka19-Feb-09 18:39 
AnswerRe: Need urgent help in vc++ Pin
Ash_VCPP18-Feb-09 20:47
Ash_VCPP18-Feb-09 20:47 

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.