Hello,

I have a question. I work in visual c++ in a document/view arhitecture (SDI application) and i draw some stuff with some opengl functions (cubes, cylinders) but when i hit the "New" menu from the File menu it doesn't erase or clear my drawing I don't know why. Can you help me how to ovewrite eventually this : OnFileNew function, and where should i put it? In the CView class or in CMainFrame?
What should i write in it to erase my background after i draw something and to provide a clear canvas ?

Thank you in advance for your help.

Hi
Use Invalidate() function to erase the entire client area. and it also call WM_PAINT message to redraw the client area void Invalidate( BOOL bErase = TRUE );

I did what you said and it works. Thank you very much:)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.