diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2020-07-25 18:49:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-25 18:49:18 +0200 |
commit | 0a2ba2cdb8e01bbd7e9e8ef1d0582ef6a892f837 (patch) | |
tree | 3c760d4d981aad30fa151343c224d3ea366c99d9 /src/Framebuffer.cpp | |
parent | Merge pull request #36 from LaG1924/fix-windows-vs2019 (diff) | |
parent | Completely removed hardcoded list of blockstates (diff) | |
download | AltCraft-0a2ba2cdb8e01bbd7e9e8ef1d0582ef6a892f837.tar AltCraft-0a2ba2cdb8e01bbd7e9e8ef1d0582ef6a892f837.tar.gz AltCraft-0a2ba2cdb8e01bbd7e9e8ef1d0582ef6a892f837.tar.bz2 AltCraft-0a2ba2cdb8e01bbd7e9e8ef1d0582ef6a892f837.tar.lz AltCraft-0a2ba2cdb8e01bbd7e9e8ef1d0582ef6a892f837.tar.xz AltCraft-0a2ba2cdb8e01bbd7e9e8ef1d0582ef6a892f837.tar.zst AltCraft-0a2ba2cdb8e01bbd7e9e8ef1d0582ef6a892f837.zip |
Diffstat (limited to 'src/Framebuffer.cpp')
-rw-r--r-- | src/Framebuffer.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/Framebuffer.cpp b/src/Framebuffer.cpp index fb7ebc7..d81b0e0 100644 --- a/src/Framebuffer.cpp +++ b/src/Framebuffer.cpp @@ -3,11 +3,13 @@ #include <string> #include "Utility.hpp" #include "AssetManager.hpp" +#include <optick.h> const GLuint magic = 316784; GLuint quadVao = magic, quadVbo = magic; Framebuffer::Framebuffer(unsigned int width, unsigned int height, bool createDepthStencilBuffer) : width(width), height(height) { + OPTICK_EVENT(); if (quadVao == magic) { float quadVertices[] = { // positions // texCoords @@ -70,11 +72,13 @@ Framebuffer::~Framebuffer() { } void Framebuffer::Activate() { + OPTICK_EVENT(); glViewport(0, 0, width, height); glBindFramebuffer(GL_FRAMEBUFFER, fbo); } void Framebuffer::RenderTo(Framebuffer &target) { + OPTICK_EVENT(); glBindFramebuffer(GL_FRAMEBUFFER, target.fbo); glViewport(0, 0, target.width, target.height); AssetManager::GetAsset<AssetShader>("/altcraft/shaders/fbo")->shader->Activate(); @@ -96,8 +100,8 @@ void Framebuffer::Resize(unsigned int newWidth, unsigned int newHeight) { } } -Framebuffer &Framebuffer::GetDefault() -{ +Framebuffer &Framebuffer::GetDefault() { + OPTICK_EVENT(); static char fboDefaultData[sizeof(Framebuffer)]; static Framebuffer *fboDefault = nullptr; if (fboDefault == nullptr) { @@ -111,8 +115,8 @@ Framebuffer &Framebuffer::GetDefault() return *fboDefault; } -void Framebuffer::Clear(bool color, bool depth, bool stencil) -{ +void Framebuffer::Clear(bool color, bool depth, bool stencil) { + OPTICK_EVENT(); Activate(); GLbitfield clearBits = 0; if (color) |