So lately have been trying to understand how the render function works. It seem that the render function used as a game loop, but I still seem to not understand one thing.
The it seems that the render returns uint32_t * which is basically a place in memory for the surface screen. Nevertheless it seems a bit weird to return the same place in memory again and again. It may make more sense to just add a function that will be called once and will send the position ones(in the initialization step in JavaScript)...
If we will be able to do that we may be able to "compress" the render and init to one function that will basically just be a main function and just use a while loop (like using emscripten_set_main_loop) to achieve the same result.
So lately have been trying to understand how the
render
function works. It seem that therender
function used as a game loop, but I still seem to not understand one thing.The it seems that the
render
returnsuint32_t *
which is basically a place in memory for the surface screen. Nevertheless it seems a bit weird to return the same place in memory again and again. It may make more sense to just add a function that will be called once and will send the position ones(in the initialization step in JavaScript)... If we will be able to do that we may be able to "compress" therender
andinit
to one function that will basically just be a main function and just use a while loop (like using emscripten_set_main_loop) to achieve the same result.Do you think that is possible?