MiniLibX(3)
πΈ MiniLibX(3) β drawing inside windows, bestie πΈ
okay so this is the MiniLibX(3) page from the Library Functions Manual, and it's literally about drawing inside windows. no cap, we're keeping every detail. let's go π β¨
π NAME π
MiniLibX β drawing inside windows. that's the whole name section, short and iconic π
β¨ SYNOPSYS β¨
(yes bestie, the page spells it SYNOPSYS β not me, that's just what's here π)
int
mlx_pixel_put ( void *mlx_ptr, void *win_ptr, int x, int y, int color );
int
mlx_string_put ( void *mlx_ptr, void *win_ptr, int x, int y, int color,
char *string );
π¨ DESCRIPTION π¨
okay so mlx_pixel_put() draws a defined pixel in the window win_ptr using the ( x , y ) coordinates and the specified color. the origin (0,0) is the upper left corner of the window β the x and y axis respectively point right and down. the connection identifier, mlx_ptr, is needed (see the mlx man page). π«Ά
parameters for mlx_string_put() have the same meaning. instead of a simple pixel, the specified string will be displayed at ( x , y ). π
in both functions, it is impossible to display anything outside the specified window, nor display in another window in front of the selected one. that's the rule, bestie π«πͺ
π COLOR MANAGEMENT π
the color parameter has an integer type. the displayed color needs to be encoded in this integer, following a defined scheme. all displayable colors can be split in 3 basic colors: red, green and blue. three associated values, in the 0-255 range, represent how much of each color is mixed up to create the original color. these three values must be set inside the integer to display the right color. the three least significant bytes of this integer are filled as shown in the picture below: π
Color Integer
31..24 23..16 15..8 7..0
Ξ± R G B
so the interpretation slots line up like this:
31..24βΞ±23..16βR15..8βG7..0βB
while filling the integer, make sure you avoid endian problems. remember that the "blue" byte should always be the least significant one. this is the part where you do not get cute with byte order, bestie π
π SEE ALSO π
π AUTHOR π
Copyright ol@ - 2002-2014 - Olivier Crouzet
okay that's the whole page, bestie π source/version situation: this is the MiniLibX(3) manual, dated September 19, 2002. go draw something iconic and make it main character energy ππ¦ππ«Ά
π¦ where this page comes from
- nixpkgs unstable: minilibx 0-unstable-2026-06-20
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms