src/render/SDL_sysrender.h
changeset 5154 fb424691cfc7
child 5156 307ccc9c135e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/render/SDL_sysrender.h	Wed Feb 02 14:34:54 2011 -0800
     1.3 @@ -0,0 +1,133 @@
     1.4 +/*
     1.5 +    SDL - Simple DirectMedia Layer
     1.6 +    Copyright (C) 1997-2010 Sam Lantinga
     1.7 +
     1.8 +    This library is free software; you can redistribute it and/or
     1.9 +    modify it under the terms of the GNU Lesser General Public
    1.10 +    License as published by the Free Software Foundation; either
    1.11 +    version 2.1 of the License, or (at your option) any later version.
    1.12 +
    1.13 +    This library is distributed in the hope that it will be useful,
    1.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.16 +    Lesser General Public License for more details.
    1.17 +
    1.18 +    You should have received a copy of the GNU Lesser General Public
    1.19 +    License along with this library; if not, write to the Free Software
    1.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    1.21 +
    1.22 +    Sam Lantinga
    1.23 +    slouken@libsdl.org
    1.24 +*/
    1.25 +#include "SDL_config.h"
    1.26 +
    1.27 +#ifndef _SDL_sysrender_h
    1.28 +#define _SDL_sysrender_h
    1.29 +
    1.30 +#include "SDL_render.h"
    1.31 +#include "SDL_events.h"
    1.32 +
    1.33 +/* The SDL 2D rendering system */
    1.34 +
    1.35 +typedef struct SDL_RenderDriver SDL_RenderDriver;
    1.36 +
    1.37 +/* Define the SDL texture structure */
    1.38 +struct SDL_Texture
    1.39 +{
    1.40 +    const void *magic;
    1.41 +    Uint32 format;              /**< The pixel format of the texture */
    1.42 +    int access;                 /**< SDL_TextureAccess */
    1.43 +    int w;                      /**< The width of the texture */
    1.44 +    int h;                      /**< The height of the texture */
    1.45 +    int modMode;                /**< The texture modulation mode */
    1.46 +    SDL_BlendMode blendMode;    /**< The texture blend mode */
    1.47 +    Uint8 r, g, b, a;           /**< Texture modulation values */
    1.48 +
    1.49 +    SDL_Renderer *renderer;
    1.50 +
    1.51 +    void *driverdata;           /**< Driver specific texture representation */
    1.52 +
    1.53 +    SDL_Texture *prev;
    1.54 +    SDL_Texture *next;
    1.55 +};
    1.56 +
    1.57 +/* Define the SDL renderer structure */
    1.58 +struct SDL_Renderer
    1.59 +{
    1.60 +    const void *magic;
    1.61 +
    1.62 +    void (*WindowEvent) (SDL_Renderer * renderer, const SDL_WindowEvent *event);
    1.63 +    int (*CreateTexture) (SDL_Renderer * renderer, SDL_Texture * texture);
    1.64 +    int (*QueryTexturePixels) (SDL_Renderer * renderer, SDL_Texture * texture,
    1.65 +                               void **pixels, int *pitch);
    1.66 +    int (*SetTextureColorMod) (SDL_Renderer * renderer,
    1.67 +                               SDL_Texture * texture);
    1.68 +    int (*SetTextureAlphaMod) (SDL_Renderer * renderer,
    1.69 +                               SDL_Texture * texture);
    1.70 +    int (*SetTextureBlendMode) (SDL_Renderer * renderer,
    1.71 +                                SDL_Texture * texture);
    1.72 +    int (*UpdateTexture) (SDL_Renderer * renderer, SDL_Texture * texture,
    1.73 +                          const SDL_Rect * rect, const void *pixels,
    1.74 +                          int pitch);
    1.75 +    int (*LockTexture) (SDL_Renderer * renderer, SDL_Texture * texture,
    1.76 +                        const SDL_Rect * rect, int markDirty, void **pixels,
    1.77 +                        int *pitch);
    1.78 +    void (*UnlockTexture) (SDL_Renderer * renderer, SDL_Texture * texture);
    1.79 +    void (*DirtyTexture) (SDL_Renderer * renderer, SDL_Texture * texture,
    1.80 +                          int numrects, const SDL_Rect * rects);
    1.81 +    int (*RenderClear) (SDL_Renderer * renderer);
    1.82 +    int (*RenderDrawPoints) (SDL_Renderer * renderer, const SDL_Point * points,
    1.83 +                             int count);
    1.84 +    int (*RenderDrawLines) (SDL_Renderer * renderer, const SDL_Point * points,
    1.85 +                            int count);
    1.86 +    int (*RenderFillRects) (SDL_Renderer * renderer, const SDL_Rect ** rects,
    1.87 +                            int count);
    1.88 +    int (*RenderCopy) (SDL_Renderer * renderer, SDL_Texture * texture,
    1.89 +                       const SDL_Rect * srcrect, const SDL_Rect * dstrect);
    1.90 +    int (*RenderReadPixels) (SDL_Renderer * renderer, const SDL_Rect * rect,
    1.91 +                             Uint32 format, void * pixels, int pitch);
    1.92 +    int (*RenderWritePixels) (SDL_Renderer * renderer, const SDL_Rect * rect,
    1.93 +                              Uint32 format, const void * pixels, int pitch);
    1.94 +    void (*RenderPresent) (SDL_Renderer * renderer);
    1.95 +    void (*DestroyTexture) (SDL_Renderer * renderer, SDL_Texture * texture);
    1.96 +
    1.97 +    void (*DestroyRenderer) (SDL_Renderer * renderer);
    1.98 +
    1.99 +    /* The current renderer info */
   1.100 +    SDL_RendererInfo info;
   1.101 +
   1.102 +    /* The window associated with the renderer */
   1.103 +    SDL_Window *window;
   1.104 +
   1.105 +    /* The list of textures */
   1.106 +    SDL_Texture *textures;
   1.107 +
   1.108 +    Uint8 r, g, b, a;                   /**< Color for drawing operations values */
   1.109 +    SDL_BlendMode blendMode;            /**< The drawing blend mode */
   1.110 +
   1.111 +    void *driverdata;
   1.112 +};
   1.113 +
   1.114 +/* Define the SDL render driver structure */
   1.115 +struct SDL_RenderDriver
   1.116 +{
   1.117 +    SDL_Renderer *(*CreateRenderer) (SDL_Window * window, Uint32 flags);
   1.118 +
   1.119 +    /* Info about the renderer capabilities */
   1.120 +    SDL_RendererInfo info;
   1.121 +};
   1.122 +
   1.123 +#if SDL_VIDEO_RENDER_D3D
   1.124 +extern SDL_RenderDriver D3D_RenderDriver;
   1.125 +#endif
   1.126 +#if SDL_VIDEO_RENDER_OGL
   1.127 +extern SDL_RenderDriver GL_RenderDriver;
   1.128 +#endif
   1.129 +#if SDL_VIDEO_RENDER_OGL_ES
   1.130 +extern SDL_RenderDriver GL_ES_RenderDriver;
   1.131 +#endif
   1.132 +extern SDL_RenderDriver SW_RenderDriver;
   1.133 +
   1.134 +#endif /* _SDL_sysrender_h */
   1.135 +
   1.136 +/* vi: set ts=4 sw=4 expandtab: */