Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
OpenGLMesh.hpp
1/*
2Copyright (C) 2016-2019,2021,2025,2026 Rodrigo Jose Hernandez Cordoba
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16#ifndef AEONGAMES_OPENGLMESH_HPP
17#define AEONGAMES_OPENGLMESH_HPP
18
19#include <vector>
20#include "OpenGLBuffer.hpp"
21#include "OpenGLVariable.hpp"
22namespace AeonGames
23{
24 class Mesh;
25 class OpenGLRenderer;
28 {
29 public:
31 OpenGLMesh ( const OpenGLRenderer& aOpenGLRenderer, const Mesh& aMesh );
34 OpenGLMesh ( OpenGLMesh&& aOpenGLMesh );
35 OpenGLMesh ( const OpenGLMesh& aOpenGLMesh ) = delete;
36 OpenGLMesh& operator= ( const OpenGLMesh& aOpenGLMesh ) = delete;
37 OpenGLMesh& operator= ( OpenGLMesh&& aOpenGLMesh ) = delete;
39 void Bind() const;
41 void EnableAttributes ( const std::vector<OpenGLVariable>& aAttributes ) const;
43 void DisableAttributes ( const std::vector<OpenGLVariable>& aAttributes ) const;
44 private:
45 const OpenGLRenderer& mOpenGLRenderer;
46 const Mesh* mMesh{nullptr};
47 OpenGLBuffer mVertexBuffer{};
48 OpenGLBuffer mIndexBuffer{};
49 };
50}
51#endif
Represents a polygon mesh with vertex attributes and index data.
Definition Mesh.hpp:31
OpenGL GPU buffer wrapper implementing the Buffer interface.
void DisableAttributes(const std::vector< OpenGLVariable > &aAttributes) const
Disable the specified vertex attributes.
OpenGLMesh(const OpenGLRenderer &aOpenGLRenderer, const Mesh &aMesh)
Construct from a renderer and mesh resource.
void Bind() const
Bind the vertex and index buffers.
void EnableAttributes(const std::vector< OpenGLVariable > &aAttributes) const
Enable the specified vertex attributes for rendering.
OpenGL rendering backend implementing the Renderer interface.
<- This is here just for the literals
Definition AABB.hpp:31