float rand(float n){return fract(sin(n) * 43758.5453123);}
float noise(float p){
float fl = floor(p);
float fc = fract(p);
return mix(rand(fl), rand(fl + 1.0), fc);
}
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 <SFML/Graphics.hpp> | |
#include <iostream> | |
#include <memory> | |
#include <map> | |
#include <string> | |
#include <vector> | |
#include <array> | |
#include <random> | |
#include <stdexcept> | |
#include <cassert> |
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 <iostream> | |
#include <iomanip> | |
#include <algorithm> | |
#include <limits> | |
class Game | |
{ | |
enum class Player | |
{ | |
none = '-', |
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 <SFML/Window.hpp> | |
#include <iostream> | |
#include <random> | |
#include <array> | |
#include <gl/glut.h> | |
enum { MINE = 9 }; | |
enum { TILE_SIZE = 20 }; | |
enum { MARGIN = 40 }; |
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 <SDL2/SDL.h> | |
#include <GL/glew.h> | |
#include <string> | |
#include "Camera.hpp" | |
static void update_fps_counter(SDL_Window* window, const std::string& title) { | |
static std::string text_bar; | |
static Uint32 fps_lasttime = SDL_GetTicks(); | |
static Uint32 fps_current; | |
static Uint32 fps_frames; |
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 <iostream> | |
#include <memory> | |
#include <vector> | |
#include <algorithm> | |
#include <type_traits> | |
template< class ... > using void_t = void; | |
template< class T , class = void > | |
struct is_dereferenceable : std::false_type |
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 <GL/glew.h> | |
#include <SFML/Window.hpp> | |
// Shader macro | |
#define GLSL(src) "#version 150 core\n" #src | |
// Vertex shader | |
const GLchar* vertexShaderSrc = GLSL( | |
in float inValue; | |
out float outValue; |
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 <SFML/Graphics.hpp> | |
#include <GL/glew.h> | |
#include <iostream> | |
#include <cassert> | |
#include <stdexcept> | |
#include <cmath> | |
#define GLM_SWIZZLE | |
#include <glm/glm.hpp> | |
#include <glm/gtx/transform2.hpp> | |
#include <glm/gtc/type_ptr.hpp> |
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 <SFML/Window.hpp> | |
#include <GL/glew.h> | |
#include <iostream> | |
#include <cassert> | |
#include <iostream> | |
#include <stdexcept> | |
#include <cmath> | |
void application() | |
{ |
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 <SFML/Graphics.hpp> | |
#include <iostream> | |
#include <iomanip> | |
#include <array> | |
#include <vector> | |
#include <utility> | |
#include <queue> | |
#include <tuple> | |
#include <set> | |
#include <algorithm> |