Skip to content

Instantly share code, notes, and snippets.

View piusayowale's full-sized avatar

OGUNLEYE AYOWALE piusayowale

  • Lagos, Nigeria
View GitHub Profile
@piusayowale
piusayowale / ComposeFunctor.cpp
Last active June 14, 2023 14:47
c++ example of how to compose an operation
#include <iostream>
#include <string>
#include <memory>
class Base{
public:
Base(){
.\bin\gn gen out/arm --args="ndk=\"C:/ndk/23.1.7779620\" target_os=\"android\" target_cpu=\"arm\""
@piusayowale
piusayowale / CMakeLists.txt
Created February 19, 2023 21:41 — forked from mikilian/CMakeLists.txt
Modern C++ development with alpine linux, cmake, clang inside a docker container
set(CMAKE_C_COMPILER clang)
set(CMAKE_CXX_COMPILER clang++)
cmake_minimum_required(VERSION 3.18)
set(APP_NAME "example-app")
project("${APP_NAME}")
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -std=c++20 -Wno-multichar")
@piusayowale
piusayowale / properbatching.cpp
Created February 5, 2023 17:48
how to batch opengl draw calls
// graphOpengl.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <glad/glad.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_opengl.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
@piusayowale
piusayowale / instancedTexture.cpp
Created February 2, 2023 21:57
rendering instance of sprite
#include <iostream>
#include <glad/glad.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_opengl.h>
#include <vector>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
@piusayowale
piusayowale / sprite.cpp
Created February 2, 2023 19:07
load sprite opengl
#include <iostream>
#include <glad/glad.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_opengl.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#define STB_IMAGE_IMPLEMENTATION
@piusayowale
piusayowale / makeitscroll.cpp
Created January 30, 2023 20:29
scrolling screen opengl
// graphOpengl.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <glad/glad.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_opengl.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
@piusayowale
piusayowale / athousandBox.cpp
Created January 29, 2023 18:46
1000 box with opengl
// graphOpengl.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <glad/glad.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_opengl.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
@piusayowale
piusayowale / batchRenderStep1.cpp
Created January 28, 2023 19:08
a step closer to batch rendering
// graphOpengl.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <glad/glad.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_opengl.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
@piusayowale
piusayowale / openglsdl.cpp
Created January 28, 2023 13:06
Send color information along buffer data
// graphOpengl.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <glad/glad.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_opengl.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>