text
stringlengths
1
24.5M
// Style Guide => https://github.com/Bhupesh-V/30-Seconds-Of-STL/blob/master/CONTRIBUTING.md/#Style Guide /* Author : Timothy Itodo Date : 30/05/2019 Time : 01:00 PM Description : size() function is used to return the size of the queue or the number of elements in the queue. */ #include <iostream> #include <queue>...
// Style Guide => https://github.com/Bhupesh-V/30-Seconds-Of-STL/blob/master/CONTRIBUTING.md/#Style Guide /* Author : Timothy Itodo Date : 30/05/2019 Time : 01:00 PM Description : swap() function is used to exchange the contents of two queues but the queues must be of SAME TYPE, although sizes may differ. */ #incl...
// Follow the Style Guide while submitting code PR. // Style Guide => https://github.com/Bhupesh-V/30-Seconds-Of-STL/blob/master/CONTRIBUTING.md/#Style Guide /* Author : Cameron Bradley Date : 11/10/2020 Time : 12:32 Description : Get a const reverse iterator pointing at the last element of the containe...
// Follow the Style Guide while submitting code PR. // Style Guide => https://github.com/Bhupesh-V/30-Seconds-Of-STL/blob/master/CONTRIBUTING.md/#Style Guide /* Author : Cameron Bradley Date : 11/10/2020 Time : 13:30 Description : Return an iterator pointing to the last element in the set. */ #include<i...
// Follow the Style Guide while submitting code PR. // Style Guide => https://github.com/Bhupesh-V/30-Seconds-Of-STL/blob/master/CONTRIBUTING.md/#Style Guide /* Author : Italo Vinicius Date : 02/10/2019 Time : 21:09 Description : Swap the content of two sets of same type */ #include <algorithm> #include...
/* Author : Bhupesh Varshey Date : 13/11/2019 Time : 01:47 PM Description : Demonstrating how pop() works in stack */ #include <bits/stdc++.h> using namespace std; int main() { stack<int> mystack; //Initializing an empty stack. mystack.push(2); mystack.push(3); // Printing stac...
/* Author : Nishanth Sanjeev Date : 07/10/2019 Time : 23:15 Description : How push() works, and what they are used for. */ #include <bits/stdc++.h> using namespace std; int main() { stack<int> demostack; //Initializing an empty stack. demostack.push(2); demostack.push(3); demos...
// Follow the Style Guide while submitting code PR. // Style Guide => https://github.com/Bhupesh-V/30-Seconds-Of-STL/blob/master/CONTRIBUTING.md/#Style Guide /* Author : this must be your name ;) Date : Date format dd/mm/yyyy Time : Time format hh:mm Description : description should be small & one liner...
// Style Guide => https://github.com/Bhupesh-V/30-Seconds-Of-STL/blob/master/CONTRIBUTING.md/#Style Guide /* Author : Kevin Harvell Date : 01/06/2019 Time : 11:30 AM Description : size() function is used to return the size of the stack or the number of elements in the stack. */ #include <iostream> #include <stack>...
// Style Guide => https://github.com/Bhupesh-V/30-Seconds-Of-STL/blob/master/CONTRIBUTING.md/#Style Guide /* Author : Soumya Lahiri Date : 01/10/2019 Time : 01:00 AM Description : swap() function is used to swap the contents of one stack with another stack of same type and size. */ #include <stack> #include <iost...
#include <iostream> #include <unordered_map> #include <string> int main() { // Declaration std::unordered_map<std::string, std::string> m; // Initilisation m = { { "India", "England" }, { "U.S.", "Washington" }, { "France", "Paris" } }; // prints the buck...
//Demonstrate count() #include<iostream> #include<unordered_map> using namespace std; int main() { // unordered map unordered_map<string , int> umap; // Inserting elements into the map umap.insert(make_pair("car" , 1)); umap.insert(make_pair("truck" , 2)); umap.insert(make_pair("bike" , 1)); ...
/* Author : Charles Emerson Date : 05/05/2019 Time : 16:16 Description : Showcase std::vector::assign to overwrite a vector. */ #include <iostream> #include <vector> void print(const std::vector<int> & numbers){ std::cout << "{ "; for (auto num : numbers){ std::cout << num << " "; ...
/* Author : Ankush Kamboj Date : 11/07/2019 Time : 20:00 Description : Returns a reference to the element at position _n_ in the vector. */ #include <iostream> #include <vector> int main() { // create a vector of 5 integers std::vector<int> myVector{1, 2, 3, 4, 5}; // display the vector conte...
/* Author : Jayshree Aishwarya Date : 18/10/2019 Time : 00:19 Description : Used to fetch the last element of a vector */ #include <iostream> #include <vector> int main() { // A vector storing rainfall(in inches) of a week std::vector<float> vRainfall{1.1, 2.02, 3.5, 4.9, 5.0, 3.7, 0.9}; // di...
/* Author : Ankush Kamboj Date : 11/07/2019 Time : 20:00 Description : Returns an iterator pointing to the first element in the vector. */ #include <iostream> #include <vector> int main() { // create a vector of 5 integers std::vector<int> myVector{1, 2, 3, 4, 5}; // display the vector conten...
// Style Guide => https://github.com/Bhupesh-V/30-Seconds-Of-STL/blob/master/CONTRIBUTING.md/#Style Guide /* Author : Y. Sai Sriram Date : 28/09/2019 Time : 10:17 Description : Returns the space currently allocated to the vector */ #include <iostream> #include <vector> int main() { // create a ve...
/* Author : Spencer Koss Date : 10/01/2019 Time : 5:11 Description : The function returns an iterator which is used to iterate container. */ #include <iostream> #include <vector> int main() { //Create a vector std::vector<int> vectorExample; //5 integer values are stored vectorE...
/* Author : Jayshree Aishwarya Date : 18/10/2019 Time : 22:20 Description : It returns a const_reverse_iterator pointing to the last element in the container (i.e., its reverse beginning). */ #include <iostream> #include <vector> //Demonstrating the use of crbegin() int main () { // the vector ...
/* Author : Rishabh Arora Date : 14/10/2019 Time : 21:42 Description : The function returns a constant iterator to the reverse end of the sequence. */ #include <iostream> #include <vector> int main(){ //Declaring a vector std::vector<int> vectorSample; //Inititializing the vector ...
/* Author : Yashwi Shah Date : 10/15/2019 Time : 12:40 Description : The function returns a pointer to the first element in the array which is used internally by the vector. */ #include <iostream> #include <vector> int main() { // vector initialisation std::vector<int> v = { 1, 2, 3, 4,...
/* Author : Y. Sai Sriram Date : 29/09/2019 Time : 10:53 Description : Places an element in the vector at the specified position */ #include <iostream> #include <vector> void print(const std::vector<int> &vec){ for(auto num : vec){ std::cout << num << " "; } } int main(){ //creating a vector...
/* Author : Natália A. de Brito Date : 20/10/2019 Time : 21:19 Description : Constructs and places an element at the end of the vector */ #include <iostream> #include <vector> // Simple example struct struct triangle { double base, height; triangle(double b, double h) : base(b), height(h) {} }; ...
/* Author : Drashti Modasara Date : 12/10/2019 Time : 15:17 Description : Returns 1 if the vector is empty and 0 otherwise. */ #include<iostream> #include<vector> int main() { std::vector<int> v1; v1.push_back(2); v1.push_back(4); // display the vector contents using std::vector::empty...
/* Author : Ankush Kamboj Date : 11/07/2019 Time : 20:00 Description : Returns an iterator referring to the past-the-end (next to last element) element in the vector container. */ #include <iostream> #include <vector> int main() { // create a vector of 5 integers std::vector<int> myVector{1, 2,...
/* Author : Xenofon Karamanos Date : 24/05/2019 Time : 12:17 Description : Showcase std::vector::erase to delete a specific value from vector. */ #include <iostream> #include <vector> #include <algorithm> void print(const std::vector<int> &vector){ std::cout << "{ "; for (auto num : vector)...
/* Author : Jayshree Aishwarya Date : 18/10/2019 Time : 00:04 Description : Used to fetch the first element of a vector */ #include <iostream> #include <vector> int main() { // A vector storing rainfall(in inches) of a week std::vector<float> vRainfall{1.1, 2.02, 3.5, 4.9, 5.0, 3.7, 0.9}; // d...
#include <iostream> #include <vector> #define SIZE 8 int main() { std::vector<char> arr; // Allocate space for SIZE elements char *ptr = arr.get_allocator().allocate(SIZE); // Construct values in-place on the vector // The values are the characters 'a', 'b', ... for (int i = 0; i < SIZE; i++)...
/* Author : Jordan Mingus Date : 06/05/2019 Time : 03:50 Description : Showcase std::vector::insert to insert numbers into a vector. */ #include <iostream> #include <vector> void print(const std::vector<int>& vec){ std::cout << '{'; for (auto x: vec) { std::cout << ' ' << x; } ...
/* Author : Y. Sai Sriram Date : 29/09/2019 Time : 08:43 Description : Returns the maximum number of elements that a vector can hold. */ #include <iostream> #include <vector> int main(){ //create two vectors, one empty and one having 6 elements std::vector<int> vector1{10, 20, 30, 40, 50, 60}; ...
/* Author: Y. Sai Sriram Date: 26/09/2019 Time: 6:25 Description : std::vector::pop_back from STL is used to remove elements of a vector from the end. */ #include <iostream> #include <vector> void print(const std::vector<int> &vec) { for(auto elem : vec) //auto automatically assigns v...
// Follow the Style Guide while submitting code PR. // Style Guide => https://github.com/Bhupesh-V/30-Seconds-Of-STL/blob/master/CONTRIBUTING.md/#Style Guide /* Author : Kamal Kant Sharma Date : 05/07/2019 Time : 13:44 Description : std::vector::push_back from STL is used to add new elements to the end ...
/* Author : Rok Krhlikar Date : 07/10/2019 Time : 19:30 Description : Returns a reverse iterator pointing to the last element in the vector (i.e., its reverse beginning). */ #include <iostream> #include <vector> int main() { // create a vector of 5 integers std::vector<int> myVector{1, 2, 3, 4, ...
/* Author : Rok Krhlikar Date : 07/10/2019 Time : 19:30 Description : Returns a reverse iterator pointing to the theoretical element preceding the first element in the vector (which is considered its reverse end). */ #include <iostream> #include <vector> int main() { // create a vector of 5 integ...
/* Author : Y. Sai Sriram Date : 29/09/2019 Time : 09:03 Description : Helps specify the minimum size of a vector */ #include <iostream> #include <vector> int main(){ //create an empty vector std::vector<int> myvector; //reserve a size of 'atleast' 5 elements myvector.reserve(5); //inserting 5...
// Follow the Style Guide while submitting code PR. // Style Guide => https://github.com/Bhupesh-V/30-Seconds-Of-STL/blob/master/CONTRIBUTING.md/#Style Guide /* Author : this must be your name ;) Date : Date format dd/mm/yyyy Time : Time format hh:mm Description : description should be small & one liner...
/* Author : Y. Sai Sriram Date : 29/09/2019 Time : 11:09 Description : Reduces the capacity of the container to fit its size. */ #include <iostream> #include <vector> int main(){ //create a vector of 5 elements std::vector<int> myvec{10, 20, 30, 40, 50}; //adding a sixth element, vector's capa...
/* Author : Italo Vinicius Date : 01/10/2019 Time : 21:00 Description : Returns a ordered vector in increasing or decreasing order. */ #include <iostream> #include <algorithm> #include <vector> int main() { // create a vector of 10 integers std::vector<int> v {-1,0,4,-5,12,2,10,-11,3,5}; // d...
// Follow the Style Guide while submitting code PR. // Style Guide => https://github.com/Bhupesh-V/30-Seconds-Of-STL/blob/master/CONTRIBUTING.md/#Style Guide /* Author : Pankaj Raghav Date : 28/05/2019 Time : 23:15 Description : std::vector::swap from STL is used to swap the contents of two vectors */ ...
#include <stdio.h> int main() { return printf("Hello World!\n"); }
#pragma once #include "shared/glFramework/GLFWApp.h" class GLSkyboxRenderer { public: GLSkyboxRenderer( const char* envMap = "data/immenstadter_horn_2k.hdr", const char* envMapIrradiance = "data/immenstadter_horn_2k_irradiance.hdr") : envMap_(GL_TEXTURE_CUBE_MAP, envMap) , envMapIrradiance_(GL_TEXTURE_CUBE_MAP...
#include <stdio.h> #include <stdlib.h> #include <vector> #include "shared/glFramework/GLFWApp.h" #include "shared/glFramework/GLShader.h" #include "shared/glFramework/GLSceneData.h" #include "shared/glFramework/GLFramebuffer.h" #include "shared/glFramework/LineCanvasGL.h" #include "shared/glFramework/UtilsGLImGui.h" #...
#include <stdio.h> #include <stdlib.h> #include <vector> #include "shared/glFramework/GLFWApp.h" #include "shared/glFramework/GLShader.h" #include "shared/glFramework/GLSceneData.h" #include "shared/glFramework/GLFramebuffer.h" #include "shared/glFramework/LineCanvasGL.h" #include "shared/glFramework/UtilsGLImGui.h" #...
#include <stdio.h> #include <stdlib.h> #include <vector> #include "shared/glFramework/GLFWApp.h" #include "shared/glFramework/GLShader.h" #include "shared/glFramework/GLSceneData.h" #include "shared/glFramework/GLFramebuffer.h" #include "shared/glFramework/LineCanvasGL.h" #include "shared/glFramework/UtilsGLImGui.h" #...
#include <stdio.h> #include <stdlib.h> #include <vector> #include "shared/glFramework/GLFWApp.h" #include "shared/glFramework/GLShader.h" #include "shared/glFramework/GLSceneDataLazy.h" #include "shared/glFramework/GLFramebuffer.h" #include "shared/glFramework/LineCanvasGL.h" #include "shared/glFramework/UtilsGLImGui....
#include <stdio.h> #include <stdlib.h> #include <vector> #include "shared/glFramework/GLFWApp.h" #include "shared/glFramework/GLShader.h" #include "shared/glFramework/GLSceneDataLazy.h" #include "shared/glFramework/GLFramebuffer.h" #include "shared/glFramework/LineCanvasGL.h" #include "shared/glFramework/UtilsGLImGui....
#include "shared/vkFramework/VulkanApp.h" #include "shared/vkFramework/LineCanvas.h" #include "shared/vkFramework/GuiRenderer.h" #include "shared/vkFramework/QuadRenderer.h" #include "shared/vkFramework/VulkanShaderProcessor.h" struct node { uint32_t idx; float xx, yy; }; static_assert(sizeof(node) == 3 * sizeof(ui...
#include "FinalRenderer.h" #include <stb/stb_image.h> BaseMultiRenderer::BaseMultiRenderer( VulkanRenderContext& ctx, VKSceneData& sceneData, const std::vector<int>& objectIndices, const char* vertShaderFile, const char* fragShaderFile, const std::vector<VulkanTexture>& outputs, RenderPass screenRenderPass, co...
#pragma once #include "shared/vkFramework/MultiRenderer.h" #include "shared/vkFramework/effects/LuminanceCalculator.h" #include <algorithm> #include <numeric> const uint32_t ShadowSize = 8192; /** The "finalized" variant of MultiRenderer For Chapter 10's demo we need to extract indirect buffer with rendering co...
#include "shared/vkFramework/VulkanApp.h" #include "shared/vkFramework/GuiRenderer.h" #include "shared/vkFramework/QuadRenderer.h" #include "shared/vkFramework/CubeRenderer.h" #include "shared/vkFramework/LineCanvas.h" #include "shared/vkFramework/effects/SSAOProcessor.h" #include "shared/vkFramework/effects/HDRProces...
#include <glad/gl.h> #include <GLFW/glfw3.h> #include <stdio.h> #include <stdlib.h> static const char* shaderCodeVertex = R"( #version 460 core layout (location=0) out vec3 color; const vec2 pos[3] = vec2[3]( vec2(-0.6, -0.4), vec2( 0.6, -0.4), vec2( 0.0, 0.6) ); const vec3 col[3] = vec3[3]( vec3( 1.0, 0.0, 0.0 ...
#include <glad/gl.h> #include <GLFW/glfw3.h> #include <glm/glm.hpp> #include <glm/ext.hpp> #include <stdio.h> #include <stdlib.h> using glm::mat4; using glm::vec3; static const char* shaderCodeVertex = R"( #version 460 core layout(std140, binding = 0) uniform PerFrameData { uniform mat4 MVP; uniform int isWirefram...
#include <glad/gl.h> #include <GLFW/glfw3.h> #include <glm/glm.hpp> #include <glm/ext.hpp> #include <filesystem> #define STB_IMAGE_IMPLEMENTATION #include <stb/stb_image.h> #define STB_IMAGE_WRITE_IMPLEMENTATION #include <stb/stb_image_write.h> #include <stdio.h> #include <stdlib.h> using glm::mat4; using glm::vec3;...
#if defined(_MSC_VER) # pragma warning(push) # pragma warning(disable:4099) // type name first seen using 'class' now seen using 'struct' # pragma warning(disable:4244) // 'argument': conversion from 'float' to 'int', possible loss of data # pragma warning(disable:4267) // conversion from 'size_t' to 'int', possible...
#include <glad/gl.h> #include <GLFW/glfw3.h> #include <imgui/imgui.h> #include <glm/glm.hpp> #include <glm/ext.hpp> #include <stdlib.h> #include <stdio.h> #include <stdint.h> using glm::mat4; int main() { glfwSetErrorCallback( [](int error, const char* description) { fprintf(stderr, "Error: %s\n", descriptio...
#include <glad/gl.h> #include <GLFW/glfw3.h> #include <glm/glm.hpp> #include <glm/ext.hpp> #include <easy/profiler.h> #include <stdio.h> #include <stdlib.h> #include <chrono> #include <thread> using glm::mat4; using glm::vec3; static const char* shaderCodeVertex = R"( #version 460 core layout(std140, binding = 0) un...
#include <glad/gl.h> #include <GLFW/glfw3.h> #include <glm/glm.hpp> #include <glm/ext.hpp> #include <optick.h> #include <stdio.h> #include <stdlib.h> #include <chrono> #include <thread> using glm::mat4; using glm::vec3; static const char* shaderCodeVertex = R"( #version 460 core layout(std140, binding = 0) uniform P...
#include <glad/gl.h> #include <GLFW/glfw3.h> #include <glm/glm.hpp> #include <glm/ext.hpp> #include <assimp/scene.h> #include <assimp/postprocess.h> #include <assimp/cimport.h> #include <assimp/version.h> #include <stdio.h> #include <stdlib.h> #include <vector> using glm::mat4; using glm::vec3; static const char* s...
#include <stdio.h> #include <stdint.h> #include <thread> #include <vector> #include "etc2comp/EtcLib/Etc/Etc.h" #include "etc2comp/EtcLib/Etc/EtcImage.h" #include "etc2comp/EtcLib/Etc/EtcFilter.h" #include "etc2comp/EtcTool/EtcFile.h" #define STB_IMAGE_IMPLEMENTATION #include <stb/stb_image.h> int main() { int w, h...
#include <stdio.h> #include <stdint.h> #include <iostream> #include <fstream> #include <thread> #include <vector> #include <taskflow/taskflow.hpp> int main() { tf::Taskflow taskflow; std::vector<int> items{ 1, 2, 3, 4, 5, 6, 7, 8 }; auto task = taskflow.for_each( items.begin(), items.end(), [](int item) { ...
#include <glad/gl.h> #include <GLFW/glfw3.h> #include <glm/glm.hpp> #include <glm/ext.hpp> #include <assimp/scene.h> #include <assimp/postprocess.h> #include <assimp/cimport.h> #include <assimp/version.h> #include <meshoptimizer.h> #include <stdio.h> #include <stdlib.h> #include <vector> using glm::mat4; using glm::...
#pragma once #include "glcorearb.h" using PFNGETGLPROC = void* (const char*); struct GL4API { # include "GLAPI.h" }; void GetAPI4(GL4API* api, PFNGETGLPROC GetGLProc); void InjectAPITracer4(GL4API* api);
PFNGLACTIVETEXTUREPROC glActiveTexture; PFNGLATTACHSHADERPROC glAttachShader; PFNGLBEGINQUERYPROC glBeginQuery; PFNGLBINDATTRIBLOCATIONPROC glBindAttribLocation; PFNGLBINDBUFFERPROC glBindBuffer; PFNGLBINDBUFFERBASEPROC glBindBufferBase; PFNGLBINDBUFFERRANGEP...
#include <assert.h> #include "GL.h" #include "GLAPITrace.h" #define W( en ) if ( e == en ) return #en; std::string Enum2String(GLenum e) { /* BeginMode */ W(GL_POINTS); W(GL_LINES); W(GL_LINE_LOOP); W(GL_LINE_STRIP); W(GL_TRIANGLES); W(GL_TRIANGLE_STRIP); W(GL_TRIANGLE_FAN); /* BlendingFactorDest */ W(...
#include <string> #include <inttypes.h> namespace { GL4API apiHook; } // namespace using PFNGETGLPROC = void* (const char*); #define E2S( en ) Enum2String( en ).c_str() extern std::string Enum2String( GLenum e ); void GLTracer_glCullFace(GLenum mode) { printf("glCullFace(" "%s)\n", E2S(mode)); apiHook.glCullFace...
#ifndef __glcorearb_h_ #define __glcorearb_h_ 1 #ifdef __cplusplus extern "C" { #endif /* ** Copyright (c) 2013-2014 The Khronos Group Inc. ** ** Permission is hereby granted, free of charge, to any person obtaining a ** copy of this software and/or associated documentation files (the ** "Materials"), to deal in the ...
#include <assert.h> #include <stdio.h> #include "GL.h" #include <GLFW/glfw3.h> #include <glm/glm.hpp> #include <glm/ext.hpp> #define STB_IMAGE_IMPLEMENTATION #include <stb/stb_image.h> #define STB_IMAGE_WRITE_IMPLEMENTATION #include <stb/stb_image_write.h> using glm::mat4; using glm::vec3; static const char* shade...
#include <glad/gl.h> #include <GLFW/glfw3.h> #include <glm/glm.hpp> #include <glm/ext.hpp> #include <assimp/scene.h> #include <assimp/postprocess.h> #include <assimp/cimport.h> #include <assimp/version.h> #include <stdio.h> #include <stdlib.h> #define STB_IMAGE_IMPLEMENTATION #include <stb/stb_image.h> #include "sha...
#include <stdio.h> #include <stdlib.h> #include <vector> #include "shared/glFramework/GLShader.h" #include "shared/UtilsMath.h" #include "shared/Bitmap.h" #include "shared/debug.h" #include "shared/UtilsCubemap.h" #include <glad/gl.h> #include <GLFW/glfw3.h> #include <glm/glm.hpp> #include <glm/ext.hpp> #include <ass...
#define VK_NO_PROTOTYPES #define GLFW_INCLUDE_VULKAN #include <cstdio> #include <cstdlib> #include <cstring> #include <vector> #include "shared/Utils.h" #include "shared/UtilsVulkan.h" void saveSPIRVBinaryFile(const char* filename, unsigned int* code, size_t size) { FILE* f = fopen(filename, "w"); if (!f) retur...
#define VK_NO_PROTOTYPES #define GLFW_INCLUDE_VULKAN #include <GLFW/glfw3.h> #include <cstdio> #include <cstdlib> #include <cstring> #include <chrono> #include "shared/Utils.h" #include "shared/UtilsVulkan.h" #include <glm/glm.hpp> #include <glm/ext.hpp> using glm::mat4; using glm::vec3; using glm::vec4; const uint3...
#include <stdio.h> #include <stdlib.h> #include <vector> #include "shared/glFramework/GLShader.h" #include "shared/UtilsMath.h" #include "shared/Bitmap.h" #include "shared/debug.h" #include "shared/UtilsCubemap.h" #include "shared/Camera.h" #include <glad/gl.h> #include <GLFW/glfw3.h> #include <glm/glm.hpp> #include ...
#include <stdio.h> #include <stdlib.h> #include <vector> #include "shared/glFramework/GLShader.h" #include "shared/UtilsMath.h" #include "shared/Bitmap.h" #include "shared/debug.h" #include "shared/UtilsCubemap.h" #include "shared/UtilsFPS.h" #include "shared/Camera.h" #include <glad/gl.h> #include <GLFW/glfw3.h> #in...
#define VK_NO_PROTOTYPES #define GLFW_INCLUDE_VULKAN #include <GLFW/glfw3.h> #include <imgui/imgui.h> #include <cstdio> #include <cstdlib> #include <cstring> #include <chrono> #include <deque> #include <memory> #include <limits> #include "shared/Utils.h" #include "shared/UtilsMath.h" #include "shared/UtilsFPS.h" #incl...
#include <stdio.h> #include <stdlib.h> #include <vector> #include "shared/glFramework/GLFWApp.h" #include "shared/glFramework/GLShader.h" #include "shared/UtilsMath.h" #include "shared/Camera.h" struct PerFrameData { mat4 view; mat4 proj; vec4 cameraPos; }; struct MouseState { glm::vec2 pos = glm::vec2(0.0f); b...
#include <stdio.h> #include <stdlib.h> #include <vector> #include "shared/glFramework/GLFWApp.h" #include "shared/glFramework/GLShader.h" #include "shared/UtilsMath.h" #include "shared/Camera.h" #include "shared/glFramework/UtilsGLImGui.h" #include <assimp/scene.h> #include <assimp/postprocess.h> #include <assimp/cim...
#include <stdio.h> #include <stdlib.h> #include <vector> #include "shared/glFramework/GLFWApp.h" #include "shared/glFramework/GLShader.h" #include "shared/UtilsMath.h" #include "shared/Camera.h" #include "shared/scene/VtxData.h" #define STB_IMAGE_IMPLEMENTATION #include <stb/stb_image.h> struct PerFrameData { mat4...
#include <assimp/scene.h> #include <assimp/postprocess.h> #include <assimp/cimport.h> #include "shared/scene/VtxData.h" #include <meshoptimizer.h> MeshData g_meshData; uint32_t g_indexOffset = 0; uint32_t g_vertexOffset = 0; constexpr uint32_t g_numElementsToStore = 3 + 3 + 2; float g_meshScale = 0.01f; bool g_cal...
#include "shared/vkFramework/VulkanApp.h" #include "shared/vkRenderers/VulkanClear.h" #include "shared/vkRenderers/VulkanFinish.h" #include "shared/vkRenderers/VulkanMultiMeshRenderer.h" const uint32_t kScreenWidth = 1280; const uint32_t kScreenHeight = 720; GLFWwindow* window; VulkanInstance vk; VulkanRenderDevice ...
#include <stdio.h> #include <stdlib.h> #include <vector> #include "shared/Bitmap.h" #include "shared/glFramework/GLFWApp.h" #include "shared/glFramework/GLShader.h" #include "shared/glFramework/GLTexture.h" #include "shared/UtilsMath.h" #include "shared/Camera.h" #include "shared/scene/VtxData.h" #include "shared/Util...
#include <imgui/imgui.h> #include "shared/UtilsCubemap.h" #include "shared/vkFramework/VulkanApp.h" #include "stb_image.h" #define STB_IMAGE_WRITE_IMPLEMENTATION #include "stb_image_write.h" int numPoints = 1024; void process_cubemap(const char* filename, const char* outFilename) { int w, h, comp; const float* im...
#include "shared/vkFramework/VulkanApp.h" #include "shared/vkRenderers/VulkanComputeBase.h" #include <gli/gli.hpp> #include <gli/texture2d.hpp> #include <gli/load_ktx.hpp> constexpr int brdfW = 256; constexpr int brdfH = 256; const uint32_t bufferSize = 2 * sizeof(float) * brdfW * brdfH; float lutData[bufferSize]; ...
#include "shared/vkFramework/VulkanApp.h" #include "shared/vkRenderers/VulkanClear.h" #include "shared/vkRenderers/VulkanFinish.h" #include "shared/vkRenderers/VulkanQuadRenderer.h" const uint32_t kScreenWidth = 1280; const uint32_t kScreenHeight = 720; GLFWwindow* window; VulkanInstance vk; VulkanRenderDevice vkDev...
#include "shared/vkFramework/VulkanApp.h" #include "shared/vkRenderers/VulkanSingleQuad.h" #include "shared/vkRenderers/VulkanComputedImage.h" #include "shared/vkRenderers/VulkanClear.h" #include "shared/vkRenderers/VulkanFinish.h" std::unique_ptr<VulkanClear> clear; std::unique_ptr<VulkanSingleQuadRenderer> quad; std...
#include "shared/vkFramework/VulkanApp.h" #include <imgui/imgui.h> #include "shared/vkRenderers/VulkanClear.h" #include "shared/vkRenderers/VulkanComputedVB.h" #include "shared/vkRenderers/VulkanComputedImage.h" #include "shared/vkRenderers/VulkanFinish.h" #include "shared/vkRenderers/VulkanModelRenderer.h" #include ...
#include "shared/vkFramework/VulkanApp.h" #include "shared/vkRenderers/VulkanClear.h" #include "shared/vkRenderers/VulkanFinish.h" #include "shared/vkRenderers/VulkanPBRModelRenderer.h" #include "shared/Camera.h" std::unique_ptr<PBRModelRenderer> modelPBR; glm::vec3 cameraPos(0.0f, 0.0f, 0.0f); glm::vec3 cameraAngle...
#include <stdio.h> #include <stdlib.h> #include <vector> #include "shared/glFramework/GLFWApp.h" #include "shared/glFramework/GLShader.h" #include "shared/glFramework/GLSceneData.h" #include "shared/UtilsMath.h" #include "shared/Camera.h" #include "shared/scene/VtxData.h" #define STB_IMAGE_IMPLEMENTATION #include <s...
#include <algorithm> #include <execution> #include <fstream> #include <filesystem> #include <assimp/cimport.h> #include <assimp/material.h> #include <assimp/pbrmaterial.h> #include <assimp/postprocess.h> #include <assimp/scene.h> #include <rapidjson/istreamwrapper.h> #include <rapidjson/document.h> #include <rapidjso...
#include "shared/vkFramework/VulkanApp.h" #include "shared/vkFramework/GuiRenderer.h" #include "shared/vkFramework/MultiRenderer.h" #include "shared/vkFramework/QuadRenderer.h" #include "shared/vkFramework/InfinitePlaneRenderer.h" #include "ImGuizmo.h" #include <math.h> struct MyApp: public CameraApp { MyApp() : C...
#include "shared/vkFramework/VulkanApp.h" #include "shared/vkFramework/GuiRenderer.h" #include "shared/vkFramework/MultiRenderer.h" struct MyApp: public CameraApp { MyApp() : CameraApp(-95, -95) , envMap(ctx_.resources.loadCubeMap("data/piazza_bologni_1k.hdr")) , irrMap(ctx_.resources.loadCubeMap("data/piazza_bolo...
#pragma once const GLuint kBufferIndex_PerFrameUniforms = 0; const GLuint kBufferIndex_ModelMatrices = 1; const GLuint kBufferIndex_Materials = 2; struct DrawElementsIndirectCommand { GLuint count_; GLuint instanceCount_; GLuint firstIndex_; GLuint baseVertex_; GLuint baseInstance_; }; class GLMesh final { publ...
#include <memory> #include <stdio.h> #include <stdlib.h> #include <vector> #include "shared/Bitmap.h" #include "shared/glFramework/GLFWApp.h" #include "shared/glFramework/GLShader.h" #include "shared/glFramework/GLTexture.h" #include "shared/glFramework/GLFramebuffer.h" #include "shared/glFramework/LineCanvasGL.h" #in...
#include <stdio.h> #include <stdlib.h> #include <vector> #include "shared/glFramework/GLFWApp.h" #include "shared/glFramework/GLShader.h" #include "shared/glFramework/GLSceneData.h" #include "shared/glFramework/GLFramebuffer.h" #include "shared/glFramework/UtilsGLImGui.h" #include "shared/UtilsMath.h" #include "shared...
#include <stdio.h> #include <stdlib.h> #include <vector> #include "shared/glFramework/GLFWApp.h" #include "shared/glFramework/GLShader.h" #include "shared/glFramework/GLSceneData.h" #include "shared/glFramework/GLFramebuffer.h" #include "shared/glFramework/UtilsGLImGui.h" #include "shared/UtilsMath.h" #include "shared...
#include <stdio.h> #include <stdlib.h> #include <vector> #include "shared/glFramework/GLFWApp.h" #include "shared/glFramework/GLShader.h" #include "shared/glFramework/GLSceneData.h" #include "shared/glFramework/GLFramebuffer.h" #include "shared/glFramework/UtilsGLImGui.h" #include "shared/UtilsMath.h" #include "shared...
#include "shared/vkFramework/VulkanApp.h" #include "shared/vkFramework/LineCanvas.h" #include "shared/vkFramework/QuadRenderer.h" #include "shared/vkFramework/GuiRenderer.h" #include "shared/vkFramework/VulkanShaderProcessor.h" #include "shared/vkFramework/InfinitePlaneRenderer.h" bool g_RotateModel = true; float g_M...
#include "shared/vkFramework/VulkanApp.h" #include "shared/vkFramework/GuiRenderer.h" #include "shared/vkFramework/MultiRenderer.h" #include "shared/vkFramework/QuadRenderer.h" const char* envMapFile = "data/piazza_bologni_1k.hdr"; const char* irrMapFile = "data/piazza_bologni_1k_irradiance.hdr"; #include "shared/vkF...
#include "shared/vkFramework/VulkanApp.h" #include "shared/vkFramework/GuiRenderer.h" #include "shared/vkFramework/MultiRenderer.h" #include "shared/vkFramework/QuadRenderer.h" #include "shared/vkFramework/CubeRenderer.h" #include "shared/vkFramework/effects/HDRProcessor.h" #include "shared/vkFramework/Barriers.h" c...
#pragma once #include <functional> const GLuint kBufferIndex_PerFrameUniforms = 0; const GLuint kBufferIndex_ModelMatrices = 1; const GLuint kBufferIndex_Materials = 2; struct DrawElementsIndirectCommand { GLuint count_; GLuint instanceCount_; GLuint firstIndex_; GLuint baseVertex_; GLuint baseInstance_; }; cl...
#include "shared/vkFramework/VulkanApp.h" #include "shared/vkFramework/GuiRenderer.h" #include "shared/vkFramework/MultiRenderer.h" #include "shared/vkFramework/InfinitePlaneRenderer.h" #include "physics.h" struct MyApp: public CameraApp { MyApp() : CameraApp(-90, -90) , plane(ctx_) , sceneData(ctx_, "data/meshes...