mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-02-12 23:03:37 +00:00
7b6695f4d4be2032b8ec90b20b58809fe24c6a34
if all one needs is a raw framebuffer to the PSP's vram, instead of dealing with renderers and textures, that need to be copied hence and forth, this method allows one to create a window, set the pixel format using SDL_SetWindowDisplayMode() - preferably BGR565 for optimal speed (the other possible natively supported option is ABGR8888) - and then request SDL_GetWindowSurface(), which provides one with a surface with direct framebuffer access. note that the pixels pointer inside the surface will be switched after each call because of double-buffering. it's advisable to overwrite all pixels of the PSP visible area (480x272) to not encounter old data. after writing the pixels, a call to SDL_UpdateWindowSurface() sends the changes to the graphics chip. the result is a raw framerate of 250 fps with BGR565 mode, under optimal circumstances - i.e. nothing else is done than drawing, and the drawing loop is as simple as possible. that leaves about 12 ms per frame for other tasks and still allow a fluent 60 fps.
Simple DirectMedia Layer (SDL) Version 2.0
Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. It is used by video playback software, emulators, and popular games including Valve's award winning catalog and many Humble Bundle games.
More extensive documentation is available in the docs directory, starting with README.md
Enjoy!
Sam Lantinga (slouken@libsdl.org)
Languages
C
85.8%
C++
6.6%
Objective-C
3.4%
CMake
1.6%
Perl
0.7%
Other
1.6%