diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2022-10-10 19:16:21 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2022-10-10 19:33:40 -0700 |
commit | 8feec5ee3ba551859d787f077d797bc1b19d4dc2 (patch) | |
tree | abde1ce7da1a0215dce95d1f6e16e21b680b1df6 /src/sars.h | |
parent | 26f569299d6769cff6edf024c68df83732715392 (diff) |
sars: add ndc->bpc conversion helpers
bpc = boxed projection coordinates, this basically comes from eon just
like the pillar/letter boxing code for fullscreen stuff did.
Previously I didn't need this part of that code, but the touch
coordinates are in ndc and those need to get transformed by the
projection transform's inverse.
Diffstat (limited to 'src/sars.h')
-rw-r--r-- | src/sars.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -45,6 +45,7 @@ typedef struct sars_t { sars_winmode_t winmode; m4f_t projection_x; + m4f_t projection_x_inv; } sars_t; void sars_canvas_size(sars_t *sars, int *res_width, int *res_height); @@ -53,6 +54,8 @@ void sars_canvas_from_ndc(sars_t *sars, float x, float y, int *res_x, int *res_y void sars_viewport_size(sars_t *sars, int *res_width, int *res_height); void sars_viewport_to_ndc(sars_t *sars, int x, int y, float *res_x, float *res_y); void sars_viewport_from_ndc(sars_t *sars, float x, float y, int *res_x, int *res_y); +void sars_ndc_to_bpc(sars_t *sars, float x, float y, float *res_x, float *res_y); +void sars_viewport_to_bpc(sars_t *sars, int x, int y, float *res_x, float *res_y); uint32_t sars_viewport_id(sars_t *sars); void sars_render(play_t *play, void *context); void sars_dispatch(play_t *play, void *context, SDL_Event *event); |