| 111 | } |
| 112 | |
| 113 | GLuint textureLoad(const char* filename){ |
| 114 | //support for both JPG and PNG |
| 115 | int flags = IMG_INIT_JPG | IMG_INIT_PNG; |
| 116 | if ((IMG_Init(flags) & flags) == 0){ |
| 117 | SDL_Log("JPG or PNG loaders not found\n"); |
| 118 | return 0; |
| 119 | } |
| 120 | //load image |
| 121 | SDL_Surface* textureSurface = IMG_Load(filename); |
| 122 | if (!textureSurface){ |
| 123 | SDL_Log("Loading image %s failed with error: %s\n", filename, IMG_GetError()); |
| 124 | return 0; |
| 125 | } |
| 126 | |
| 127 | return SDLsurfaceToGLuint(textureSurface, filename); |
| 128 | } |
| 129 | |
| 130 | GLuint textureLoadFromFont(const char* filename, const char* string, int size, SDL_Color color){ |
| 131 | //load font and render text to SDL surface |
no test coverage detected