Skip to content

Instantly share code, notes, and snippets.

View malytomas's full-sized avatar

Tomáš Malý malytomas

  • Prague, Czech Republic
View GitHub Profile
#pragma once
#include <cmath>
#include <glm/glm.hpp>
inline void findMinMax(float x0, float x1, float x2, float &min, float &max) {
min = max = x0;
if (x1 < min)
min = x1;
if (x1 > max)
@tilkinsc
tilkinsc / load_dds.c
Last active November 12, 2024 19:02
C OpenGL DDS Loading Tutorial
/*
Can load easier and more indepth with https://github.com/Hydroque/DDSLoader
Because a lot of crappy, weird DDS file loader files were found online. The resources are actually VERY VERY limited.
Written in C, can very easily port to C++ through casting mallocs (ensure your imports are correct), goto can be replaced.
https://www.gamedev.net/forums/topic/637377-loading-dds-textures-in-opengl-black-texture-showing/
http://www.opengl-tutorial.org/beginners-tutorials/tutorial-5-a-textured-cube/
^ Two examples of terrible code