CoglTexture * st_cogl_texture_new_from_file_wrapper (const char *filename, CoglTextureFlags flags, CoglPixelFormat internal_format) { CoglTexture *texture = NULL; CoglError *error = NULL; if (hardware_supports_npot_sizes ()) { texture = COGL_TEXTURE (cogl_texture_2d_new_from_file (cogl_context, filename, #if COGL_VERSION < COGL_VERSION_ENCODE (1, 18, 0) COGL_PIXEL_FORMAT_ANY, #endif &error)); } else { texture = cogl_texture_new_from_file (filename, flags, internal_format, &error); } if (error) { g_debug ("cogl_texture_(2d)_new_from_file failed: %s\n", error->message); cogl_error_free (error); } return texture; }
CoglTexture * meta_cogl_texture_new_from_file_wrapper (const char *filename, CoglTextureFlags flags, CoglPixelFormat internal_format) { CoglTexture *texture = NULL; if (hardware_supports_npot_sizes ()) { texture = COGL_TEXTURE (cogl_texture_2d_new_from_file (cogl_context, filename, #if COGL_VERSION < COGL_VERSION_ENCODE (1, 18, 0) COGL_PIXEL_FORMAT_ANY, #endif NULL)); } else { texture = cogl_texture_new_from_file (filename, flags, internal_format, NULL); } return texture; }
CoglTexture * st_cogl_texture_new_with_size_wrapper (int width, int height, CoglTextureFlags flags, CoglPixelFormat internal_format) { CoglTexture *texture = NULL; if (hardware_supports_npot_sizes ()) { texture = COGL_TEXTURE (cogl_texture_2d_new_with_size (cogl_context, width, height #if COGL_VERSION < COGL_VERSION_ENCODE (1, 18, 0) ,CLUTTER_CAIRO_FORMAT_ARGB32 #endif )); } else { texture = cogl_texture_new_with_size (width, height, flags, internal_format); } return texture; }
CoglTexture * meta_cogl_texture_new_from_data_wrapper (int width, int height, CoglTextureFlags flags, CoglPixelFormat format, CoglPixelFormat internal_format, int rowstride, const uint8_t *data) { CoglTexture *texture = NULL; if (hardware_supports_npot_sizes ()) { texture = COGL_TEXTURE (cogl_texture_2d_new_from_data (cogl_context, width, height, format, #if COGL_VERSION < COGL_VERSION_ENCODE (1, 18, 0) COGL_PIXEL_FORMAT_ANY, #endif rowstride, data, NULL)); } else { texture = cogl_texture_new_from_data (width, height, flags, format, internal_format, rowstride, data); } return texture; }
CoglTexture * st_cogl_texture_new_from_data_wrapper (int width, int height, CoglTextureFlags flags, CoglPixelFormat format, CoglPixelFormat internal_format, int rowstride, const uint8_t *data) { CoglTexture *texture = NULL; if (hardware_supports_npot_sizes ()) { CoglError *error = NULL; texture = COGL_TEXTURE (cogl_texture_2d_new_from_data (cogl_context, width, height, format, #if COGL_VERSION < COGL_VERSION_ENCODE (1, 18, 0) COGL_PIXEL_FORMAT_ANY, #endif rowstride, data, &error)); if (error) { g_debug ("(st) cogl_texture_2d_new_from_data failed: %s\n", error->message); cogl_error_free (error); } } else { texture = cogl_texture_new_from_data (width, height, flags, format, internal_format, rowstride, data); } return texture; }