Click here to Skip to main content
15,887,267 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCreating TCP/IP Port programatically [modified] Pin
msr_codeproject13-Feb-11 23:54
msr_codeproject13-Feb-11 23:54 
AnswerRe: Creating TCP/IP Port programatically Pin
ShilpiP14-Feb-11 19:01
ShilpiP14-Feb-11 19:01 
GeneralRe: Creating TCP/IP Port programatically Pin
msr_codeproject14-Feb-11 23:58
msr_codeproject14-Feb-11 23:58 
GeneralRe: Creating TCP/IP Port programatically Pin
ShilpiP15-Feb-11 0:37
ShilpiP15-Feb-11 0:37 
GeneralRe: Creating TCP/IP Port programatically Pin
msr_codeproject16-Feb-11 0:20
msr_codeproject16-Feb-11 0:20 
GeneralRe: Creating TCP/IP Port programatically Pin
ShilpiP16-Feb-11 0:29
ShilpiP16-Feb-11 0:29 
GeneralRe: Creating TCP/IP Port programatically [modified] Pin
msr_codeproject16-Feb-11 1:57
msr_codeproject16-Feb-11 1:57 
QuestionHow to reduce CPU uages with Opengl ? Pin
GAJERA13-Feb-11 19:36
GAJERA13-Feb-11 19:36 
Hi All

I am using gluBuild2DMipmaps() for show live video buffer.
but it is using the CPU around 50%.
Please suggest how to reduce CPU usages.

Here I am sending you the source code for render.
for (int loop=0; loop<2; loop++)									// Loop To Draw Our 4 Views
	{
		if (loop==0)													// If We Are Drawing The First Scene
		{
			m_bRenderFromVideo=FALSE;
			if(m_pbVideoData)
				gluBuild2DMipmaps(GL_TEXTURE_2D, 3, m_iVideoHeight,m_iVideoWidth ,GL_LUMINANCE, GL_UNSIGNED_BYTE, m_pbVideoData);

			glViewport(m_iNoOfColumn - m_iNoOfColumn * m_iSizeVideo.x, m_iNoOfRow - m_iNoOfRow * m_iSizeVideo.y, 
			m_iNoOfColumn * m_iSizeVideo.x, m_iNoOfRow * m_iSizeVideo.y);
			glPushMatrix();

			gluOrtho2D(-window_width/4, window_width/4, -window_height/4, window_height/4);
			//glDrawPixels( window_width/2,  window_height/2, GL_LUMINANCE,GL_UNSIGNED_BYTE, (void*)m_pbVideoData);
			glLoadIdentity ();											// Reset The Projection Matrix

			glDisable(GL_TEXTURE_GEN_S);								// Enable Texture Coord Generation For S (NEW)
			glDisable(GL_TEXTURE_GEN_T);								// Enable Texture Coord Generation For T (NEW)

			glDisable(GL_LIGHTING);
			glBegin(GL_QUADS);											// Begin Drawing A Single Quad
			// We Fill The Entire 1/4 Section With A Single Textured Quad.
		
			glTexCoord2f(1.0f, 1.0f); glVertex3f( 21.0f,  18.3f, -10.0f);
			glTexCoord2f(0.0f, 1.0f); glVertex3f(-21.0f,  18.3f, -10.0f);
			glTexCoord2f(0.0f, 0.0f); glVertex3f(-21.0f, -18.3f, -10.0f);
			glTexCoord2f(1.0f, 0.0f); glVertex3f( 21.0f, -18.3f, -10.0f);
			glEnd();	

			glScalef(m_fScale, m_fScale, m_fScale);
			glRotated(m_fRAngle[0],0.0, 0.0,1.0);
			//glRotated(0,0.0,0.0, m_fRAngle[0]);
			//glRotated(0,0.0,0.0,m_fRAngle[0]);	   

			
		}
		else		
		{
			glPushMatrix();
			glViewport(0, 0, window_width, window_height);
			//float len = 28.0f;			
			//glMatrixMode(GL_PROJECTION);
			glLoadIdentity();
		//	glOrtho(-len, len, -len, len, -len*100.0f, len*100.0f);	
		//	glMatrixMode(GL_MODELVIEW);

			glScalef(m_fScale, m_fScale, m_fScale);
			glRotated(m_fRAngle[0],1.0, 0.0, 0.0);
			glRotated(m_fRAngle[1],0.0,1.0, 0.0);
			glRotated(m_fRAngle[2],0.0,0.0,1.0);	   


		}
		
		
	}	

AnswerRe: How to reduce CPU uages with Opengl ? Pin
Emilio Garavaglia14-Feb-11 9:03
Emilio Garavaglia14-Feb-11 9:03 
AnswerRe: How to reduce CPU uages with Opengl ? Pin
Cedric Moonen14-Feb-11 20:26
Cedric Moonen14-Feb-11 20:26 
QuestionNow I know why people use makefiles Pin
Craig Longman13-Feb-11 17:37
Craig Longman13-Feb-11 17:37 
GeneralRe: Now I know why people use makefiles Pin
Richard MacCutchan13-Feb-11 22:31
mveRichard MacCutchan13-Feb-11 22:31 
GeneralRe: Now I know why people use makefiles Pin
Craig Longman14-Feb-11 2:54
Craig Longman14-Feb-11 2:54 
GeneralRe: Now I know why people use makefiles Pin
Richard MacCutchan14-Feb-11 5:01
mveRichard MacCutchan14-Feb-11 5:01 
GeneralRe: Now I know why people use makefiles Pin
Craig Longman14-Feb-11 13:01
Craig Longman14-Feb-11 13:01 
AnswerRe: Now I know why people use makefiles Pin
Joe Woodbury14-Feb-11 12:34
professionalJoe Woodbury14-Feb-11 12:34 
QuestionNested structs problem [modified] Pin
manchukuo13-Feb-11 10:07
manchukuo13-Feb-11 10:07 
AnswerRe: Nested structs problem [modified] Pin
Richard MacCutchan13-Feb-11 10:39
mveRichard MacCutchan13-Feb-11 10:39 
GeneralRe: Nested structs problem Pin
manchukuo13-Feb-11 10:58
manchukuo13-Feb-11 10:58 
GeneralRe: Nested structs problem Pin
Richard MacCutchan13-Feb-11 11:40
mveRichard MacCutchan13-Feb-11 11:40 
AnswerRe: Nested structs problem Pin
Luc Pattyn13-Feb-11 11:05
sitebuilderLuc Pattyn13-Feb-11 11:05 
GeneralRe: Nested structs problem Pin
manchukuo13-Feb-11 11:08
manchukuo13-Feb-11 11:08 
AnswerRe: Nested structs problem Pin
Luc Pattyn13-Feb-11 11:11
sitebuilderLuc Pattyn13-Feb-11 11:11 
AnswerRe: Nested structs problem Pin
Niklas L13-Feb-11 11:24
Niklas L13-Feb-11 11:24 
GeneralRe: Nested structs problem Pin
Richard MacCutchan13-Feb-11 11:41
mveRichard MacCutchan13-Feb-11 11:41 

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.