MLX42
1.0
MLX42
Loading...
Searching...
No Matches
mlx_monitor.c
Go to the documentation of this file.
1
/* ************************************************************************** */
2
/* */
3
/* :::::::: */
4
/* mlx_monitor.c :+: :+: */
5
/* +:+ */
6
/* By: W2Wizard <main@w2wizard.dev> +#+ */
7
/* +#+ */
8
/* Created: 2022/01/19 17:18:59 by W2Wizard #+# #+# */
9
/* Updated: 2022/06/27 20:02:38 by lde-la-h ######## odam.nl */
10
/* */
11
/* ************************************************************************** */
12
13
#include "
MLX42/MLX42_Int.h
"
14
15
//= Public =//
16
17
void
mlx_get_monitor_size
(
int32_t
index
,
int32_t
*
width
,
int32_t
*
height
)
18
{
19
MLX_ASSERT
(
index
>= 0,
"Index out of bounds"
);
20
MLX_NONNULL
(
width
);
21
MLX_NONNULL
(
height
);
22
23
*
width
= 0;
24
*
height
= 0;
25
26
int32_t
monitor_count
;
27
GLFWmonitor
**
monitors
=
glfwGetMonitors
(&
monitor_count
);
28
if
(
index
>
monitor_count
|| !
monitors
)
29
return
;
30
31
const
GLFWvidmode
*
vidmode
;
32
if
((
vidmode
=
glfwGetVideoMode
(
monitors
[
index
])))
33
{
34
*
width
=
vidmode
->width;
35
*
height
=
vidmode
->height;
36
}
37
}
MLX42_Int.h
MLX_NONNULL
#define MLX_NONNULL(var)
Definition
MLX42_Int.h:46
MLX_ASSERT
#define MLX_ASSERT(cond, msg)
Definition
MLX42_Int.h:45
index
GLuint index
Definition
glad.h:3345
height
GLint GLsizei GLsizei height
Definition
glad.h:1965
width
GLint GLsizei width
Definition
glad.h:1965
length
GLuint GLsizei GLsizei * length
Definition
glad.h:3372
mlx_get_monitor_size
void mlx_get_monitor_size(int32_t index, int32_t *width, int32_t *height)
Definition
mlx_monitor.c:17
lib
MLX42
src
mlx_monitor.c
Generated by
1.9.8