Wiki Page Content

Differences between revisions 10 and 11
Revision 10 as of 2009-11-25 06:37:52
Size: 1507
Editor: SheenaSmith
Comment: finish add anchors
Revision 11 as of 2009-11-25 06:40:10
Size: 1508
Editor: SheenaSmith
Comment:
Deletions are marked like this. Additions are marked like this.
Line 35: Line 35:
<<Anchor(access)>>'''access''' can be one of these values: <<Anchor(access)>> '''access''' can be one of these values:

SDL_CreateTexture

Use this function to create a texture for the current rendering context.

Syntax

SDL_TextureID SDL_CreateTexture(Uint32 format,
                                int    access, 
                                int    w,
                                int    h)

Function Parameters

format

one of the enumerated values in SDL_PixelFormatEnum; see Remarks for details

access

one of the enumerated values in SDL_TextureAccess; see Remarks for details

w

the width of the texture in pixels

h

the height of the texture in pixels

Return Value

The created texture is returned, or 0 if no rendering context was active, the format was unsupported, or the width or height were out of range; call SDL_GetError() for more information.

Code Examples

You can add your code example here

Remarks

format can be one of these values:

Pixel Format Macros

SDL_PIXELTYPE(format)

the type of the pixel format; see Remarks for details

SDL_PIXELORDER(format)

the ordering of channels or bits in the pixel format; see Remarks for details

SDL_PIXELLAYOUT(format)

the channel bit pattern of the pixel format; see Remarks for details

SDL_BITSPERPIXEL(format)

the number of bits of color information in the pixel format

SDL_BYTESPERPIXEL(format)

the number of bytes used to represent a pixel

SDL_ISPIXELFORMAT_INDEXED(format)

true for pixel formats that have a palette

SDL_ISPIXELFORMAT_ALPHA(format)

true for pixel formats that have an alpha channel

SDL_ISPIXELFORMAT_FOURCC(format)

true for pixel formats representing unique formats, for example YUV formats

Pixel Format Values

SDL_PIXELFORMAT_UNKNOWN

SDL_PIXELFORMAT_INDEX1LSB

SDL_PIXELFORMAT_INDEX1MSB

SDL_PIXELFORMAT_INDEX4LSB

SDL_PIXELFORMAT_INDEX4MSB

SDL_PIXELFORMAT_INDEX8

SDL_PIXELFORMAT_RGB332

SDL_PIXELFORMAT_RGB444

SDL_PIXELFORMAT_RGB555

SDL_PIXELFORMAT_BGR555

SDL_PIXELFORMAT_ARGB4444

SDL_PIXELFORMAT_RGBA4444

SDL_PIXELFORMAT_ABGR4444

SDL_PIXELFORMAT_BGRA4444

SDL_PIXELFORMAT_ARGB1555

SDL_PIXELFORMAT_RGBA5551

SDL_PIXELFORMAT_ABGR1555

SDL_PIXELFORMAT_BGRA5551

SDL_PIXELFORMAT_RGB565

SDL_PIXELFORMAT_BGR565

SDL_PIXELFORMAT_RGB24

SDL_PIXELFORMAT_BGR24

SDL_PIXELFORMAT_RGB888

SDL_PIXELFORMAT_RGBX8888

SDL_PIXELFORMAT_BGR888

SDL_PIXELFORMAT_BGRX8888

SDL_PIXELFORMAT_ARGB8888

SDL_PIXELFORMAT_RGBA8888

SDL_PIXELFORMAT_ABGR8888

SDL_PIXELFORMAT_BGRA8888

SDL_PIXELFORMAT_ARGB2101010

SDL_PIXELFORMAT_RGBA32

alias for RGBA byte array of color data, for the current platform (>= SDL 2.0.5)

SDL_PIXELFORMAT_ARGB32

alias for ARGB byte array of color data, for the current platform (>= SDL 2.0.5)

SDL_PIXELFORMAT_BGRA32

alias for BGRA byte array of color data, for the current platform (>= SDL 2.0.5)

SDL_PIXELFORMAT_ABGR32

alias for ABGR byte array of color data, for the current platform (>= SDL 2.0.5)

SDL_PIXELFORMAT_YV12

planar mode: Y + V + U (3 planes)

SDL_PIXELFORMAT_IYUV

planar mode: Y + U + V (3 planes)

SDL_PIXELFORMAT_YUY2

packed mode: Y0+U0+Y1+V0 (1 plane)

SDL_PIXELFORMAT_UYVY

packed mode: U0+Y0+V0+Y1 (1 plane)

SDL_PIXELFORMAT_YVYU

packed mode: Y0+V0+Y1+U0 (1 plane)

SDL_PIXELFORMAT_NV12

planar mode: Y + U/V interleaved (2 planes) (>= SDL 2.0.4)

SDL_PIXELFORMAT_NV21

planar mode: Y + V/U interleaved (2 planes) (>= SDL 2.0.4)

access can be one of these values:

SDL_TEXTUREACCESS_STATIC

changes rarely, not lockable

SDL_TEXTUREACCESS_STREAMING

changes frequently, lockable

SDL_TEXTUREACCESS_TARGET

can be used as a render target


CategoryAPI, CategoryVideo

None: SDL_CreateTexture (last edited 2016-04-10 22:54:56 by PhilippWiesemann)

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit