Rewritten version of the MiniLibX graphics API used by 42, using glfw & glad. Running on OpenGL.

Overview

42MLX_Logo
Written by W2.Wizard for the 42 Network

License GPL2.0 Linux MacOS Windows Build Forks

A recreation of the MiniLibX library used by 42, using GLFW & glad, running on OpenGL. The goal of MLX42 is to replace the outdated and stale MiniLibX library.

For information and documentation about MLX42 check the wiki.

Differences to MiniLibX

Cross-Platform

The main idea of MLX42 is to be a cross-platform graphics interface. In 42 everything runs (currently) on MacOS, but it's very useful to be able to work remotely on different machines. With MiniLibX this is not possible.

Documented

Almost all functions and types are fully documented giving you a clue as to how to approach and use the library. No more guessing and searching how something functions or is supposed to work.

Custom XPM (XPM42) format

A custom simple to use XPM-like format which has some minor differences to the XPM3 format.

Almost identical usage to MiniLibX

Switching to MLX42 from MiniLibX is not a lot of work, most features present in MiniLibX are also present in MLX42, albeit with different prototypes.

Installation

In the very end a library is generated, compile your program with this library!

For MacOS:

  1. Download MLX42
~ git clone https://github.com/codam-coding-college/MLX42.git

Via Homebrew / Homebrew42 by building from source.

  1. Install GLFW
~ brew update
➜  ~ brew install glfw
  1. Compile MLX42
~ cd MLX42
➜  ~ make
  1. Compile Program With the normal brew version you can now simply compile the program with:
~ gcc main.c libmlx42.a -lglfw ...

You might have to specify the location explicitly:

~ gcc main.c libmlx42.a -lglfw -L /opt/homebrew/Cellar/glfw/3.3.6/lib/

However, with 42Homebrew you have additionally specify the location of the library like here:

~ gcc main.c libmlx42.a -I include -lglfw -L "/Users/$USER/.brew/opt/glfw/lib/"

Pre-compiled libraries

  1. Download the binaries directly here.

  2. If possible move the contents of lib and include of GLFW to /usr/local/lib and /usr/local/include respectively. If not possible, move the lib file to the root of MLX42 and move the GLFW directory in include to the include of MLX42. NOTE: For the lib choose the appropriate .a & .dylib file depending on your architecture.

  3. Compile MLX42

~ cd MLX42
➜  ~ make

When compiling with the static library, directly you should compile your program like this:

~ gcc main.c libmlx42.a libglfw3.a ... -framework Cocoa -framework OpenGL -framework IOKit

Else, simply compile like this:

~ gcc main.c libmlx42.a -lglfw ...
  1. Run

In case of any security warnings or MacOS telling you it can't verify the author/developer, go to Settings > Security & Privacy. There will be a pop-up at the bottom telling you that an application tried to run, click the option to let it run.

For Linux:

NOTE: This will not run with Windows Subsystem for Linux (WSL)!!!

  1. Install the necessary packages:
~ sudo apt update
➜  ~ sudo apt install build-essential libx11-dev libglfw3-dev libglfw3 xorg-dev

NOTE: For arch-linux you might also have to do sudo apt install glfw-x11 if available.

  1. Download MLX42 & Build
~ git clone https://github.com/codam-coding-college/MLX42.git
➜  ~ cd MLX42
➜  ~ make
  1. Create a main.c file, include MLX42/MLX42.h, compile with -ldl -lglfw , make sure to also do -I <include_path>.

  2. Run.

The systems below have not been tested yet.

For Windows:

  1. Download & Install MinGW: Here!

  2. Simply click continue, select whatever your choice is. Once reaching the MinGW Installation Manager select:

    • mingw32-base
    • mingw32-gcc-g++
  3. Apply by going to Installation > Apply Changes, after it's done, you may close the window.

  4. Download & Install CMake: Here!, use the installer. Simply select all default options.

  5. Download & Install GnuWin: Here!

  6. If you used all default options, add these paths to your SYSTEM Environment variables:

  • C:\MinGW\bin
  • C:\Program Files\CMake\bin
  • C:\Program Files (x86)\GnuWin32\bin
  1. Download GLFW: https://www.glfw.org/download.html

  2. Open the terminal and type cmake-gui, select the downloaded/extracted source folder, select any place you want the build output to be.

  3. Click on configure once and select the MinGW Makefiles, then finish.

  4. Set the CMAKE_INSTALL_PREFIX to C:/GLFW

  5. Click on configure again, and then generate.

  6. Go to the build directory and do:

  • make
  • make install
  1. Go to the directory you assigned in Step 10. Copy the GLFW folder in the include folder to C:\MinGW\include & copy the .a file in the lib folder to C:\MinGW\lib.

  2. Compile your program with these flags:

  • -lglfw3
  • -lopengl32
  • -lgdi32

In the end you should have something like:

~ gcc main.c <Additional .c Files> libmlx42.a -lglfw3 -lopengl32 -lgdi32
  1. Run.

Example

MLX42

/* ************************************************************************** */
/*                                                                            */
/*                                                        ::::::::            */
/*   main.c                                             :+:    :+:            */
/*                                                     +:+                    */
/*   By: W2Wizard <[email protected]>              +#+                     */
/*                                                   +#+                      */
/*   Created: 2022/01/31 00:40:08 by W2Wizard      #+#    #+#                 */
/*   Updated: 2022/01/31 00:41:56 by W2Wizard      ########   odam.nl         */
/*                                                                            */
/* ************************************************************************** */

#include "MLX42/MLX42.h"
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <memory.h>
#define WIDTH 256
#define HEIGHT 256

mlx_image_t	*g_img;

void	hook(void *param)
{
	mlx_t	*mlx;

	mlx = param;
	if (mlx_is_key_down(param, MLX_KEY_ESCAPE))
		mlx_close_window(param);
	if (mlx_is_key_down(param, MLX_KEY_UP))
		g_img->instances[0].y -= 5;
	if (mlx_is_key_down(param, MLX_KEY_DOWN))
		g_img->instances[0].y += 5;
	if (mlx_is_key_down(param, MLX_KEY_LEFT))
		g_img->instances[0].x -= 5;
	if (mlx_is_key_down(param, MLX_KEY_RIGHT))
		g_img->instances[0].x += 5;
}

int32_t	main(void)
{
	mlx_t	*mlx;

	mlx = mlx_init(WIDTH, HEIGHT, "MLX42", true);
	if (!mlx)
		exit(EXIT_FAILURE);
	g_img = mlx_new_image(mlx, 128, 128);
	memset(g_img->pixels, 255, g_img->width * g_img->height * sizeof(int));
	mlx_image_to_window(mlx, g_img, 0, 0);
	mlx_loop_hook(mlx, &hook, mlx);
	mlx_loop(mlx);
	mlx_terminate(mlx);
	return (EXIT_SUCCESS);
}
Comments
  • try to fix the buildwin check

    try to fix the buildwin check

    as @W2Wizard mentioned here https://github.com/codam-coding-college/MLX42/pull/63#issuecomment-1326371020, the thing that downloads mingw for the buildwin check is kinda broken, this is my attempt to fix it

    Invalid 
    opened by Jeroenvh99 3
  • fix compile on Linux (attempt 2)

    fix compile on Linux (attempt 2)

    I fixed it by changing the type to int32_t, instead of the suggested uint32_t, as glfwGetWindowSize(GLFWwindow* window, int* width, int* height); uses signed ints, therefore it seems to it makes more sense to change it to an int32_t. Plus less things to change to the codebase. Cheers!

    (See also #36)

    Fix 
    opened by joppiesaus 3
  • Use uint8_t instead of int since the pixels are uint8_t

    Use uint8_t instead of int since the pixels are uint8_t

    The only reason the int type worked is because coincidentally each pixel is four bytes, but it could've just as well been any other number of bytes.

    It might be desirable to introduce a constant for the 4/sizeof(uint8_t) * 4 like BYTES_PER_PIXEL instead.

    Documentation 
    opened by MyNameIsTrez 3
  • Makefile cleanup and fixes

    Makefile cleanup and fixes

    • Add helper function mlx_getline for cross platfrom line reading (getline is not a standard library function and therefor not on windows)
    • Add recursive Makefile wildcard function that replaces both windows's dir and unix's find commands (fixes #23)
    • Add generic rule for "compiling" shaders
    • Centralise source file variables to top Makefile
    • Fix issue preventing re rule from being used with multi-threading
    • Fix typo in variable comparison for generic homebrew path libglfw location
    • Switch windows CI/CD from Cygwin to MinGW
    • Switch most variables to simply expanded variables possibly improving performance by a bit
    • Remove comma's from .PHONY
    • Move #!/bin/bash to the top of compile_shaders.sh
    • Always override HEADERS variable
    • Use windows's intended way of print a blank line with echo
    Fix Improvement 
    opened by Eathox 3
  • fix compile on Linux with GCC

    fix compile on Linux with GCC

    Previously it would output the following error:

    src/mlx_window.c: In function ‘mlx_update_matrix’:
    src/mlx_window.c:30:74: error: operand of ‘?:’ changes signedness from ‘int32_t’ {aka ‘int’} to ‘uint32_t’ {aka ‘unsigned int’} due to unsignedness of other operand [-Werror=sign-compare]
       30 |         width = mlx_settings[MLX_STRETCH_IMAGE] ? mlxctx->initialWidth : mlx->width;
          |                                                                          ^~~~~~~~~~
    src/mlx_window.c:31:76: error: operand of ‘?:’ changes signedness from ‘int32_t’ {aka ‘int’} to ‘uint32_t’ {aka ‘unsigned int’} due to unsignedness of other operand [-Werror=sign-compare]
       31 |         height = mlx_settings[MLX_STRETCH_IMAGE] ? mlxctx->initialHeight : mlx->height;
          |                                                                            ^~~~~~~~~~~
    

    This fix casts an unsigned int to an int. the maintainer should take into consideration whether this will cause errors as it can overflow when the value is insanely high. Maybe change the types??? idk

    System details:

    uname -a: Linux codam 5.13.0-48-generic #54-Ubuntu SMP Wed Jun 1 20:38:48 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
    gcc --version: gcc (Ubuntu 11.2.0-7ubuntu2) 11.2.0
    

    Have a nice one!

    Fix 
    opened by joppiesaus 2
  • [BUG] dependent find variable under Linux

    [BUG] dependent find variable under Linux

    while trying to build your library the makefile for Linux was trying to execute find with an absolute path: https://github.com/W2Codam/MLX42/blob/5b5140f9c8b29381b9bcc84a185bad9e2f072aeb/Makefile_Unix.mk#L26 while this work for cygwin certain linux distribution could have there executable somewhere else like Nixos in my case ; this can cause a "file not found" i made a possible solution to this:

    DETECTED_OS := $(shell uname -s)
    
    ifeq ($(DETECTED_OS),Linux)
    
    FIND=find
    
    else
    
    FIND=/usr/bin/find
    
    endif
    
    SHDR	=	src/mlx_vert.c src/mlx_frag.c
    
    SHDRSRC=	shaders/default.frag shaders/default.vert
    
    LIBS	=	$(shell $(FIND) ./lib -iname "*.c")
    
    SRCS	=	$(shell $(FIND) ./src -iname "*.c") $(SHDR) $(LIBS)
    
    

    why: i was about to package your library in a nix package so it can be deployed easly with certain version

    Bug 
    opened by Kampouse 2
  • [BUG] Function passed to mlx_key_hook() seems to get called twice.

    [BUG] Function passed to mlx_key_hook() seems to get called twice.

    Description Function passed to mlx_key_hook() seems to be called twice, when only one key press has occurred.

    To Reproduce

    static void	keycodes(mlx_key_data_t keydata, void *param)
    {
    	if (param)
    		;
    	ft_printf("%c\n", keydata.key);
    }
    
    int	gameloop(t_reality *reality)
    {
    	mlx_key_hook(reality -> mlx, keycodes, NULL);
    	mlx_loop(reality -> mlx);
    	return (TRUE);
    }
    

    Expected behavior When key is pressed, given function to mlx_key_hook() should only run once.

    Desktop

    • OS: Error occurs on MacOS and Arch Linux

    Apologies if this issue is caused by a misunderstanding of the use of hooks.

    Question 
    opened by sdxsd 2
  • Replace compile_shader script with bash variant

    Replace compile_shader script with bash variant

    Replaced the python script used to "compile" the shader C files with a bash variant that does exactly the same. No longer is python required for building.

    Request 
    opened by FreekBes 2
  • Inconsistencies in private/public functions

    Inconsistencies in private/public functions

    There are some inconsistencies in the use of //= private =// and //= public =//. I think the private functions are all static and the public functions are all non-static.

    opened by Jeroenvh99 1
  • Made `mlx_errno_t` -> Error string mapping more explicit

    Made `mlx_errno_t` -> Error string mapping more explicit

    This makes it easier to debug an error.

    Downside is that it is not compatible with C++ because this is one of the few features from C that C++ does not support.

    Improvement 
    opened by Tishj 1
  • Back to using faster `mlx_lstadd_front`

    Back to using faster `mlx_lstadd_front`

    Calling mlx_lstadd_front without sorting first created visual issues when users didn't set depth values to their instances. By setting sort_queue to true those issues are resolved. Using mlx_lstadd_front is way more performant than the previous mlx_lstadd_back.

    Fix 
    opened by MyNameIsTrez 1
  • Make a more descriptive functionname and reformulate some documentation

    Make a more descriptive functionname and reformulate some documentation

    @W2Wizard did I do the branching thing correctly? in this PR I've micro-optimized the mlx_equal functions, because the copying of the arguments isn't really necessary, but I'm not really sure if this is actually a good optimization, see my question in discussion #66. my main goal of this PR was to practice with making my edits on a new branch, so if the optimization doesn't have an effect you can just ignore this.

    opened by Jeroenvh99 3
  • [BUG] Recursive Make calls not working

    [BUG] Recursive Make calls not working

    NOTE I was trying to setup your library (Great Job btw) on my project but in didnt work compile with the recursive call of make (Make -C folder/).

    Describe the bug The command "Make -C" with the library return highly inconsistent result. Either not compiling every file or trying to compile file in folder ending in .c which does not work. And Make -C fclean does the same

    To Reproduce

    1. Clone the library
    2. Execute "Make -C MLX42"
    3. Execute "Make -C MLX42 fclean"
    4. Repeat multiple times 2 and 3 to see the inconsistencies.

    Expected behavior "Make -C MLX42" will not compile every file each times. It will either only compile the shader files (alias frag_shader and vert_shader) or all files. Make

    "Make -C MLX42 fclean" will delete everyfile but sometimes it will try to delete "src/mlx_cursor.c/mlx_font.o" for example which will not work. Make_fclean

    Desktop (please complete the following information):

    • MacOS Catalina 10.15.7
    Bug 
    opened by willaCS 9
  • [BUG] Depth issue with mlx_delete_image()

    [BUG] Depth issue with mlx_delete_image()

    Describe the bug There is an issue with depth, see the code below.

    To Reproduce

    void	loop(void *param)
    {
    	t_data				*data;
    	static mlx_image_t	*image = NULL;
    	int32_t				instance_1_id;
    	int32_t				instance_2_id;
    
    	data = param;
    
    	// WHEN THIS IS COMMENTED IN, THE SECOND SQUARE DOESN'T GET DRAWN
    	if (image != NULL)
    	{
    		mlx_delete_image(data->mlx, image);
    		image = NULL;
    	}
    
    	if (image == NULL)
    	{
    		image = mlx_new_image(data->mlx, 100, 100);
    		ft_memset(image->pixels, 255, image->width * image->height * sizeof(int));
    
    		instance_1_id = mlx_image_to_window(data->mlx, image, 0, 0);
    		instance_2_id = mlx_image_to_window(data->mlx, image, 100, 100);
    	}
    }
    
    t_i32	main(void)
    {
    	t_data	data;
    
    	ft_bzero(&data, sizeof(t_data));
    	data.mlx = mlx_init(200, 200, "", false);
    	mlx_loop_hook(data.mlx, loop, &data);
    	mlx_loop(data.mlx);
    	return (EXIT_SUCCESS);
    }
    

    Expected behavior The second square to be drawn, see the comment in the code.

    Additional context If you replace the const float depth = mlxctx->zdepth; with const float depth = 1000000; inside of mlx_update_matrix() you'll see that everything works as expected, though hardcoding it to such a low value is obviously problematic when you create more than a million instances during the lifetime of the program. Ideally you also wouldn't set it to a huge ass constant since it'd still be technically reachable if you ran the program long enough, though how you resolve this issue is up to you.

    Bug 
    opened by MyNameIsTrez 2
Releases(v2.2.0)
  • v2.2.0(Aug 2, 2022)

    42MLX_Logo

    Version: 2.2.0

    It's been a while but it's time for another update in which we finally tackled the annoying issue of images not showing up after a while. There are also some nice new features such as unit testing, functions and markdown pages for improved documentation. The community is more than welcome to contribute to it!

    Bugfix

    • Fixed a bug where instances would disappear when calling mlx_image_to_window too many times.
    • Fixed a segfault due to mlx_lstadd_front not handling double linked lists correctly.

    Feature Summary

    • Added mlx_set_window_title.
    • Added mlx_create_std_cursor.
    • Added the ability to show and hide instances.
    • Added markdown pages to explain how to use the library.
    • Added unit testing mainly for CI but also for general testing. (WIP)
    • Redid all the assertions to also display a message as to why it was triggered.
    • Improved performance thanks to PRs.

    PR's merged

    • Fix compile on Linux by @joppiesaus in https://github.com/codam-coding-college/MLX42/pull/37
    • Automatically recompile when a header file changes by @joppiesaus in https://github.com/codam-coding-college/MLX42/pull/38
    • Fix assertion for indexing by @xvoorvaa in https://github.com/codam-coding-college/MLX42/pull/39
    • Added glfwWindowHint() that was deleted last commit by @xvoorvaa in https://github.com/codam-coding-college/MLX42/pull/40
    • Optimize and fix recursion crash by @MyNameIsTrez in https://github.com/codam-coding-college/MLX42/pull/43
    • Back to using faster mlx_lstadd_front by @MyNameIsTrez in https://github.com/codam-coding-college/MLX42/pull/44

    New Contributors

    • @joppiesaus made their first contribution in https://github.com/codam-coding-college/MLX42/pull/37
    • @xvoorvaa made their first contribution in https://github.com/codam-coding-college/MLX42/pull/39
    • @MyNameIsTrez made their first contribution in https://github.com/codam-coding-college/MLX42/pull/43

    Full Changelog: https://github.com/codam-coding-college/MLX42/compare/v2.1.0...v2.2.0

    Source code(tar.gz)
    Source code(zip)
  • v2.1.0(Jun 12, 2022)

    42MLX_Logo

    Version: 2.1.0

    In this update you finally have access to the font texture itself. This will allow you to work with the font directly and create any functions that might need it. Additionally the setting 'system' set up before has been replaced with with mlx_set_setting. You can find the settings in the header.

    Bugfix

    • Fix segfault when deleting an image
    • Fix memory leak at mlx_terminate

    Feature Summary

    • Add mlx_get_texoffset
    • Add mlx_get_font
    • Add mlx_set_setting
    • Change X & Y position param from int32_t to uint32_t

    PR's merged

    • [Bug Fix] Segfaults/UB when deleting images with 2 or more instances by @pajotg in https://github.com/codam-coding-college/MLX42/pull/30
    • Update README.md by @hydrasho in https://github.com/codam-coding-college/MLX42/pull/32

    New Contributors

    • @pajotg made their first contribution in https://github.com/codam-coding-college/MLX42/pull/30
    • @hydrasho made their first contribution in https://github.com/codam-coding-college/MLX42/pull/32

    Full Changelog: https://github.com/codam-coding-college/MLX42/compare/v2.0.3...v2.1.0

    Source code(tar.gz)
    Source code(zip)
  • v2.0.3(Apr 19, 2022)

    42MLX_Logo

    Version: 2.0.3

    This patch introduces just a few bug fixes.

    Bug Fixes

    • Fixed missing function definitions in the header for mouse & cursor hook
    • Fixed rendering issue that would cause image_to_window to not change textures.
    • Fixed heap-buffer-overflow when trying to read a xpm42 file.
    Source code(tar.gz)
    Source code(zip)
  • v2.0.2(Apr 6, 2022)

    42MLX_Logo

    Version: 2.0.2

    Overall not many changes just a few QOL stuff, a few bug fixes as well as improvements and some nice makefile overhauling by @Eathox, thank you very much!

    Feature Summary

    • Add assertions for compile time error checking. (Use make DEBUG=1)
    • Add mouse hook function.
    • Add cursor hook function.
    • Re-visit of the Makefiles.
    • Some more minor internal stuff.

    Bug Fixes

    • Fixed a crash when deleting an XPM42 texture object.
    • Fixed a performance issue with rendering.
    • Fixed endian dependent color reading for XPM42

    PRs Merged

    • Fix endian dependent color reading by @Eathox in https://github.com/codam-coding-college/MLX42/pull/25
    • Implement assertions to check for null by @W2Wizard in https://github.com/codam-coding-college/MLX42/pull/26
    • Makefile cleanup and fixes by @Eathox in https://github.com/codam-coding-college/MLX42/pull/24

    New Contributors

    • @Eathox made their first contribution in https://github.com/codam-coding-college/MLX42/pull/25

    Full Changelog: https://github.com/codam-coding-college/MLX42/compare/V2.0.1...v2.0.2

    Source code(tar.gz)
    Source code(zip)
  • V2.0.1(Mar 16, 2022)

    42MLX_Logo

    Version: 2.0.1

    This update introduces a few bug fixes and corrections

    On a different note. MLX42 was extensively used at the Codam Hackathon in March and it was viewed with a lot of positivity. Thank you to everyone who used it and reported their feedback!

    Feature Summary

    • Added mlx_set_instance_depth to set the Z value properly.
    • Added batched rendering to improve the performance!
    • Implemented new scripts so that the dependency on python can be removed.
    • Improved the detection of homebrew.
    • Some more stuff I forgot :D

    Bug Fixes

    • Fixed a memory leak on image deletion.
    • Fixed mlx_errno to be extern instead.

    PRs Merged

    • Proof-of-concept: Batched rendering by @Techdaan in https://github.com/W2Codam/MLX42/pull/19
    • Implement batched rendering by @W2Wizard in https://github.com/W2Codam/MLX42/pull/21 (Integration of #19)
    • Replace compile_shader script with bash variant by @FreekBes in https://github.com/W2Codam/MLX42/pull/18
    • Add generic homebrew path finding option to work with custom homebrew… by @vincentvis in https://github.com/W2Codam/MLX42/pull/22

    New Contributors

    • @Techdaan made their first contribution in https://github.com/W2Codam/MLX42/pull/19
    • @vincentvis made their first contribution in https://github.com/W2Codam/MLX42/pull/22

    Full Changelog: https://github.com/W2Codam/MLX42/compare/v2.0.0...V2.0.1

    Source code(tar.gz)
    Source code(zip)
  • v2.0.0(Mar 2, 2022)

    42MLX_Logo

    Version: 2.0.0

    This update is a major jump from v1.0.0, as of now MLX42 will no longer follow the norme as explained and mentioned in the announcement #16. Needles to say this makes incompatible API changes.

    Feature Summary

    • Added mlx_put_string.
    • Switched to using error codes instead, code won't have to be rewritten, instead you can now get the error if any occured via mlx_strerror and g_mlx_errno instead of having the error directly omitted onto the terminal.
    • Added proper makefile support to windows
    • General improvement in peformance and rendering
    • Improved stability and error handling
    • Re-wrote the implementation of hooks to be more clean
    • Renamed mlx_putpixel to mlx_put_pixel to stay consistent with naming the convention.
    • Improved documentation for the internal header
    • Some more stuff I forgot :D

    Bug Fixes

    • Fixed a bug in the XPM3 -> XPM42 converter, sometimes some text values would not convert correctly.
    • Fixed an issue in the python script shader converter.
    • Fixed a bug that would cause the application to crash when minimizing the window on Windows.
    • Fixed a bug where mlx_get_monitor_size would not return 0 if it did not find a monitor.
    • Fixed an issue where deletion of an image would cause a segfault.
    Source code(tar.gz)
    Source code(zip)
  • release(Feb 21, 2022)

    42MLX_Logo

    Initial release 🎉

    After a more than a month of work into this project I can proudly say that it is ready to be used for any kind of project in a stable condition. Hope there are no bugs that I have not heard of :D

    Feature Summary

    • Fully norme (except the libraries used)
    • Covers almost all features compared to the original MiniLibX.
    • Useful image manipulation functions.
    • Stable, leak free PNG importing via lodepng.
    • XPM42 Support with added converter (XPM3 -> XPM42).
    • Improved performance.
    • Built-In support for keycodes and simple key detection.
    • Window resizability, callback detection & ability to resize images.
    • Fully Cross-platform (MacOS, Windows & Linux)
    • Automatic window focus on startup
    • No Leaks, compiles with -fsanitize=address

    Todo

    • String to window
    • Some additional callbacks
    • Improve performance
    • Revise error handling with error codes instead
    Source code(tar.gz)
    Source code(zip)
Several GX2 test programs to compare it with OpenGL. (With additional GLFW+OpenGL implementation provided)

GX2-Tests Provided are GX2 test programs and samples for comparison with OpenGL and with additional GLFW+OpenGL implementation for test on PC. These s

AboodXD 1 Nov 15, 2021
OpenGL Template Engine - a C++ OpenGL graphics engine which aimed to be a simple startup template for 3D OpenGL projects.

OpenGL Template Engine is a C++ OpenGL graphics engine which aimed to be a simple startup template for 3D OpenGL projects. This is the template I personally use for my own projects and provides me with the general OpenGL 3D render setup with model import and UI.

Marcus Nesse Madland 2 May 16, 2022
this is my simple voxel engine, appart from librairies like glad it is entierly written in C++ and GLSL

simple-voxel-raycaster this is my simple voxel engine, appart from librairies like glad it is entierly written in C++ and GLSL here is a gif: https://

null 2 Sep 26, 2022
Meatloaf rewritten in C

MeatloafC This repository is Meatloaf (made by Rickaym) rewritten entirely in C99! Copyright (c) 2001-2021 Ricky and Kecky. Index Abstraction Function

null 1 Nov 5, 2021
Ziggified GLFW bindings with 100% API coverage, zero-fuss installation, cross compilation, and more.

mach/glfw - Ziggified GLFW bindings Ziggified GLFW bindings that Mach engine uses, with 100% API coverage, zero-fuss installation, cross compilation,

Hexops 194 Nov 24, 2022
A C++ binding for the OpenGL API, generated using the gl.xml specification.

glbinding is a cross-platform C++ binding for the OpenGL API. glbinding leverages C++11 features like enum classes, lambdas, and variadic templates, i

CG Internals 752 Nov 27, 2022
Modified version of srlua for MSVC using version 5.4 of Lua

Modified version of srlua for MSVC using version 5.4 of Lua. Quote from the original README: This is a self-running Lua interpreter. It is meant to be

Augusto Goulart 3 Nov 24, 2022
F Graphics Library (FGL) is a small graphics C++ portable library for LCD displays on embedded systems

F Graphics Library (FGL) Full documentation: fgl.docsforge.com (By Filipe Chagas) F Graphics Library is a C++ library that I created for use in embedd

Filipe Chagas 9 Oct 31, 2022
GraphicsFuzz provides tools for automatically finding and simplifying bugs in graphics drivers, specifically graphics shader compilers.

GraphicsFuzz GraphicsFuzz is a set of tools for testing shader compilers GraphicsFuzz provides tools for automatically finding and simplifying bugs in

Google 516 Nov 29, 2022
CSC404: Computer Graphics [CG] & CSL402: Computer Graphics Lab [CG Lab]

COMPUTER-GRAPHICS-AND-COMPUTER-GRAPHICS-LAB CSC404: CG & CSL402: CG LAB [SEMESTER IV] Syllabus CG - Reference Books THE WALL MEGA SATISH - AUTHOR CG C

AMEY THAKUR 7 Apr 28, 2022
Visualization Library is a C++ middleware for high-performance 2D and 3D graphics applications based on OpenGL 1.x-4.x supporting Windows, Linux and Mac OS X.

Visualization Library 2.2 Gallery About Visualization Library is a C++ middleware for high-performance 2D and 3D graphics applications based on the in

Michele 313 Nov 8, 2022
Arduino Sketch and a Web Bluetooth API for loading models and running inference on the Nano Sense 33 BLE device.

TF4Micro Motion Kit This repo contains the Arduino Sketch and a Web Bluetooth API for loading models and running inference on the device. Install and

Google Creative Lab 52 Nov 24, 2022
Reference Implementations of P0267, the proposed 2D graphics API for ISO C++

P0267 Reference Implementation Please read the LICENSE before cloning or forking the code as there is important information there! Please see the wiki

cpp-io2d 305 Nov 12, 2022
Gfx - A minimalist and easy to use graphics API.

gfx gfx is a minimalist and easy to use graphics API built on top of Direct3D12/HLSL intended for rapid prototyping. It supports: Full shader reflecti

Guillaume Boissé 324 Nov 27, 2022
The pico can be used to program other devices. Raspberry pi made such an effort. However there is no board yet, that is open-source and can be used with OpenOCD as a general-purpose programmer

pico-probe-programmer The pico can be used to program other devices. Raspberry pi made such an effort. However there is no board yet, that is open-sou

martijn 22 Oct 15, 2022
GLSL optimizer based on Mesa's GLSL compiler. Used to be used in Unity for mobile shader optimization.

GLSL optimizer ⚠️ As of mid-2016, the project is unlikely to have any significant developments. At Unity we are moving to a different shader compilati

Aras Pranckevičius 1.6k Nov 27, 2022
Make CVE-2020-0668 exploit work for version < win10 v1903 and version >= win10 v1903

CVE-2020-0668 Made CVE-2020-0668 exploit work for version < win10 v1903 and version >= win10 v1903 Diaghub Exploit (< v1903) powershell exploit works

null 12 Nov 9, 2022
A header-only version of Instagram Private API in C++

C++ Instagram API A header-only version of Instagram Private API in C++ Getting started. Writing your first bot General API Documentation Usage Error

Denis Beqiraj 36 Dec 1, 2022