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" :) ). 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]