This commit is contained in:
parent
c0e4067639
commit
19b059a88c
11 changed files with 286 additions and 1 deletions
3
tests/Shader/inner/main.cpp
Normal file
3
tests/Shader/inner/main.cpp
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
import std;
|
||||
|
||||
int main() { return 0; }
|
||||
21
tests/Shader/inner/project.cpp
Normal file
21
tests/Shader/inner/project.cpp
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import std;
|
||||
import Crafter.Build;
|
||||
namespace fs = std::filesystem;
|
||||
using namespace Crafter;
|
||||
|
||||
extern "C" Configuration CrafterBuildProject(std::span<const std::string_view>) {
|
||||
Configuration cfg;
|
||||
cfg.path = "./";
|
||||
cfg.name = "shader-test";
|
||||
cfg.outputName = "shader-test";
|
||||
cfg.target = "x86_64-pc-linux-gnu";
|
||||
cfg.type = ConfigurationType::Executable;
|
||||
|
||||
std::array<fs::path, 0> ifaces = {};
|
||||
std::array<fs::path, 1> impls = { "main" };
|
||||
cfg.GetInterfacesAndImplementations(ifaces, impls);
|
||||
|
||||
cfg.shaders.emplace_back("triangle.glsl", "main", ShaderType::Vertex);
|
||||
|
||||
return cfg;
|
||||
}
|
||||
13
tests/Shader/inner/triangle.glsl
Normal file
13
tests/Shader/inner/triangle.glsl
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#version 450
|
||||
|
||||
layout(location = 0) out vec3 color;
|
||||
|
||||
void main() {
|
||||
vec2 positions[3] = vec2[](
|
||||
vec2( 0.0, -0.5),
|
||||
vec2( 0.5, 0.5),
|
||||
vec2(-0.5, 0.5)
|
||||
);
|
||||
gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0);
|
||||
color = vec3(1.0, 0.0, 0.0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue