Skip to content
Simple and Fast (using the GPU) 2D library for the PSVita system mode applications
C Other
  1. C 98.5%
  2. Other 1.5%
Branch: master
Clone or download
This branch is 125 commits ahead of xerpi:master.

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
libvita2d_sys
sample Switched to DolceSDK Apr 5, 2020
.gitignore
LICENSE First commit Jul 4, 2015
README.md Update README.md Apr 5, 2020

README.md

VITA2DLIB_SYS

Simple and Fast (using the GPU) 2D library for the PSVita system mode applications

Usage

This library is disigned to be used only with applications running in system mode. General usage is the same as standard vita2d. However, initialization proccess is different.

You can control shared fb directly from your application using the following:

SceUID vita2d_get_shfbid(); //Returns shared fb id opened by application.

- BMP textures can be used in all applications

- JPEG textures are decoded using hardware decoder. Make sure your application is allowed to use phycont memory

vita2d_JPEG_decoder_initialize();
/* Load your JPEG textures here */
vita2d_JPEG_decoder_finish();

- PNG textures can only be used in applications with "allow C heap" boot param != 0

- If you want to use dynamic memory allocation in your application and "allow C heap" boot param is set to 0, sceClibMspace functions must be used

Initialization

To initialize vita2d_sys in your application following must be done. Minimum value for CLIB_HEAP_SIZE is 1MiB.

void *mspace;
void *clibm_base;
SceUID clib_heap = sceKernelAllocMemBlock("ClibHeap", SCE_KERNEL_MEMBLOCK_TYPE_USER_RW_UNCACHE, CLIB_HEAP_SIZE, NULL);
sceKernelGetMemBlockBase(clib_heap, &clibm_base);
mspace = sceClibMspaceCreate(clibm_base, CLIB_HEAP_SIZE);

vita2d_clib_pass_mspace(mspace);

vita2d_init();

Drawing process

vita2d_start_drawing();
.
.
.
vita2d_end_drawing();
vita2d_wait_rendering_done();
vita2d_end_shfb();
You can’t perform that action at this time.