MiniLibX(3)

πŸ“¦ version 0-unstable-2026-06, in nixpkgs unstable

🌸 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 β€” R
  • 15..8 β€” G
  • 7..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