rev: 21c5e6d2f665d0e8b4ff917a51b664c895dab2ed tukan/tukan/screen.sc -rw-r--r-- 671 bytes View raw Log this file
21c5e6d2f665 — Leonard Ritter * renamed project from Liminal to Tukan 2 years ago
                                                                                
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
import glsl
import .stage

using import .gl
using import glm

global screen-vao = (GLuint 0)

'append stage.init-gfx
    fn ()
        screen-vao = (glGenVertexArray)

'append stage.shutdown-gfx
    fn ()
        glDelVertexArray screen-vao

do
    fn set-vertex-position ()
        let screen-tri-vertices =
            arrayof vec2
                vec2 -1 -1
                vec2  3 -1
                vec2 -1  3
        let pos = (screen-tri-vertices @ glsl.gl_VertexID)
        glsl.gl_Position = (vec4 pos 0 1)
        pos

    fn draw ()
        assert (screen-vao != 0)
        glBindVertexArray screen-vao
        glDrawArrays GL_TRIANGLE_STRIP 0 3

    locals;