MLV_window.h(3)
MLV_window.h(3) · Library Functions Manual 💅
okay bestie, sit down, hydrate, because this one is the window page and it's a whole thing. It's part 1 of 2, so don't go anywhere. Let's get into it. 🫶
🌸 NAME 🌸
MLV_window.h — this file defines the prototypes for all the functions that let you create, initialise, and close windows. that's it, that's the vibe. ✨
🎀 SYNOPSIS 🎀
🦋 Fonctions 🦋
here's the whole roster, no gatekeeping, every single one:
void MLV_create_window (const char *window_name, const char *icone_name, unsigned int width, unsigned int height)— makes a window where the size and the various names are handed to it as parameters.void MLV_create_window_with_default_font (const char *window_name, const char *icone_name, unsigned int width, unsigned int height, const char *path_to_font, unsigned int size_font)— same energy asMLV_create_window(), except you get to pick a specific font.void MLV_change_default_font (const char *path_to_font, unsigned int size_font)— changes the MLV library's default font.void MLV_create_full_screen_window (const char *window_name, const char *icone_name, unsigned int width, unsigned int height)— same asMLV_create_window(), but the window is configured in full screen mode.void MLV_create_full_screen_window_with_default_font (const char *window_name, const char *icone_name, unsigned int width, unsigned int height, const char *path_to_font, unsigned int size_font)— same asMLV_create_window(), but the window is configured in full screen mode.void MLV_enable_full_screen ()— displays the window in full screen.void MLV_disable_full_screen ()— turns the window's full screen mode off.int MLV_is_full_screen ()— checks whether you're in full screen mode or windowed mode.void MLV_change_window_size (unsigned int width, unsigned int height)— changes the window size.void MLV_change_window_caption (const char *window_name, const char *icone_name)— changes the titles of the main window.void MLV_get_window_size (unsigned int *width, unsigned int *height)— gives you back the window's height and width through the parameters.int MLV_get_window_height ()— returns the window's height.int MLV_get_window_width ()— returns the window's width.void MLV_clear_window (MLV_Color color)— wipes the window and replaces it with a monochrome of the colour you passed in.void MLV_free_window ()— closes the MLV library's window.void MLV_actualise_window ()— refreshes the window's display.void MLV_update_window ()— updates the window's display.void MLV_execute_at_exit (void(*function)(void *), void *data)— runs the callback function you passed in when the system sends a stop signal, or when the user clicks the little X on the window.void MLV_get_desktop_size (unsigned int *width, unsigned int *height)— gives you back the height and width of the computer's desktop environment through the parameters.int MLV_get_desktop_height ()— returns the height of the computer's desktop environment.int MLV_get_desktop_width ()— returns the width of the computer's desktop environment.
💫 Description détaillée 💫
This file defines the prototypes for the functions that let you create, initialise, and close windows. window management, but make it ✨documented✨.
👑 Auteur
- Adrien Boussicault
- Marc Zipstein
📖 Documentation des fonctions 📖
🌈 void MLV_actualise_window ()
Refreshes the window's display.
💜 Vois
See the function MLV_update_window.
When you use drawing functions, the changes you make are not visible. To actually show them, you have to use this function. no cap, the drawing is literally sitting there invisible until you call this. 😭
🌈 void MLV_change_default_font (const char * path_to_font, unsigned int size_font)
Changes the MLV library's default font.
This function changes the library's default font. Heads up bestie: it can only run after you've initialised the MLV library by creating a window with MLV_create_window(). Also, this function makes no sense if you don't actually want to switch fonts several times while your program runs. If you only ever use one font, it's better to tell the MLV library about it at window-creation time by using MLV_create_window_with_default_font() instead. periodt.
Paramètres
path_to_font— the path to a font in the'TrueType'standard (files with the.ttfextension).size_font— the size of the font.
🌈 void MLV_change_window_caption (const char * window_name, const char * icone_name)
Changes the titles of the main window.
Paramètres
window_name— the title that shows up on the window's bar.icone_name— the title that shows up in the task bar.
🌈 void MLV_change_window_size (unsigned int width, unsigned int height)
Changes the window size.
If the window is configured in full screen mode, the application stays in full screen mode. For the application to be in full screen, the window size has to be compatible with the screen resolution. And also, in full screen mode, the window size corresponds to the image resolution on the screen. it's giving "the window IS the screen" energy. 🦋
Paramètres
width— the window's width.height— the window's height.
Exemples
advanced/06_image.c, advanced/08_zone_click.c, et medium/08_full_screen.c.
🌈 void MLV_clear_window (MLV_Color color)
Wipes the window and replaces it with a monochrome of the colour you passed in.
Paramètres
color— the colour of the window background.
Exemples
advanced/07_transparency.c, advanced/09_animation.c, advanced/11_animation_book.c, beginner/08_mouse_keyboard_input_box_timer.c, beginner/09_colors.c, medium/01_keyboard_events.c, medium/02_mouse_events.c, medium/03_input_box_events.c, medium/04_events.c, medium/05_exit.c, medium/06_colors.c, medium/07_time.c, medium/08_full_screen.c, medium/10_mouse_or_keyboard_access.c, et medium/11_keys_codes.c.
🌈 void MLV_create_full_screen_window (const char * window_name, const char * icone_name, unsigned int width, unsigned int height)
Same as MLV_create_window(), but it configures the window in full screen mode.
Bogue
Same bugs as MLV_create_window().
Paramètres
window_name— the window's name.icone_name— the window icon's name.width— the window's width (in full screen mode, this value corresponds to the X coordinate of the image resolution).height— the window's height (in full screen mode, this corresponds to the Y coordinate of the image resolution).
🌈 void MLV_create_full_screen_window_with_default_font (const char * window_name, const char * icone_name, unsigned int width, unsigned int height, const char * path_to_font, unsigned int size_font)
Same as MLV_create_window(), but it configures the window in full screen mode.
Bogue
Same bugs as MLV_create_window().
Paramètres
window_name— the window's name.icone_name— the window icon's name.width— the window's width (in full screen mode, this value corresponds to the X coordinate of the image resolution).height— the window's height (in full screen mode, this corresponds to the Y coordinate of the image resolution).path_to_font— the path to a font in the'TrueType'standard (files with the.ttfextension).size_font— the size of the font.
🌈 void MLV_create_window (const char * window_name, const char * icone_name, unsigned int width, unsigned int height)
Makes a window where the size and the various names are handed to it as parameters.
This function initialises the MLV library. A given program cannot open more than one window at a time. The width and height parameters can potentially take negative values. In that case, the window is drawn in full screen. yes really, that's what it says. 🙈
Bogue
BOGUES WINDOWS ET MACOSX UNIQUEMENT 💀 Under Windows only, the window you create can't always be closed with the little X. Here's why: the MLV library implements an automatic window close when the user hits the X. But that mechanism uses SDL threads, which unfortunately aren't well supported under Windows and MacOSX. Basically, the MLV library uses a second thread to permanently pull every SDL event off the stack and process them as they show up. BUT under Windos and Mac OS X, since threads don't work, the library can't read system events like the window-close one. So it's no longer informed about what's happening. To let the library pick that info back up, you just have to ask for an event using the function:MLV_get_event(). That forces the MLV library to pop and process all the SDL events off the stack. The consequence is that the system event for the window closing gets processed too. In the implementation of the functionsMLV_wait_keyboard(),MLV_wait_mouse(), etc ..., we use theMLV_get_event()function. That's why the X works correctly when the program is waiting for information from the user.
Paramètres
window_name— the window's name.icone_name— the window icon's name.width— the window's width.height— the window's height.
Exemples
advanced/01_texts_and_boxes.c, advanced/02_font.c, advanced/04_sound.c, advanced/05_playlist.c, advanced/06_image.c, advanced/07_transparency.c, advanced/08_zone_click.c, advanced/09_animation.c, advanced/11_animation_book.c, beginner/01_hello_world.c, beginner/02_shapes.c, beginner/04_texts_and_boxes.c, beginner/05_mouse.c, beginner/06_keyboard.c, beginner/07_input_box.c, beginner/08_mouse_keyboard_input_box_timer.c, beginner/09_colors.c, beginner/10_library_informations.c, beginner/11_turtle.c, medium/01_keyboard_events.c, medium/02_mouse_events.c, medium/03_input_box_events.c, medium/04_events.c, medium/05_exit.c, medium/06_colors.c, medium/07_time.c, medium/08_full_screen.c, medium/09_keyboard_accents.c, medium/10_mouse_or_keyboard_access.c, medium/11_keys_codes.c, et medium/12_desktop_size.c.
🪟 MLV_create_window_with_default_font
void MLV_create_window_with_default_font (const char * window_name, const char * icone_name, unsigned int width, unsigned int height, const char * path_to_font, unsigned int size_font)
Bestie, this is literally the same vibe as MLV_create_window(), except you get to pick a specific font. 💅 It's giving custom typography era.
🐛 Bogue
Same bugs as MLV_create_window(). No cap, same energy. 💀
🎀 Paramètres
window_name— the name of the window.icone_name— the name of the window's icon.width— the width of the window.height— the height of the window.path_to_font— the path to a font in the 'TrueType' standard (files with the.ttfextension).size_font— the size of the font. the height of the window.
🖥️ MLV_disable_full_screen
void MLV_disable_full_screen ()
Disables the window's fullscreen mode. Back to windowed life, we love that for us. 🪟
✨ Exemples
medium/08_full_screen.c.
🌈 MLV_enable_full_screen
void MLV_enable_full_screen ()
Shows the window in fullscreen. ✨
The image resolution is then given by the size of the image. For the app to be fullscreen, the window size has to be compatible with the screen resolution. 🖥️ Vibe check your dimensions, bestie.
✨ Exemples
medium/08_full_screen.c.
🚪 MLV_execute_at_exit
void MLV_execute_at_exit (void(*)(void *) function, void * data)
Runs the callback function you passed in when the system sends a stop signal, or when the user clicks the little X on the window. 💀 Main character exit, but make it graceful.
The callback function is then executed with, as a parameter, a pointer to a data structure that's also passed as a parameter to MLV_execute_at_exit().
🎀 Paramètres
function— the pointer to the callback function that should be executed.data— the data to pass as a parameter to the callback function when it runs.
✨ Exemples
medium/05_exit.c.
🧹 MLV_free_window
void MLV_free_window ()
Closes the MLV library window. This function properly frees all the data that was created by the MLV library. 🫶 Cleanup queen behavior.
✨ Exemples
advanced/01_texts_and_boxes.c,advanced/02_font.c,advanced/04_sound.c,advanced/05_playlist.c,advanced/06_image.c,advanced/07_transparency.c,advanced/08_zone_click.c,advanced/09_animation.c,advanced/11_animation_book.c,beginner/01_hello_world.c,beginner/02_shapes.c,beginner/04_texts_and_boxes.c,beginner/05_mouse.c,beginner/06_keyboard.c,beginner/07_input_box.c,beginner/08_mouse_keyboard_input_box_timer.c,beginner/09_colors.c,beginner/10_library_informations.c,beginner/11_turtle.c,medium/01_keyboard_events.c,medium/02_mouse_events.c,medium/03_input_box_events.c,medium/04_events.c,medium/05_exit.c,medium/06_colors.c,medium/07_time.c,medium/08_full_screen.c,medium/09_keyboard_accents.c,medium/10_mouse_or_keyboard_access.c,medium/11_keys_codes.c, andmedium/12_desktop_size.c.
📐 MLV_get_desktop_height
int MLV_get_desktop_height ()
Returns the height of the computer's desktop environment. 🖥️ Know your space, bestie.
✨ Exemples
medium/12_desktop_size.c.
📏 MLV_get_desktop_size
void MLV_get_desktop_size (unsigned int * width, unsigned int * height)
Returns, in the parameters, the height and the width of the computer's desktop environment. 📐
🎀 Paramètres
width— the width of the desktop.height— the height of the desktop.
📐 MLV_get_desktop_width
int MLV_get_desktop_width ()
Returns the width of the computer's desktop environment. 🖥️
✨ Exemples
medium/12_desktop_size.c.
🪟 MLV_get_window_height
int MLV_get_window_height ()
Returns the height of the window. 📏
✨ Exemples
medium/08_full_screen.c.
📐 MLV_get_window_size
void MLV_get_window_size (unsigned int * width, unsigned int * height)
Returns, in the parameters, the height and the width of the window. 🪟
🎀 Paramètres
width— the width of the window.height— the height of the window.
🪟 MLV_get_window_width
int MLV_get_window_width ()
Returns the width of the window. 📏
✨ Exemples
medium/08_full_screen.c.
🖥️ MLV_is_full_screen
int MLV_is_full_screen ()
Tests whether the display is in fullscreen mode or in windowed mode. 👀 Sneaky little check.
🎀 Renvoie
Returns 1 if the display is in fullscreen mode, 0 otherwise.
✨ Exemples
medium/08_full_screen.c.
🔄 MLV_update_window
void MLV_update_window ()
Updates the window display. ✨
When you use drawing functions, the different changes you've made aren't visible. To show them, you have to use this function. 👑 This is the moment where your art actually appears, bestie.
✨ Exemples
advanced/01_texts_and_boxes.c,advanced/02_font.c,advanced/04_sound.c,advanced/05_playlist.c,advanced/06_image.c,advanced/07_transparency.c,advanced/08_zone_click.c,advanced/09_animation.c,advanced/11_animation_book.c,beginner/01_hello_world.c,beginner/02_shapes.c,beginner/04_texts_and_boxes.c,beginner/05_mouse.c,beginner/06_keyboard.c,beginner/07_input_box.c,beginner/08_mouse_keyboard_input_box_timer.c,beginner/09_colors.c,beginner/10_library_informations.c,medium/01_keyboard_events.c,medium/02_mouse_events.c,medium/03_input_box_events.c,medium/04_events.c,medium/05_exit.c,medium/06_colors.c,medium/07_time.c,medium/08_full_screen.c,medium/09_keyboard_accents.c,medium/10_mouse_or_keyboard_access.c,medium/11_keys_codes.c, andmedium/12_desktop_size.c.
👑 Auteur
Auto-generated by Doxygen for MLV-3.1.0 straight from the source code. 🤖✨ No human vibes were harmed in the making of this page.
okay bestie that's the whole MLV_window.h(3) page, and it's from MLV-3.1.0, dated Samedi 29 Janvier 2022 💖 slay, periodt, go write some windows ✨🌈👑
📦 where this page comes from
- ubuntu jammy: libmlv3-dev 3.1.0-7 · GPL-3.0-only
- 💖 girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms