[My GitHub Repository of tinyEngine]
For about a few days I have tried taking on multi-threading, once started with basic graphics. I have made a program that draws rectangles taking the coordinates and lengths from user input. The graphical work is done using SDL2, so if you would access my little GitHub Repository you would need to download that sdl2.dll. Anyway, all was fine, up until now, when multi-threading seems the only solution when it comes to reading inputs and updating the screen in parallel (Hint, hint!). This would be needed due to the fact that if the screen wouldn't be updated constantly, it would freeze, being rendered unresponsive.
A small overview of the project: it uses 3 classes that interact more or less with each other. they are SCREEN - The window itself
RECT - Rectangles themselves, which will be rendered to the screen
CENTRALIZER - Most importantly, it has a member map, to allow the user to create rectangles dynamically; passing them to the SCREEN object for
rendering via pointer
Now, time for the final question
Why is the member thread of class SCREEN not running (as seen with the code::blocks debugger), and how would you recommend me to solve this issue? It doesn't matter if you'd be to show me totally other approach, other than threads as long as it works (Threading, SDL_Threading, loops, specific order of function calling, whatever rows the boat).
Aucun commentaire:
Enregistrer un commentaire