diff options
author | Rinnegatamante | 2017-06-15 11:36:33 +0200 |
---|---|---|
committer | Sunguk Lee | 2017-06-15 18:36:33 +0900 |
commit | b5646d6867a3c279e0a7f5b3db42678f84d7ff15 (patch) | |
tree | b625c863cf3657b5901523e438bddb8330c10a74 /include/user/display.h | |
parent | Removed next entry (diff) | |
download | vds-libraries-b5646d6867a3c279e0a7f5b3db42678f84d7ff15.tar.gz |
Named anonymous enums in psp2. (#179)
* Named anonymous enums in psp2.
Named anonymous enums in psp2.
* Properly sorted enums.
* Several modifications (see desc)
Added some missing info, fixed identation in some places, aligned all
enums and comments with spaces as delimiters, replaced decimal negative
errorcode in location.h with hexadecimal one, added some comments and
fixed some documentation comments.
* Minor fixes in identation.
* Yet another minor identation fix.
* Fixed enums in structs.
* Reverted SceBool changes.
* SceBool fix.
* Fix for compilation with g++-
* Added some doc references in jpegenc.
* Fixed some references.
Diffstat (limited to 'include/user/display.h')
-rw-r--r-- | include/user/display.h | 60 |
1 files changed, 31 insertions, 29 deletions
diff --git a/include/user/display.h b/include/user/display.h index 84d1887..58a08d2 100644 --- a/include/user/display.h +++ b/include/user/display.h @@ -7,55 +7,57 @@ extern "C" { #endif -enum { - SCE_DISPLAY_ERROR_OK = 0, - SCE_DISPLAY_ERROR_INVALID_HEAD = 0x80290000, - SCE_DISPLAY_ERROR_INVALID_VALUE = 0x80290001, - SCE_DISPLAY_ERROR_INVALID_ADDR = 0x80290002, - SCE_DISPLAY_ERROR_INVALID_PIXELFORMAT = 0x80290003, - SCE_DISPLAY_ERROR_INVALID_PITCH = 0x80290004, - SCE_DISPLAY_ERROR_INVALID_RESOLUTION = 0x80290005, - SCE_DISPLAY_ERROR_INVALID_UPDATETIMING = 0x80290006, - SCE_DISPLAY_ERROR_NO_FRAME_BUFFER = 0x80290007, - SCE_DISPLAY_ERROR_NO_PIXEL_DATA = 0x80290008 -}; - -#define SCE_DISPLAY_PIXELFORMAT_A8B8G8R8 0x00000000U - -enum { +typedef enum SceDisplayErrorCode { + SCE_DISPLAY_ERROR_OK = 0, + SCE_DISPLAY_ERROR_INVALID_HEAD = 0x80290000, + SCE_DISPLAY_ERROR_INVALID_VALUE = 0x80290001, + SCE_DISPLAY_ERROR_INVALID_ADDR = 0x80290002, + SCE_DISPLAY_ERROR_INVALID_PIXELFORMAT = 0x80290003, + SCE_DISPLAY_ERROR_INVALID_PITCH = 0x80290004, + SCE_DISPLAY_ERROR_INVALID_RESOLUTION = 0x80290005, + SCE_DISPLAY_ERROR_INVALID_UPDATETIMING = 0x80290006, + SCE_DISPLAY_ERROR_NO_FRAME_BUFFER = 0x80290007, + SCE_DISPLAY_ERROR_NO_PIXEL_DATA = 0x80290008 +} SceDisplayErrorCode; + +typedef enum SceDisplayPixelFormat { + SCE_DISPLAY_PIXELFORMAT_A8B8G8R8 = 0x00000000U +} SceDisplayPixelFormat; + +typedef enum SceDisplaySetBufSync { /** Buffer change effective immediately */ SCE_DISPLAY_SETBUF_IMMEDIATE = 0, /** Buffer change effective next frame */ SCE_DISPLAY_SETBUF_NEXTFRAME = 1 -}; +} SceDisplaySetBufSync; /** - * Structure used with sceDisplaySetFrameBuf to set/update framebuffer. + * Structure used with ::sceDisplaySetFrameBuf to set/update framebuffer. * Original screen resolution is 960x544, but the following resolutions * can also be supplied as width and height : * 480x272, 640x368, 720x408 * - * @note - This structure is returned by sceDisplayGetFrameBuf + * @note - This structure is returned by ::sceDisplayGetFrameBuf */ typedef struct SceDisplayFrameBuf { - SceSize size; //!< sizeof(SceDisplayFrameBuf) - void *base; //!< Pointer to framebuffer - unsigned int pitch; //!< pitch pixels - unsigned int pixelformat; //!< use SCE_DISPLAY_PIXELFORMAT_A8B8G8R8 - unsigned int width; //!< framebuffer width - unsigned int height; //!< framebuffer height + SceSize size; //!< sizeof(SceDisplayFrameBuf) + void *base; //!< Pointer to framebuffer + unsigned int pitch; //!< pitch pixels + unsigned int pixelformat; //!< pixel format (one of ::SceDisplayPixelFormat) + unsigned int width; //!< framebuffer width + unsigned int height; //!< framebuffer height } SceDisplayFrameBuf; /** * Set/Update framebuffer parameters * * @param[in] pParam - Pointer to a ::SceDisplayFrameBuf structure. - * @param[in] sync - One of ::DisplaySetBufSync + * @param[in] sync - One of ::SceDisplaySetBufSync * * @return 0 on success, < 0 on error. * @note - If NULL is provided as pParam pointer, output is blacked out. */ -int sceDisplaySetFrameBuf(const SceDisplayFrameBuf *pParam, int sync); +int sceDisplaySetFrameBuf(const SceDisplayFrameBuf *pParam, SceDisplaySetBufSync sync); /** * Get current framebuffer parameters @@ -63,11 +65,11 @@ int sceDisplaySetFrameBuf(const SceDisplayFrameBuf *pParam, int sync); * @param[out] pParam - Pointer to a ::SceDisplayFrameBuf structure * which will receive framebuffer parameters. * - * @param[in] sync - One of ::DisplaySetBufSync + * @param[in] sync - One of ::SceDisplaySetBufSync * * @return 0 on success, < 0 on error. */ -int sceDisplayGetFrameBuf(SceDisplayFrameBuf *pParam, int sync); +int sceDisplayGetFrameBuf(SceDisplayFrameBuf *pParam, SceDisplaySetBufSync sync); /** * Get current number of fps for the current screen mode. |