-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_project.sh
executable file
·58 lines (47 loc) · 1.06 KB
/
setup_project.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Create project structure
create_structure() {
echo -e "${YELLOW}Creating project structure...${NC}"
# Create main source directories
mkdir -p src/{core,graphics,input,utils}
mkdir -p examples/basic
mkdir -p shaders/{vertex,fragment}
# Create basic shader files
echo "Creating shader files..."
create_shader_files
}
# Create shader files
create_shader_files() {
# Vertex shader
cat > shaders/vertex/basic.vert << 'EOF'
#version 450
layout(location = 0) in vec3 position;
layout(location = 1) in vec2 texcoord;
out vec2 v_texcoord;
void main() {
v_texcoord = texcoord;
gl_Position = vec4(position, 1.0);
}
EOF
# Fragment shader
cat > shaders/fragment/basic.frag << 'EOF'
#version 450
in vec2 v_texcoord;
out vec4 color;
void main() {
color = vec4(v_texcoord, 0.0, 1.0);
}
EOF
}
# Main execution
main() {
create_structure
cargo build
echo -e "${GREEN}Project setup complete!${NC}"
}
main