Program taking a lot of cpu usage & other problems

Okay so I've been working on this directx 11 application and have came across two problems. The most important one being, this application takes a heavy usage of the cpu and I have no idea what is causing it. The less important problem is that upon destroying the application it still stays within the process list on the task manager.

Code is here:
the problem is probably message loop, you should look around other solution for this part of your program( like excellent site: )
Thanks that's fixed the closing of the window problem :) Any ideas on the cpu usage? :/
the problem is still in your message loop. Since peekMessage is non-blocking, this thread will never wait (create console app with while(true) {cout<<"aa";} - high cpu usage will also happen}.

To fix this you must limit your engine fps. Some insight can be found here and more probably googled out.
Topic archived. No new replies allowed.