Skip to content

Commit

Permalink
Remove include_opengl.hpp + add const
Browse files Browse the repository at this point in the history
  • Loading branch information
sguionni committed Dec 20, 2024
1 parent ffa6ecd commit f6f3f2c
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 35 deletions.
6 changes: 3 additions & 3 deletions app/bench/src/user_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ namespace VTX::Bench
p_renderer->clean();
}

RenderQueue & renderQueue = p_renderer->getRenderQueue();
const RenderQueue & renderQueue = p_renderer->getRenderQueue();
for ( const Pass * const pass : renderQueue )
{
if ( pass != nullptr )
Expand Down Expand Up @@ -547,7 +547,7 @@ namespace VTX::Bench
std::map<const uint, Link *> mapIdDescLink;
const Pass * passToDelete = nullptr;

for ( std::unique_ptr<Pass> & pass : p_renderer->getPasses() )
for ( const std::unique_ptr<Pass> & pass : p_renderer->getPasses() )
{
ImNodes::BeginNode( id++ );
ImNodes::BeginNodeTitleBar();
Expand Down Expand Up @@ -696,7 +696,7 @@ namespace VTX::Bench
ImNodes::PopColorStyle();

// Links.
for ( std::unique_ptr<Link> & link : p_renderer->getLinks() )
for ( const std::unique_ptr<Link> & link : p_renderer->getLinks() )
{
mapIdDescLink.emplace( id, link.get() );
ImNodes::Link(
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#ifndef __VTX_RENDERER_CONTEXT_GL_BUFFER__
#define __VTX_RENDERER_CONTEXT_GL_BUFFER__

#include "renderer/context/include_opengl.hpp"
#include <cassert>
#include <cstddef>
#include <glad/glad.h>
#include <iostream>
#include <util/logger.hpp>
#include <vector>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef __VTX_RENDERER_CONTEXT_GL_ENUM_SHADER_TYPE__
#define __VTX_RENDERER_CONTEXT_GL_ENUM_SHADER_TYPE__

#include "renderer/context/include_opengl.hpp"
#include <glad/glad.h>

namespace VTX::Renderer::Context::GL
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#ifndef __VTX_RENDERER_CONTEXT_GL_FRAMEBUFFER__
#define __VTX_RENDERER_CONTEXT_GL_FRAMEBUFFER__

#include "renderer/context/include_opengl.hpp"
#include "texture_2d.hpp"
#include <cassert>
#include <glad/glad.h>
#include <vector>

namespace VTX::Renderer::Context::GL
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef __VTX_RENDERER_CONTEXT_GL_PROGRAM__
#define __VTX_RENDERER_CONTEXT_GL_PROGRAM__

#include "renderer/context/include_opengl.hpp"
#include <glad/glad.h>
#include <util/math.hpp>
#include <util/types.hpp>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef __VTX_RENDERER_CONTEXT_GL_TEXTURE_2D__
#define __VTX_RENDERER_CONTEXT_GL_TEXTURE_2D__

#include "renderer/context/include_opengl.hpp"
#include <cassert>
#include <glad/glad.h>

namespace VTX::Renderer::Context::GL
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef __VTX_RENDERER_CONTEXT_GL_VERTEX_ARRAY__
#define __VTX_RENDERER_CONTEXT_GL_VERTEX_ARRAY__

#include "renderer/context/include_opengl.hpp"
#include <glad/glad.h>
#include <type_traits>

namespace VTX::Renderer::Context::GL
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "gl/struct_opengl_infos.hpp"
#include "gl/texture_2d.hpp"
#include "gl/vertex_array.hpp"
#include "include_opengl.hpp"
#include <glad/glad.h>
#include <set>
#include <util/enum.hpp>
#include <util/exceptions.hpp>
Expand Down
10 changes: 5 additions & 5 deletions lib/renderer/include/private/renderer/render_graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ namespace VTX::Renderer
RenderGraph() = default;
~RenderGraph() { clean(); }

inline Passes & getPasses() { return _passes; }
inline Links & getLinks() { return _links; }
inline RenderQueue & getRenderQueue() { return _renderQueue; }
inline const Output * getOutput() { return _output; }
inline void setOutput( const Output * const p_output ) { _output = p_output; }
inline const Passes & getPasses() const { return _passes; }
inline const Links & getLinks() const { return _links; }
inline const RenderQueue & getRenderQueue() const { return _renderQueue; }
inline const Output * const getOutput() { return _output; }
inline void setOutput( const Output * const p_output ) { _output = p_output; }

inline bool isInRenderQueue( const Pass * const p_pass )
{
Expand Down
11 changes: 5 additions & 6 deletions lib/renderer/include/private/renderer/renderer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ namespace VTX::Renderer
_renderGraph->removeLink( p_link );
}

inline Passes & getPasses() { return _renderGraph->getPasses(); }
inline Links & getLinks() { return _renderGraph->getLinks(); }
inline RenderQueue & getRenderQueue() { return _renderGraph->getRenderQueue(); }
inline const Output * getOutput() { return _renderGraph->getOutput(); }
inline void setOutput( const Output * const p_output ) { _renderGraph->setOutput( p_output ); }
inline const Passes & getPasses() const { return _renderGraph->getPasses(); }
inline const Links & getLinks() const { return _renderGraph->getLinks(); }
inline const RenderQueue & getRenderQueue() const { return _renderGraph->getRenderQueue(); }
inline const Output * const getOutput() const { return _renderGraph->getOutput(); }
inline void setOutput( const Output * const p_output ) { _renderGraph->setOutput( p_output ); }

inline bool isInRenderQueue( const Pass * const p_pass ) { return _renderGraph->isInRenderQueue( p_pass ); }

Expand Down Expand Up @@ -205,7 +205,6 @@ namespace VTX::Renderer

// Benchmarker only.
inline void compileShaders() const { _context->compileShaders(); }
inline RenderGraphOpenGL45 & getRenderGraph() { return *_renderGraph; }
inline const std::vector<Pass *> & getAvailablePasses() const { return availablePasses; }
inline const InstructionsDurationRanges & getInstructionsDurationRanges() const
{
Expand Down
9 changes: 5 additions & 4 deletions lib/renderer/include/public/renderer/facade.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,17 @@ namespace VTX::Renderer
const E_CHAN_IN & p_channelDest = E_CHAN_IN::_0
);
void removeLink( const Link * const p_link );
Passes & getPasses();
Links & getLinks();
RenderQueue & getRenderQueue();
const Output * getOutput();
const Passes & getPasses() const;
const Links & getLinks() const;
const RenderQueue & getRenderQueue() const;
const Output * const getOutput() const;
void setOutput( const Output * const p_output );
bool isInRenderQueue( const Pass * const p_pass );
void compileShaders() const;
const InstructionsDurationRanges & getInstructionsDurationRanges() const;
const std::vector<Pass *> & getAvailablePasses() const;

// TODO: accessors.
bool * showAtoms;
bool * showBonds;
bool * showRibbons;
Expand Down
8 changes: 4 additions & 4 deletions lib/renderer/src/renderer/facade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ namespace VTX::Renderer

void Facade::removeLink( const Link * const p_link ) { _renderer->removeLink( p_link ); }

Passes & Facade::getPasses() { return _renderer->getPasses(); }
const Passes & Facade::getPasses() const { return _renderer->getPasses(); }

Links & Facade::getLinks() { return _renderer->getLinks(); }
const Links & Facade::getLinks() const { return _renderer->getLinks(); }

RenderQueue & Facade::getRenderQueue() { return _renderer->getRenderQueue(); }
const RenderQueue & Facade::getRenderQueue() const { return _renderer->getRenderQueue(); }

const Output * Facade::getOutput() { return _renderer->getOutput(); }
const Output * const Facade::getOutput() const { return _renderer->getOutput(); }

void Facade::setOutput( const Output * const p_output ) { _renderer->setOutput( p_output ); }

Expand Down

0 comments on commit f6f3f2c

Please sign in to comment.