This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* MIT License | |
* | |
* Copyright (c) 2017-2022 Cody Tilkins | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Created by: http://github.com/tilkinsc | |
// returns ALuint* aka a single openal buffer of ready-to-play ogg vorbis sound samples | |
// returns 0 on error | |
ALuint* sound_load_ogg(const char* path) { | |
ALenum error = 0; | |
ALuint* sound = 0; | |
FILE* fp = 0; | |
OggVorbis_File vf; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local sub = string.sub | |
local concat = table.concat | |
local insert = table.insert | |
string.where = function(self, predicate) | |
local buf = {} | |
for i = 1, #self do | |
local ch = sub(self, i, i) | |
if (predicate(ch)) then | |
insert(buf, ch) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Text.Json; | |
namespace Meerkat.Json; | |
public interface IJSONSerializable | |
{ | |
} | |
/// <summary> | |
/// Implements the ability to load JSON files. By default, if the json file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
See https://gist.github.com/tilkinsc/7f383faccf3722622f5d0cc9bd45e7e6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Runtime.InteropServices; | |
namespace Util; | |
class TwoWayMemoryStream : MemoryStream | |
{ | |
private byte[] _buffer; | |
private TwoWayMemoryStream() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum DDSD | |
{ | |
NONE = 0x00, | |
CAPS = 0x01, | |
HEIGHT = 0x02, | |
WIDTH = 0x04, | |
PITCH = 0x08, | |
PIXELFORMAT = 0x1000, | |
MIPMAPCOUNT = 0x20000, | |
LINEARSIZE = 0x80000, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "wave.h" | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
// wave.h start | |
typedef struct WaveData { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// tiles_x the amount of tiles in the image in the x dimension | |
// tiles_y the amount of tiles in the image in the y dimension | |
void Texture::finalizeArray(GLsizei tiles_x, GLsizei tiles_y) { | |
// read in file data | |
Material* mat = new Material("file.bmp"); // MUST be power of 2 | |
mat->mips = 1; // !single image! | |
// defines ogl parameters |
NewerOlder