Quote Originally Posted by hwnd View Post
EDIT: also why you init stuff in OnPaint? Why not somewhere else (in own Init function, FormCreate or something) ? Any particular reason?
Not sure for that example but I saw that many graphical engines contain necessary code for initialization in OnPaint routine.
In most cases this code is there to alow recovering from display device handle loss (switching between internal and dedicated GPU, VPU recover which might be caused by some error in shaders or due to hardware problems, etc.).