Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Added SDL_FOURCC()
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jul 8, 2010
1 parent 13a96d8 commit e3302d9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 1 addition & 2 deletions include/SDL_pixels.h
Expand Up @@ -112,8 +112,7 @@ enum
SDL_PACKEDLAYOUT_1010102
};

#define SDL_DEFINE_PIXELFOURCC(A, B, C, D) \
((A) | ((B) << 8) | ((C) << 16) | ((D) << 24))
#define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D)

#define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \
((1 << 31) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \
Expand Down
7 changes: 7 additions & 0 deletions include/SDL_stdinc.h
Expand Up @@ -101,6 +101,13 @@
#endif
/*@}*//*Cast operators*/

/* Define a four character code as a Uint32 */
#define SDL_FOURCC(A, B, C, D) \
((SDL_static_cast(Uint32, SDL_static_cast(Uint8, (A))) << 0) | \
(SDL_static_cast(Uint32, SDL_static_cast(Uint8, (B))) << 8) | \
(SDL_static_cast(Uint32, SDL_static_cast(Uint8, (C))) << 16) | \
(SDL_static_cast(Uint32, SDL_static_cast(Uint8, (D))) << 24))

/**
* \name Basic data types
*/
Expand Down

0 comments on commit e3302d9

Please sign in to comment.