I'm trying to use al_draw_text but it wont work with numbers and i'm not sure how to convert to const char*
Try this instead: https://liballeg.org/a5docs/trunk/font.html#al_draw_textf
that didnt make a difference it's still asking for a const char
The const char pointer is the format string, the values are added as extra arguments after that. Look at the examples here:
https://www.cplusplus.com/reference/cstdio/printf/
but what does stringstream actually do? it doesnt seem to convert to const char*
It works just like std cout
https://github.com/jmasterx/Agui/blob/master/demo/AguiCalc/AguiCalc/Calculator.cpp#L292
it will output a std string which you can do .c_str() to get a const char*
you can << whaterver you want.
Like
std::stringstream ss; ss << "I ate" << 22 << "Hot Dogs"; al_draw_text(ss.str().c_str());
Drawing an int would look like this:
al_draw_textf(my_font, my_color, x_pos, y_pos, 0, "Here it is: %d", my_value);
Or replace %d with %f to draw a float or double, etc.