Click here to Skip to main content
15,896,348 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: return program Pin
Hamid_RT20-May-07 7:33
Hamid_RT20-May-07 7:33 
Questionreturn program Pin
KARFER20-May-07 6:21
KARFER20-May-07 6:21 
AnswerRe: return program Pin
Hamid_RT20-May-07 7:35
Hamid_RT20-May-07 7:35 
AnswerRe: return program Pin
Moonis Ahmed20-May-07 20:30
Moonis Ahmed20-May-07 20:30 
QuestionInfo on one process Pin
nofearxd20-May-07 5:47
nofearxd20-May-07 5:47 
AnswerRe: Info on one process Pin
Mark Salsbery20-May-07 6:30
Mark Salsbery20-May-07 6:30 
AnswerRe: Info on one process Pin
Hamid_RT20-May-07 7:53
Hamid_RT20-May-07 7:53 
QuestionMFC resizing OpenGL Pin
zqueezy20-May-07 2:27
zqueezy20-May-07 2:27 
hey guys

this is more of a MFC-question than OpenGL I guess, that's why I put it here.

I integrated an OpenGL-control in my MFC-proggy, like from here:
(http://www.codeguru.com/cpp/g-m/opengl/article.php/c5583)
all works fine, except that
"glViewport(0, 0, width, height);"
makes no difference and I cannot get the correct aspect ratio for my OpenGL-viewport (Except my app is squared).

When the app is resized I call the Resize-function of my opengl-class
which looks like this
<br />
void COpenGL::Resize(int posx, int posy, int width, int height)<br />
{<br />
if (height==0) height=1; // prevent division by zero<br />
}<br />
this->SetWindowPos(&CWnd::wndBottom,<br />
					posx,<br />
					posy,<br />
					width,<br />
					height,<br />
					NULL);<br />
<br />
<br />
	glViewport(0,0,(GLsizei)width,( GLsizei)height); //<-- problem here<br />
	glMatrixMode(GL_PROJECTION);<br />
	glLoadIdentity ();<br />
	gluPerspective(45.0f,(float)width/((float)height),0.1f,100.0f);<br />
	glMatrixMode(GL_MODELVIEW);<br />
<br />
}<br />


The first part resizes OpenGL-Control... works
The second part should resize the viewport (camera/aspect-ratio)... those commands work fine in a console app using only glut.
any idea?

thx in advance
zqueezy
AnswerRe: MFC resizing OpenGL Pin
zqueezy20-May-07 2:37
zqueezy20-May-07 2:37 
GeneralRe: MFC resizing OpenGL Pin
Hans Dietrich20-May-07 5:26
mentorHans Dietrich20-May-07 5:26 
QuestionHow do I create a CBitmap from raw data in memory? Pin
fixitnow20-May-07 2:25
fixitnow20-May-07 2:25 
AnswerRe: How do I create a CBitmap from raw data in memory? Pin
Mark Salsbery20-May-07 6:48
Mark Salsbery20-May-07 6:48 
GeneralRe: How do I create a CBitmap from raw data in memory? Pin
fixitnow20-May-07 18:43
fixitnow20-May-07 18:43 
QuestionRe: How do I create a CBitmap from raw data in memory? Pin
Mark Salsbery21-May-07 4:47
Mark Salsbery21-May-07 4:47 
AnswerRe: How do I create a CBitmap from raw data in memory? Pin
fixitnow22-May-07 23:12
fixitnow22-May-07 23:12 
GeneralRe: How do I create a CBitmap from raw data in memory? Pin
Mark Salsbery23-May-07 5:30
Mark Salsbery23-May-07 5:30 
Questioncode completion feature Pin
SumitMandal20-May-07 0:50
SumitMandal20-May-07 0:50 
AnswerRe: code completion feature Pin
Hans Dietrich20-May-07 4:15
mentorHans Dietrich20-May-07 4:15 
QuestionWindows Message Handling Pin
sawerr19-May-07 23:07
sawerr19-May-07 23:07 
AnswerRe: Windows Message Handling Pin
zqueezy20-May-07 2:19
zqueezy20-May-07 2:19 
GeneralRe: Windows Message Handling Pin
jk chan20-May-07 2:25
jk chan20-May-07 2:25 
AnswerRe: Windows Message Handling Pin
cp987620-May-07 16:19
cp987620-May-07 16:19 
QuestionHiding/Showing Radio Controls Pin
si_6919-May-07 22:33
si_6919-May-07 22:33 
AnswerRe: Hiding/Showing Radio Controls Pin
Rajesh R Subramanian19-May-07 22:40
professionalRajesh R Subramanian19-May-07 22:40 
GeneralRe: Hiding/Showing Radio Controls Pin
si_6919-May-07 22:47
si_6919-May-07 22: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.