From c5dfbaf890d571403e9ab85ab07d025feb7bf655 Mon Sep 17 00:00:00 2001 From: SemvdH Date: Mon, 19 Apr 2021 23:30:48 +0200 Subject: [PATCH] [EDIT] add build files to gitignore --- .gitignore | 9 +++++++- src/main.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 66 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 35206de..5e7cac0 100644 --- a/.gitignore +++ b/.gitignore @@ -85,4 +85,11 @@ CMakeUserPresets.json # End of https://www.toptal.com/developers/gitignore/api/c,vscode,cmake build -build/** \ No newline at end of file +build/** + +#project build files +cybershot +cybershot.self +cybershot.velf +cybershot.vpk +cybershot.vpk_param.sfo \ No newline at end of file diff --git a/src/main.c b/src/main.c index 3983407..3c89acd 100644 --- a/src/main.c +++ b/src/main.c @@ -1,19 +1,69 @@ -#include -#include #include +#include +#include +#include + +#include +#include + #include -#include "debugScreen.h" - +// 14 april 2021: 11:00-15:00 #define printf psvDebugScreenPrintf -int main(int argc, char *argv[]) { +// extern unsigned char _binary_image_png_start; + +int main(int argc, char *argv[]) +{ + + SceCtrlData pad; + vita2d_pgf *pgf; + vita2d_pvf *pvf; + // vita2d_texture *image; + vita2d_init(); - psvDebugScreenInit(); - printf("Hello, world!\n"); + vita2d_set_clear_color(RGBA8(0x40, 0x40, 0x40, 0xFF)); + + pgf = vita2d_load_default_pgf(); + pvf = vita2d_load_default_pvf(); + + /* + * Load the statically compiled image.png file. + */ + // image = vita2d_load_PNG_buffer(&_binary_image_png_start); + + memset(&pad, 0, sizeof(pad)); + + while (1) + { + sceCtrlPeekBufferPositive(0, &pad, 1); + + if (pad.buttons & SCE_CTRL_START) + break; + + vita2d_start_drawing(); + vita2d_clear_screen(); + + // vita2d_draw_texture(image, 100, 100); + + vita2d_pgf_draw_text(pgf, 700, 30, RGBA8(0,255,0,255), 1.0f, "PGF Font sample!"); + + vita2d_pvf_draw_text(pvf, 700, 80, RGBA8(0,255,0,255), 1.0f, "PVF Font sample!"); - sceKernelDelayThread(3*1000000); // Wait for 3 seconds + vita2d_end_drawing(); + vita2d_swap_buffers(); + } + + /* + * vita2d_fini() waits until the GPU has finished rendering, + * then we can free the assets freely. + */ + vita2d_fini(); + // vita2d_free_texture(image); + vita2d_free_pgf(pgf); + vita2d_free_pvf(pvf); + sceKernelExitProcess(0); return 0; }