MCPcopy Create free account
hub / github.com/InkboxSoftware/all-screen-keyboard / textureLoad

Function textureLoad

keyboard/src/texture.cpp:113–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113GLuint 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
130GLuint textureLoadFromFont(const char* filename, const char* string, int size, SDL_Color color){
131 //load font and render text to SDL surface

Callers 6

initializeMethod · 0.85
drawImageMethod · 0.85
setbackgroundImageMethod · 0.85
initializeMethod · 0.85
drawImageMethod · 0.85
setbackgroundImageMethod · 0.85

Calls 1

SDLsurfaceToGLuintFunction · 0.85

Tested by

no test coverage detected