xiackok Messages: 3 Registered: April 2010 Location: Turkey
Junior Member
firstly im sory for bad english.
Im new to U++. Im start to programming with c and now im coding python. But u++ is very strong and easy, i love it.
Im tryin to rewrite old ball destroying game . First i wrote all codes in to my topwindow's class. Later i cleanup and split my code into game engine and viewport control classes. The game logic in GameEngine class. Im drawing game via GameViewport (my custom ctrl) ctrl.
But i can't saw anything and i debug. And i see my main window does not call GameViewport's Paint(overrided) method so nothing to see.
I attached my app if anyone show the bug i will be so happy.
Sender Ghost Messages: 301 Registered: November 2008
Senior Member
Hello, Umur.
In the attachments you can find archive with changed files for your application.
Brief description:
- To avoid memory leaks you need to delete dynamically created objects before application window will be closed. For this purpose you can use class destructor.
- Custom control in the Upp application can be placed on stack instead of heap memory.
- Size of the rectangle for custom control was wrong.
- Other small changes.