MLX42 1.0
MLX42
Loading...
Searching...
No Matches
mlx_put_pixel.c
Go to the documentation of this file.
1/* ************************************************************************** */
2/* */
3/* :::::::: */
4/* mlx_put_pixel.c :+: :+: */
5/* +:+ */
6/* By: W2Wizard <main@w2wizard.dev> +#+ */
7/* +#+ */
8/* Created: 2021/12/28 03:30:13 by W2Wizard #+# #+# */
9/* Updated: 2022/06/29 16:00:30 by lde-la-h ######## odam.nl */
10/* */
11/* ************************************************************************** */
12
13#include "MLX42/MLX42_Int.h"
14
15// BUG: Linux may experience a red hue instead due to endianness
17{
18 *(pixel++) = (uint8_t)(color >> 24);
19 *(pixel++) = (uint8_t)(color >> 16);
20 *(pixel++) = (uint8_t)(color >> 8);
21 *(pixel++) = (uint8_t)(color & 0xFF);
22}
23
24//= Public =//
25
27{
29 MLX_ASSERT(x < image->width, "Pixel is out of bounds");
30 MLX_ASSERT(y < image->height, "Pixel is out of bounds");
31
32 uint8_t* pixelstart = &image->pixels[(y * image->width + x) * BPP];
34}
#define MLX_NONNULL(var)
Definition MLX42_Int.h:46
#define BPP
Definition MLX42_Int.h:42
#define MLX_ASSERT(cond, msg)
Definition MLX42_Int.h:45
GLint y
Definition glad.h:1965
GLint GLsizei GLsizei height
Definition glad.h:1965
GLint GLsizei width
Definition glad.h:1965
GLuint color
Definition glad.h:3749
GLdouble x
Definition glad.h:2847
GLenum GLenum GLsizei void * image
Definition glad.h:5132
GLuint GLsizei GLsizei * length
Definition glad.h:3372
void mlx_put_pixel(mlx_image_t *image, uint32_t x, uint32_t y, uint32_t color)
void mlx_draw_pixel(uint8_t *pixel, uint32_t color)