mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 15:37:46 +00:00
LibGL: Add simple implementation of buffer objects
For now, buffers are only implemented on the LibGL side, however in the future buffer objects should be stored in LibGPU.
This commit is contained in:
parent
892006218a
commit
59df2e62ee
6 changed files with 170 additions and 10 deletions
29
Userland/Libraries/LibGL/Buffer/Buffer.h
Normal file
29
Userland/Libraries/LibGL/Buffer/Buffer.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Copyright (c) 2022, cflip <cflip@cflip.net>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/ByteBuffer.h>
|
||||
#include <AK/RefCounted.h>
|
||||
|
||||
namespace GL {
|
||||
|
||||
// FIXME: For now, this is basically just a wrapper around ByteBuffer, but in
|
||||
// the future buffer data should be stored in LibGPU.
|
||||
class Buffer : public RefCounted<Buffer> {
|
||||
public:
|
||||
ErrorOr<void> set_data(void const*, size_t);
|
||||
void replace_data(void const*, size_t offset, size_t size);
|
||||
|
||||
size_t size();
|
||||
void* data();
|
||||
void* offset_data(size_t);
|
||||
|
||||
private:
|
||||
ByteBuffer m_data;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue