This file contains hidden or 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
#version 450 | |
#define VGL_VULKAN | |
#extension GL_ARB_separate_shader_objects : enable | |
#ifdef GL_ES | |
precision highp float; | |
#else | |
#define highp | |
#define lowp |
This file contains hidden or 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
#version 450 | |
#define VGL_VULKAN | |
#extension GL_ARB_separate_shader_objects : enable | |
#define SPRITE_SCALE 0.200000 | |
struct PerInstance | |
{ | |
//.xyz are xyz pos in 3D | |
//abs(.w) is texture atlas x-shift | |
//sign(.w) can be -1 for h-flip |
This file contains hidden or 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
/*** Not optimized or perfect, but hopefully helps someone else learn **/ | |
//https://gamedev.stackexchange.com/questions/96459/fast-ray-sphere-collision-code | |
static bool intersectRaySegmentSphere(float3 o, float3 d, float3 so, float radius2, float3 &ip) | |
{ | |
//we pass in d non-normalized to keep it's length | |
//then we use that length later to compare the intersection point to make sure | |
//we're within the actual ray segment | |
float l = d.length(); | |
d /= l; |
This file contains hidden or 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 "pch.h" | |
#include "Timer.h" | |
#include "System.h" | |
using namespace std; | |
namespace vui | |
{ | |
Timer::Timer(int milliseconds, bool repeating, std::function<void()> callback) | |
{ |
This file contains hidden or 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
struct VulkanAsyncResourceHandle | |
{ | |
union | |
{ | |
VkFence fence; | |
VkBuffer buffer; | |
VkImage image; | |
VkSampler sampler; | |
VkCommandBuffer commandBuffer; | |
}; |
This file contains hidden or 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
// | |
// Pass-through post-processing shader template | |
// Verto Studio 3D | |
// Created by Mike Farrell | |
// | |
// Please read the shader section of the user-guide | |
// for more information on shader programming | |
// within Verto Studio | |
precision mediump float; |
This file contains hidden or 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
/* MONOPOFUCK YO MAMMA A game written by Mike Farrel for Fun * | |
* To Change names, and starting money, edit the initial settings * | |
* of the player and property structs. Just make sure to keep * | |
* a backup of the original source code * | |
*/ | |
/* Comment made on 2/19/2002: This code is really fucking bad! * | |
* I'm going to try to salvage what I can and renovate what doesn't * | |
* work properly */ |
This file contains hidden or 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 <cassert> | |
#include <algorithm> | |
#include "VulkanMemoryManager.h" | |
using namespace std; | |
namespace vgl | |
{ | |
namespace core | |
{ |
This file contains hidden or 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
struct membuf : std::streambuf | |
{ | |
membuf(char *begin, char *end) : begin(begin), end(end) | |
{ | |
this->setg(begin, begin, end); | |
} | |
virtual pos_type seekoff(off_type off, std::ios_base::seekdir dir, std::ios_base::openmode which = std::ios_base::in) override | |
{ | |
if(dir == std::ios_base::cur) |
NewerOlder