Mercurial > games > semicongine
comparison examples/E01_hello_triangle.nim @ 136:fc5db4f1f94e
did: rewrite example 02 with new engine approach
author | Sam <sam@basx.dev> |
---|---|
date | Thu, 20 Apr 2023 23:46:22 +0700 |
parents | 9f2c178beb60 |
children | a4e6e76128e6 |
comparison
equal
deleted
inserted
replaced
135:250e1dcbfec9 | 136:fc5db4f1f94e |
---|---|
1 import std/strutils | |
2 import std/enumerate | |
3 | |
4 import semicongine | 1 import semicongine |
5 | 2 |
6 | 3 |
7 const | 4 const |
8 vertexInput = @[ | 5 vertexInput = @[ |
13 fragOutput = @[attr[Vec4f]("color")] | 10 fragOutput = @[attr[Vec4f]("color")] |
14 vertexCode = compileGlslShader( | 11 vertexCode = compileGlslShader( |
15 stage=VK_SHADER_STAGE_VERTEX_BIT, | 12 stage=VK_SHADER_STAGE_VERTEX_BIT, |
16 inputs=vertexInput, | 13 inputs=vertexInput, |
17 outputs=vertexOutput, | 14 outputs=vertexOutput, |
18 main="""gl_Position = vec4(position, 1.0); outcolor = color;""" | 15 main=""" |
16 gl_Position = vec4(position, 1.0); | |
17 outcolor = color; | |
18 """ | |
19 ) | 19 ) |
20 fragmentCode = compileGlslShader( | 20 fragmentCode = compileGlslShader( |
21 stage=VK_SHADER_STAGE_FRAGMENT_BIT, | 21 stage=VK_SHADER_STAGE_FRAGMENT_BIT, |
22 inputs=vertexOutput, | 22 inputs=vertexOutput, |
23 outputs=fragOutput, | 23 outputs=fragOutput, |