-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9a89751
commit bba9c3c
Showing
7 changed files
with
96 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
/* By: W2Wizard <[email protected]> +#+ */ | ||
/* +#+ */ | ||
/* Created: 2021/12/27 23:55:34 by W2Wizard #+# #+# */ | ||
/* Updated: 2024/01/20 00:49:21 by joppe ######## odam.nl */ | ||
/* Updated: 2024/01/27 18:09:12 by joppe ######## odam.nl */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -61,6 +61,7 @@ | |
|
||
extern const char* vert_shader; | ||
extern const char* frag_shader; | ||
extern const char* alt_frag_shader; | ||
|
||
// Flag to indicate if the render queue has to be sorted. | ||
extern bool sort_queue; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#version 330 core | ||
|
||
in vec2 TexCoord; | ||
flat in int TexIndex; | ||
|
||
out vec4 FragColor; | ||
|
||
uniform sampler2D Texture0; | ||
uniform sampler2D Texture1; | ||
uniform sampler2D Texture2; | ||
uniform sampler2D Texture3; | ||
uniform sampler2D Texture4; | ||
uniform sampler2D Texture5; | ||
uniform sampler2D Texture6; | ||
uniform sampler2D Texture7; | ||
uniform sampler2D Texture8; | ||
uniform sampler2D Texture9; | ||
uniform sampler2D Texture10; | ||
uniform sampler2D Texture11; | ||
uniform sampler2D Texture12; | ||
uniform sampler2D Texture13; | ||
uniform sampler2D Texture14; | ||
uniform sampler2D Texture15; | ||
|
||
void main() | ||
{ | ||
vec4 outColor = vec4(1.0, 1.0, 1.0, 1.0); | ||
FragColor = outColor; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
/* ************************************************************************** */ | ||
/* */ | ||
/* :::::::: */ | ||
/* mlx_init.c :+: :+: */ | ||
/* mlx_init.c :+: :+: */ | ||
/* +:+ */ | ||
/* By: W2Wizard <[email protected]> +#+ */ | ||
/* +#+ */ | ||
/* Created: 2021/12/28 00:24:30 by W2Wizard #+# #+# */ | ||
/* Updated: 2023/06/08 18:16:19 by XEDGit ######## odam.nl */ | ||
/* Updated: 2024/01/27 18:09:20 by joppe ######## odam.nl */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#include "MLX42/MLX42_Int.h" | ||
#include <stdio.h> | ||
|
||
//= Private =// | ||
|
||
|
@@ -128,6 +129,8 @@ static bool mlx_init_render(mlx_t* mlx) | |
glAttachShader(mlxctx->shaderprogram, fshader); | ||
glLinkProgram(mlxctx->shaderprogram); | ||
|
||
printf("ALT SHADER [%s]\n", alt_frag_shader); | ||
|
||
glDeleteShader(vshader); | ||
glDeleteShader(fshader); | ||
glDetachShader(mlxctx->shaderprogram, vshader); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
# ----------------------------------------------------------------------------- | ||
# Codam Coding College, Amsterdam @ 2022-2023 by W2Wizard. | ||
# See README in the root project for more information. | ||
# ----------------------------------------------------------------------------- | ||
|
||
# If no arguments have been given, exit with error code 1 | ||
if [ "$#" -ne 1 ]; then | ||
echo "ERROR: missing arguments, use as follows: $0 <ShaderFile>" 1>&2 | ||
exit 1 | ||
fi | ||
|
||
# If file cannot be found, exit with error code 2 | ||
if [ ! -f "$1" ]; then | ||
echo "ERROR: shader file not found: $1" 1>&2 | ||
exit 2 | ||
fi | ||
|
||
SHADERTYPE="${1##*.}" | ||
|
||
echo alt_${SHADERTYPE}_shader >> poep.txt | ||
|
||
echo "// -----------------------------------------------------------------------------" | ||
echo "// Codam Coding College, Amsterdam @ 2022-2023 by W2Wizard. " | ||
echo "// See README in the root project for more information. " | ||
echo "// -----------------------------------------------------------------------------" | ||
echo "" | ||
echo "// If you wish to modify this file edit the .vert or .frag file!" | ||
echo "" | ||
echo "#include \"MLX42/MLX42_Int.h\"" | ||
echo "" | ||
echo "const char* alt_${SHADERTYPE}_shader = \"$(sed -n '1{p;q;}' "$1")\\n\"" | ||
{ | ||
# Skip over first line | ||
read | ||
while IFS= read -r LINE; do | ||
if [ ! "${LINE}" = "" ]; then | ||
if [ "${LINE}" = "}" ]; then | ||
echo " \"${LINE}\";" | ||
else | ||
echo " \"${LINE}\"" | ||
fi | ||
fi | ||
done | ||
} < "$1" | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
/* By: yzaim <[email protected]> +#+ */ | ||
/* +#+ */ | ||
/* Created: 2024/01/08 15:28:08 by yzaim #+# #+# */ | ||
/* Updated: 2024/01/20 01:18:16 by joppe ######## odam.nl */ | ||
/* Updated: 2024/01/27 16:54:11 by joppe ######## odam.nl */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|