Support loading data from util::span to gfx::buffer
This commit is contained in:
parent
4fae4bbbe4
commit
ce287c0416
1 changed files with 7 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <psemek/gfx/gl.hpp>
|
||||
#include <psemek/util/span.hpp>
|
||||
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
|
@ -99,6 +100,12 @@ namespace psemek::gfx
|
|||
load(data, N, usage);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void load(util::span<T> const & data, GLenum usage = gl::STREAM_DRAW)
|
||||
{
|
||||
load(data.data(), data.size(), usage);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
std::shared_ptr<T[]> map()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue