aboutsummaryrefslogtreecommitdiff
path: root/include/RenderBackend/OpenGL/DeviceMemory.hpp
blob: 706529e1efbb36503df0d1eb197a9379d537d9f3 (plain)
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
#pragma once

#include "../../DataView.hpp"
#include "../../utils.hpp"

namespace amalgine
{
    class DeviceMemory
    {
        DISABLE_COPY(DeviceMemory)
    public:
        DeviceMemory();
        
        // Uploaded once, drawn many times
        void copyStatic(const DataView<f32> &data);
        
        // Created once, changed from time to time but drawn many times more than that
        void copyDynamic(const DataView<f32> &data);
        
        // Uploaded once, drawn once (for example data that is changed every frame)
        void copyStream(const DataView<f32> &data);
    private:
        void copy(const DataView<f32> &data, i32 storageType);
    private:
        u32 vertexBufferObjectId;
    };
}