| 853 | } |
| 854 | |
| 855 | int window::setFont(const char* fontName){ |
| 856 | //check if file exists and is ttf |
| 857 | ifstream file(fontName); |
| 858 | if (strstr(fontName, ".ttf") == nullptr){ |
| 859 | cout << fontName << " is not a ttf file" << endl; |
| 860 | return -1; |
| 861 | } |
| 862 | if (!file.good()){ |
| 863 | cout << fontName << " file not found" << endl; |
| 864 | return -1; |
| 865 | } |
| 866 | currentFont = strdup(fontName); |
| 867 | return 0; |
| 868 | } |
| 869 | |
| 870 | void window::setbackrgoundColor(int r, int g, int b, int a){ |
| 871 | clearColor = createColor(r, g, b, a); |