• MorphOS Developer
    bigfoot
    Posts: 508 from 2003/4/11
    Quote:

    It could also cause annoying issues like getting stuck in infinite loops (this is going to be especially annoying if you rely on printf debugging and dont have the ability to just pause execution and see where the program is stuck at).


    If you enable 'developer mode' for Taskmanager (right click the icon, choose information, doubleclick on the line saying '(DEVELOPERMODE)' and then press 'save'), then if you right click on a task you get the option to 'dump task state'. This dumps the state of a task to the system debug log in the same way as if it had made an illegal access. From there you get the program counter (called SRR0) and a stack trace. Not perfect, but a lot better than adding dprintf() all over the place.

    Quote:

    Having the source can also help if you are looking for performance. For example, glVertex2f seem to just call glVertex4f internally.
    Knowing this I would call glVertex4f from my code and get rid of that extra function call.


    That's not true. If you look at gg:os-include/tgl/gl.h you will find this line:
    Code:
    #define glVertex2f(x,y)     GLVertex3f(__tglContext, x, y, 0.0f)


    So it maps to glVertex3f, but it does so by a macro, so it's the same as if you had called glVertex3f directly yourself. But in general everything will always be slow if you're using immediate mode OpenGL, no matter which exact function call you make.
    I rarely log in to MorphZone which means that I often miss private messages sent on here. If you wish to contact me, please email me at [username]@asgaard.morphos-team.net, where [username] is my username here on MorphZone.
  • »17.10.13 - 14:14
    Profile Visit Website