11#include "attributes.h"
16#define RMASK SDL_SwapLE32(0x000000ff)
17#define GMASK SDL_SwapLE32(0x0000ff00)
18#define BMASK SDL_SwapLE32(0x00ff0000)
19#define AMASK SDL_SwapLE32(0xff000000)
20#define RGBAMASK RMASK,GMASK,BMASK,AMASK
25#define OPENGL_TEX_MAPTRANS (1<<0)
26#define OPENGL_TEX_MIPMAPS (1<<1)
27#define OPENGL_TEX_VFLIP (1<<2)
28#define OPENGL_TEX_SKIPCACHE (1<<3)
29#define OPENGL_TEX_SDF (1<<4)
36typedef struct glTexture_ {
69USE_RESULT
glTexture* gl_loadImageData(
float *data,
int w,
int h,
int sx,
int sy,
const char* name );
71 unsigned int flags,
int w,
int h,
int sx,
int sy,
int freesur );
73 unsigned int flags,
int w,
int h,
int sx,
int sy,
int freesur );
78 const unsigned int flags );
80 const int sx,
const int sy,
const unsigned int flags );
91int gl_fboCreate( GLuint *fbo, GLuint *tex, GLsizei width, GLsizei height );
96void gl_contextSet (
void);
97void gl_contextUnset (
void);
glTexture * gl_dupTexture(const glTexture *texture)
Duplicates a texture.
glTexture * gl_newSprite(const char *path, const int sx, const int sy, const unsigned int flags)
Loads the texture immediately, but also sets it as a sprite.
void gl_exitTextures(void)
Cleans up the opengl texture subsystem.
glTexture * gl_newImageRWops(const char *path, SDL_RWops *rw, const unsigned int flags)
Loads an image as a texture.
int gl_fboCreate(GLuint *fbo, GLuint *tex, GLsizei width, GLsizei height)
Creates a framebuffer and its associated texture.
glTexture * gl_loadImage(SDL_Surface *surface, unsigned int flags)
Loads the SDL_Surface to a glTexture.
glTexture * gl_newSpriteRWops(const char *path, SDL_RWops *rw, const int sx, const int sy, const unsigned int flags)
Loads the texture immediately, but also sets it as a sprite.
glTexture ** gl_addTexArray(glTexture **tex, glTexture *t)
Adds an element to a texture array.
int gl_isTrans(const glTexture *t, const int x, const int y)
Checks to see if a pixel is transparent in a texture.
glTexture ** gl_copyTexArray(glTexture **tex)
Copy a texture array.
glTexture * gl_loadImagePad(const char *name, SDL_Surface *surface, unsigned int flags, int w, int h, int sx, int sy, int freesur)
Loads the already padded SDL_Surface to a glTexture.
glTexture * gl_loadImagePadTrans(const char *name, SDL_Surface *surface, SDL_RWops *rw, unsigned int flags, int w, int h, int sx, int sy, int freesur)
Wrapper for gl_loadImagePad that includes transparency mapping.
glTexture * gl_newImage(const char *path, const unsigned int flags)
Loads an image as a texture.
void gl_getSpriteFromDir(int *x, int *y, const glTexture *t, const double dir)
Sets x and y to be the appropriate sprite for glTexture using dir.
void gl_freeTexture(glTexture *texture)
Frees a texture.
int gl_initTextures(void)
Initializes the opengl texture subsystem.
Abstraction for rendering sprite sheets.