Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

convgltex.h File Reference

#include "Teddy/TeddyConfig.h"
#include <SDL.h>

Include dependency graph for convgltex.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Functions

SDL_Surface * conv_surf_gl (SDL_Surface *s, int want_alpha)
 Convert surface for OpenGL. More...

SDL_Surface * load_gl_texture (const char *file)


Function Documentation

SDL_Surface* conv_surf_gl SDL_Surface *    s,
int    want_alpha
 

Convert surface for OpenGL.

Bug:
Crashes with some tga images if SDL_FreeSurface(s) is enabled

Convert a surface into one suitable as an OpenGL texture; in RGBA format if want_alpha is nonzero, or in RGB format otherwise.

The surface may have a colourkey, which is then translated to an alpha channel if RGBA is desired.

Return the resulting texture, or NULL on error. The original surface is always freed.

Definition at line 33 of file convgltex.cpp.

Referenced by load_gl_texture.

SDL_Surface* load_gl_texture const char *    file
 

A sample use of conv_surf_gl():

Load an image from a file, and convert it to RGB or RGBA format, depending on the image.

Return the resulting surface, or NULL on error

Definition at line 121 of file convgltex.cpp.

Referenced by Teddy::Graphics::ImageFileTexture::ImageFileTexture.