aboutsummaryrefslogtreecommitdiff
path: root/include/RenderBackend/OpenGL/DeviceMemory.hpp
blob: 974c7cfd456af343ede7075db4de5cb604eb2efa (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
28
#pragma once

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

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