File: CubeScape.h

package info (click to toggle)
glbinding 2.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 20,848 kB
  • ctags: 30,258
  • sloc: cpp: 255,369; xml: 46,343; python: 7,876; sh: 599; makefile: 494
file content (45 lines) | stat: -rw-r--r-- 677 bytes parent folder | download | duplicates (3)
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

#pragma once

#include <glbinding/gl/types.h>

#include <chrono>

#include "glutils.h"


class CubeScape
{
public:
    CubeScape();
    ~CubeScape();

    void resize(int width, int height);
    void draw();

    void setNumCubes(int numCubes);
    int numCubes() const;

protected:
    gl::GLint a_vertex;
    gl::GLint u_transform;
    gl::GLint u_time;
    gl::GLint u_numcubes;

    gl::GLuint m_vao;
    gl::GLuint m_indices;
    gl::GLuint m_vertices;

    gl::GLuint m_program;

    gl::GLuint m_textures[2];
    
    float m_a;
    int m_numcubes;

    mat4 m_view;
    mat4 m_projection;

    using clock = std::chrono::system_clock;
    clock::time_point m_time;
};