Giter Club home page Giter Club logo

smlx's Introduction

smlx

Description: - This Library is sketcher extend from minilibx_macos(made by Olivier Crouzet) which handle multiples windows and trigger customizable events (like keyboard and mouse)

Requirements:

- libft --> (git clone https://[email protected]/lloyet/libft.git)
- minilibx_macos --> (git clone https://[email protected]/lloyet/minilibx.git)
- libhook --> (git clone https://[email protected]/lloyet/libhook.git)
- payload --> (git clone https://[email protected]/lloyet/payload.git)

Features:

- Handle customizable windows (width, heigh)
- Trigger keyboard and mouse events with key statements and edge.
- Handle User's event function from separte windows

How To:

- IMAGE:

	1) Create an image define by the width and heigh (By default the image dock at x:0 and y:0):

		t_image			*new_image(void *mlx_id, int width, int heigh);

	2) Modify docking position into the window:

		void			image_dock(t_image *img, int x, int y);

	3) Draw a pixel into an image or fill it:

		void			image_pixel_put(t_image *img, int x, int y, int color);
		void			image_fill(t_image *img, int color);

- WINDOWS:

	1) Create (NOT OPEN) a window from the background image:

		t_window		*new_window(t_image *bg, char *title, int (*event)(void*), void *param);


	2) Add or remove an image to/from a window:

		void			window_add_image(t_window *win, t_image *img);
		void			window_del_image(t_window *win, t_image *img);

	3) Refresh image stack of a window

		void			window_refresh(t_window *win);

	4) Refresh window's loop event

		void			window_loop_event(t_window *win);


- SMLX:

	1) Create sketch framework:

		t_smlx			*new_smlx(void);

	2) Initalize framework:

		int				smlx_init(t_smlx *smlx, t_window *win);

	3) Open And Close Windows previously created with exemples explain before:

		void			smlx_open_window(t_smlx *smlx, t_window *win);
		void			smlx_close_window(t_smlx *smlx, t_window *win);

	4) Destroy smlx's framework:

		void			smlx_destroy(t_smlx *smlx);

smlx's People

Watchers

Louis Loyet avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.