libAlgAudio  v1.99-440-g08538e5-dirty
The development library for AlgAudio framework.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AlgAudio::SDLFix Class Reference

#include <SDLFix.hpp>

Static Public Member Functions

static void CorrectBlendMode (SDL_Renderer *renderer)
 
static void FixRenderer (SDL_Renderer *renderer)
 
static void MarkApiTrace (SDL_Renderer *renderer, int no)
 
static void PremultiplySurface32RGBA (SDL_Surface *surf)
 
static void RenderDrawLines (SDL_Renderer *renderer, const SDL_FPoint *points, int count)
 
static void RendererMakeCurrent (SDL_Renderer *renderer)
 
static void RenderSetLineSmoothing (SDL_Renderer *renderer, bool enabled)
 
static void RenderSetLineWidth (SDL_Renderer *renderer, float w)
 

Detailed Description

This class provides sevaral fixes and workarounds for flaws within SDL.

Member Function Documentation

static void AlgAudio::SDLFix::CorrectBlendMode ( SDL_Renderer *  renderer)
static

This function corrects the renderers internal blendmode state. The internal formulas SDL uses are wrong, incorrect, ugly, and do not support premultiplied alpha. Call this function on your renderer after calling SetBlendMode(BLENDMODE_BLEND), and make sure your textures use an invalid blendmode, otherwise SDL will reset

static void AlgAudio::SDLFix::FixRenderer ( SDL_Renderer *  renderer)
static

This function substitutes several method pointers inside the renderer, so that fixed (or modified) versions of several rendering functions are used whenever SDL calls any of these methods on the renderer. It also checks whether the renderer is opengl. Generally, call this function on any fresh created renderer.

static void AlgAudio::SDLFix::MarkApiTrace ( SDL_Renderer *  renderer,
int  no 
)
static
static void AlgAudio::SDLFix::PremultiplySurface32RGBA ( SDL_Surface *  surf)
static

Mutliplies all pixel colors in a surface by alpha.

static void AlgAudio::SDLFix::RenderDrawLines ( SDL_Renderer *  renderer,
const SDL_FPoint points,
int  count 
)
static

Similar to SDL_RenderDrawLines, but acccepts SDL_FPoints instead of SDL_Points.

static void AlgAudio::SDLFix::RendererMakeCurrent ( SDL_Renderer *  renderer)
static

Some SDL calls forget to make renderer's contex current, for example internal SDL_RenderSetCLipRect suffers from this problem. This function is a helpful workaround, it forces SDL to call GL_ActivateRenderer(renderer) and nothing else.

static void AlgAudio::SDLFix::RenderSetLineSmoothing ( SDL_Renderer *  renderer,
bool  enabled 
)
static

Calls glEnable( GL_LINE_SMOOTH ).

static void AlgAudio::SDLFix::RenderSetLineWidth ( SDL_Renderer *  renderer,
float  w 
)
static

Sets GL line width.


The documentation for this class was generated from the following file: