Coder Social home page Coder Social logo

minilibx's Introduction

Minilibx is a very basic graphical library written in C used in 42 and in Epitech for infography project.

Steps :

Update/upgrade your system:

  • apt-get update
  • apt-get upgrade

Install the following packages:

  • apt install libx11-dev
  • apt install libxext-dev
  • apt install libbsd-dev
  • apt install clang

Get minilibx sources:

git clone https://github.com/42Paris/minilibx-linux minilibx_linux

Compile and install mlx.a in minilibx_linux with

  • cd minilibx_linux; make && sudo ./configure

Change MLXFLAGS in your makefile to:

  • MLXFLAG = -lmlx -lXext -lX11

Notes for windows

* install ubuntu terminal (or other distribution linux ) on windows 10 from windows store

* do the previous steps + you have to install gcc and make

Graphical programs

to run graphical programs on your windows 10 desktop

you need a GUI server, such as X11. Such doesn’t not exist for Windows,

but there are alternatives, one of which is Xming, which can be downloaded

free of charge, from SourceForge (set private when ask)

then enable bash to use xming which can be done by typing the following line

echo "export DISPLAY=localhost:0.0" >> ~/.bashrc

its preferable to launch xming automatically after boot, move xming program to the following repo:

  • C:\Users\login\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
  • after adding variables such DISPLAY, open a new bash session by typing
 bash

or

 source ~/.bashrc

Extra notes:

  • the process is explained using bash shell, you should modify it by whatever shell you are using (zsh, sh, ..)
  • for events management, the mask should be (1L << 0) instead of 0
mlx_hook(p.win_ptr, 2, (1L << 0), ft_event_keys, &p);
  • to simplify the usage of keys macros in mac os and linux, include key_macos.h and key_linux.h files:
# if defined(__APPLE__)
#  include <key_macos.h>
# else
#  include <key_linux.h>
# endif

Docker image

based on alpine: ilkou/minilibx or ilkou/minilibx:1.0.0

based on ubuntu: ilkou/minilibx:ubuntu

minilibx's People

Contributors

driwand avatar ilkou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.