Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ jobs:

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v3
with:
msbuild-architecture: x64

- name: Generate premake5 solution
working-directory: ${{env.SOLUTION_FILE_PATH}}
run: .\gen_proj.bat

- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
run: msbuild /m /p:Configuration=${{ matrix.configuration }} ${{env.SOLUTION_FILE_PATH}} /p:Platform=x64
run: msbuild /m /p:Configuration=${{ matrix.configuration }} ${{env.SOLUTION_FILE_PATH}} /p:Platform=x64 /p:PreferredToolArchitecture=x64
2 changes: 2 additions & 0 deletions .github/workflows/windows_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v3
with:
msbuild-architecture: x64

- name: Make Release Build
run: .\Scripts\Windows\MakeReleaseBuild.bat --no-open
Expand Down
21 changes: 21 additions & 0 deletions Dependencies/baregl/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 Adrien Givry.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
22 changes: 22 additions & 0 deletions Dependencies/baregl/include/baregl/BareGL.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* @project: baregl
* @author: Adrien Givry
* @licence: MIT
*/

#pragma once

#include <baregl/Buffer.h>
#include <baregl/Context.h>
#include <baregl/Framebuffer.h>
#include <baregl/Renderbuffer.h>
#include <baregl/ShaderProgram.h>
#include <baregl/ShaderStage.h>
#include <baregl/Texture.h>
#include <baregl/VertexArray.h>

#include <baregl/debug/Debug.h>
#include <baregl/debug/IAssertHandler.h>
#include <baregl/debug/IEventHandler.h>
#include <baregl/debug/ILogHandler.h>

84 changes: 84 additions & 0 deletions Dependencies/baregl/include/baregl/Buffer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/**
* @project: baregl
* @author: Adrien Givry
* @licence: MIT
*/

#pragma once

#include <baregl/data/BufferMemoryRange.h>
#include <baregl/detail/NativeObject.h>
#include <baregl/types/EAccessSpecifier.h>
#include <baregl/types/EBufferType.h>

#include <optional>

namespace baregl
{
/**
* Represents a buffer, used to store data on the GPU
*/
class Buffer final : public detail::NativeObject
{
public:
/**
* Creates a buffer
*/
Buffer();

/**
* Destroys the buffer
*/
~Buffer();

/**
* Allocates memory for the buffer
* @param p_size
* @param p_usage
* @return The size of the allocated memory in bytes
*/
uint64_t Allocate(uint64_t p_size, types::EAccessSpecifier p_usage = types::EAccessSpecifier::STATIC_DRAW);

/**
* Uploads data to the buffer
* @param p_data
* @param p_range
*/
void Upload(const void* p_data, std::optional<data::BufferMemoryRange> p_range = std::nullopt);

/**
* Returns true if the buffer is valid (properly allocated)
*/
bool IsValid() const;

/**
* Returns true if the buffer is empty
*/
bool IsEmpty() const;

/**
* Returns the size of the allocated buffer in bytes
*/
uint64_t GetSize() const;

/**
* Binds the buffer
* @param p_type Type of the buffer to bind
* @param p_index (Optional) Index to bind the buffer to
*/
void Bind(
types::EBufferType p_type,
std::optional<uint32_t> p_index = std::nullopt
);

/**
* Unbinds the buffer
*/
void Unbind();

protected:
uint64_t m_allocatedBytes = 0;
std::optional<types::EBufferType> m_boundAs = std::nullopt;
std::optional<uint32_t> m_bindIndex = std::nullopt;
};
}
Loading