Click here to Skip to main content
15,909,518 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: reverse lines in OpenGl Pin
Alexander M.,17-Feb-09 15:58
Alexander M.,17-Feb-09 15:58 
General[Message Deleted] Pin
Member 337533417-Feb-09 16:02
Member 337533417-Feb-09 16:02 
GeneralRe: reverse lines in OpenGl Pin
Cedric Moonen17-Feb-09 20:14
Cedric Moonen17-Feb-09 20:14 
GeneralRe: reverse lines in OpenGl Pin
Member 337533418-Feb-09 2:47
Member 337533418-Feb-09 2:47 
General[Message Deleted] Pin
Member 337533418-Feb-09 3:00
Member 337533418-Feb-09 3:00 
GeneralRe: reverse lines in OpenGl Pin
Cedric Moonen18-Feb-09 3:25
Cedric Moonen18-Feb-09 3:25 
GeneralRe: reverse lines in OpenGl Pin
Member 337533418-Feb-09 4:20
Member 337533418-Feb-09 4:20 
GeneralRe: reverse lines in OpenGl Pin
Cedric Moonen18-Feb-09 7:41
Cedric Moonen18-Feb-09 7:41 
Member 3375334 wrote:
Ok the fact that my code is so ugly is because i am brand new to all this so please don't be judgmental


I don't judge you, I was just saying that what you did is not the best design.


Member 3375334 wrote:
the reason why i am doing it in mousemove..is because that's what i need to do.. i need to draw on mouse move not paint.


Of course, but storing your information (the coordinates of each lines for instance) in the mouse handler and forcing a repaint of the view will have the same effect. Besides, all drawing code from the MFC has to be put in the OnPaint handler, otherwise if your window is hidden for a while (even partially), all the MFC drawing will be lost because windows doesn't store any information about what to draw but instead issues a WM_PAINT message and lets the window repaint itself. As you didn't provide any drawing code there, everything is lost.


Member 3375334 wrote:
The reason why i need to see MFC is because that's what i need to do based on the requirements.


And what are your exact requirements here ? Because I don't see any reason why you would need to use MFC AND OpenGL on the same window. How can you expect to see one drawing through the other one ? I'm not an expert in mixing MFC and OpenGL drawings together, but I think this is not possible (not sure about it, but it sounds really strange anyway). Think of it this way: imagine that OpenGL and MFC are painting things on a buffer (like a real life painting). Now, each of them puts its buffer on the screen ("they hang their paintings on the wall" Smile | :) ). So, you can't see both of the paintings at the same time...

Besides, another strange thing is that OpenGL and MFC have different levels of 'abstraction': with MFC, you draw things on your screen and everything is 'pixel based'. With OpenGL, you are one level higher: your model have a space which is converted to screen coordinates by OpenGL. In your case, it happens that your units in the space correspond to pixels because you configured OpenGL this way. Suppose now that you want to add features like zoom, which is easy to do in OpenGL, then the MFC drawing won't follow.

Cédric Moonen
Software developer

Charting control [v1.5]
OpenGL game tutorial in C++

QuestionCFONTDialog usage Pin
ForNow17-Feb-09 7:24
ForNow17-Feb-09 7:24 
AnswerRe: CFONTDialog usage Pin
David Crow17-Feb-09 7:32
David Crow17-Feb-09 7:32 
GeneralRe: CFONTDialog usage Pin
ForNow17-Feb-09 13:07
ForNow17-Feb-09 13:07 
GeneralRe: CFONTDialog usage Pin
frx9617-Feb-09 14:50
frx9617-Feb-09 14:50 
GeneralRe: CFONTDialog usage Pin
David Crow18-Feb-09 3:02
David Crow18-Feb-09 3:02 
GeneralRe: CFONTDialog usage Pin
ForNow18-Feb-09 12:41
ForNow18-Feb-09 12:41 
AnswerRe: CFONTDialog usage Pin
Iain Clarke, Warrior Programmer18-Feb-09 0:27
Iain Clarke, Warrior Programmer18-Feb-09 0:27 
GeneralRe: CFONTDialog usage Pin
ForNow18-Feb-09 2:09
ForNow18-Feb-09 2:09 
GeneralRe: CFONTDialog usage Pin
ForNow18-Feb-09 17:09
ForNow18-Feb-09 17:09 
GeneralRe: CFONTDialog usage Pin
Iain Clarke, Warrior Programmer18-Feb-09 22:17
Iain Clarke, Warrior Programmer18-Feb-09 22:17 
GeneralRe: CFONTDialog usage Pin
ForNow18-Feb-09 23:04
ForNow18-Feb-09 23:04 
GeneralRe: CFONTDialog usage Pin
Iain Clarke, Warrior Programmer18-Feb-09 23:17
Iain Clarke, Warrior Programmer18-Feb-09 23:17 
QuestionReturn Code from EM_GETCHARFORMAT Pin
ForNow17-Feb-09 6:36
ForNow17-Feb-09 6:36 
QuestionRe: Return Code from EM_GETCHARFORMAT Pin
David Crow17-Feb-09 6:38
David Crow17-Feb-09 6:38 
AnswerRe: Return Code from EM_GETCHARFORMAT Pin
ForNow17-Feb-09 7:14
ForNow17-Feb-09 7:14 
AnswerRe: Return Code from EM_GETCHARFORMAT Pin
krmed18-Feb-09 0:39
krmed18-Feb-09 0:39 
Questionadaptive niblack algorithm Pin
Bindas Samanta17-Feb-09 4:14
Bindas Samanta17-Feb-09 4:14 

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.