Skip to content

Instantly share code, notes, and snippets.

View romualdo97's full-sized avatar

Romualdo VIllalobos romualdo97

View GitHub Profile
@romualdo97
romualdo97 / README.md
Last active April 18, 2025 17:52
Basic C++ Utf8String class
@romualdo97
romualdo97 / Vulkan02_CreatingCommandBufferAndPresenting.cpp
Created July 19, 2024 14:01
Snippet from Vulkan and Unreal VulkanRHI studies outlining a command buffer that clears an image and is submitted into GPU for processing then the result is presented, this will become more abstract as we advance in the RHI API studies, here we see the plain Vulkan API
void FVulkanDynamicRHI::DoExperimentsSetup()
{
// Create a swap chain and its surface
std::vector<VkImage> Images;
const FVulkanSwapChain SwapChain{Instance, *Device, GetWindowHandle(), 300, 300, Images};
// Create a command memory pool
const VkCommandPoolCreateInfo CommandPoolCreateInfo
{
VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
// Windows
#include <windows.h>
#include <libloaderapi.h>
// Vulkan
#include <vulkan.h>
// Std
#include <iostream>
#include <vector>
@romualdo97
romualdo97 / DelegateSignatureImpl.h
Last active October 28, 2022 19:41
Simplified and cloned Unreal TDelegate class for study
#pragma once
#include <memory>
/* ======================================================================= */
/* Base delegateInstance interface */
template <typename FuncType>
struct IBaseDelegateInstance;
template <typename RetType, typename... ArgTypes>
struct IBaseDelegateInstance<RetType(ArgTypes...)>
@romualdo97
romualdo97 / hello_glfw.cpp
Created December 7, 2020 18:11
Hello world app using GLFW
#include <glad\glad.h>
#include <GLFW\glfw3.h>
#include <iostream>
#define W 960
#define H 480
#define WINDOW_TITLE "Hello window"
void resize_framebuffer_cb(GLFWwindow *window, int w, int h);
@romualdo97
romualdo97 / README.md
Last active July 16, 2020 18:44
The volkano project core

This class is basically a rudimentary state machine, the states are set by calling rightVolcanRotate(), rightVolcanStop(), leftVolcanRotate(), and leftVolcanStop(). Those methods are invoked by the leap motion unity SDK (4.5.0)

https://developer.leapmotion.com/unity#5436356

The leap motion SDK exposes some unity events for some gestures, eg: left hand opened, right hand opened, the Animation's methods are invoked when those events happens. For more details I recommend to play around with the leap sdk.

@romualdo97
romualdo97 / hello_world.cpp
Created November 23, 2018 02:41
OpenCV tutorial
#include <opencv2/core.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
using namespace cv;
using namespace std;
int main( int argc, char** argv )
{
if( argc != 2)
{
@romualdo97
romualdo97 / flowShader.frag
Last active February 4, 2018 03:05
Simple texture advection: texture flow shader
#version 150
// CONSTANTS
#define DEBUG_MODE
// UNIFORMS
uniform sampler2D tex0; // flow field texture
uniform sampler2D tex1; // texture A for swapping
uniform sampler2D tex2; // texture B for swapping
uniform float time;
using System;
// una clase es una carpeta
public class Humanos
{
// mi carpeta contine elementos...
// que pueden ser...
// PROPIEDADES que me sirven para definir
// crear el VBO(vertex buffer object) con el fin de designar un espacio en la GPU para los vertices del triangulo
GLuint VBO_ID;
glGenBuffers(1, &VBO_ID);
// bind the newly created buffer to the GL_ARRAY_BUFFER target
glBindBuffer(GL_ARRAY_BUFFER, VBO_ID);
// copies the previously defined triangle vertices data into the buffer's memory:
glBufferData(GL_ARRAY_BUFFER, sizeof(triangle_vertices), triangle_vertices, GL_STATIC_DRAW);