I've struggled a bit getting a modal messagebox working, but it's almost there now. A nice new construct for me - an array of function pointers!
typedef void (*m_print_func_t) (int, int, char *);Just 4 lines of code, but doesn't it make your eyes bleed?
m_print_func_t M_PrintFunc[2] = {M_PrintWhite, M_Print};
------------------------
M_PrintFunc[this->ActiveButton] (184, ypos + 20, "Yes");
M_PrintFunc[!this->ActiveButton] (240, ypos + 20, "No");
0 comments:
Post a Comment