This repository has been archived on 2022-05-21. You can view files and clone it, but cannot push or open issues or pull requests.
LEFTONE/core/locommon/screen.h
falsycat 80b3b82332 [RELEASE] u22-v04
This version is submitted for U22 final presentation. (squashed 158 commits)
2021-02-07 00:00:00 +00:00

58 lines
1.1 KiB
C

#pragma once
#include <stdbool.h>
#include "util/math/matrix.h"
#include "util/math/vector.h"
typedef struct {
vec2_t resolution;
vec2_t dpi;
} locommon_screen_t;
bool
locommon_screen_valid(
const locommon_screen_t* screen
);
void
locommon_screen_calc_pixels_from_cm(
const locommon_screen_t* screen,
vec2_t* pixels,
const vec2_t* cm
);
void
locommon_screen_calc_pixels_from_inch(
const locommon_screen_t* screen,
vec2_t* pixels,
const vec2_t* inch
);
void
locommon_screen_calc_winpos_from_cm(
const locommon_screen_t* screen,
vec2_t* winpos,
const vec2_t* cm
);
void
locommon_screen_calc_winpos_from_inch(
const locommon_screen_t* screen,
vec2_t* winpos,
const vec2_t* inch
);
void
locommon_screen_calc_winpos_from_pixels(
const locommon_screen_t* screen,
vec2_t* winpos,
const vec2_t* pixels
);
void
locommon_screen_build_projection_matrix(
const locommon_screen_t* screen,
mat4_t* proj
);