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
//server.cpp | |
#include <iostream> | |
#include <unistd.h> | |
#include <sys/socket.h> | |
#include <stdlib.h> | |
#include <netinet/in.h> | |
#include <string.h> | |
#define PORT 8080 |
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 410 core | |
in vec2 TexCoord; | |
uniform sampler2D screenTexture; | |
out vec4 FragColor; | |
const float offset = 1.0 / 300.0; | |
vec3 setContrast(vec3 value, float contrast) | |
{ | |
return (value - 0.5) * contrast + 0.5; |
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
#ifndef LINEUTIL_H | |
#define LINEUTIL_H | |
#include "common.h" | |
/* | |
** Draws horizontal line | |
** hexRgb = e.g. 0xFF0000 | |
*/ | |
void drawHLine(int x1, int x2, int y, GLubyte *data, unsigned long hexRgb, int width, int height) |
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
void mainImage( out vec4 fragColor, in vec2 fragCoord ) | |
{ | |
vec3 col1 = vec3(0.5, 0.5, 0.5); | |
vec3 col2 = vec3(0.0, 1.0, 1.0); | |
vec3 col = col1; | |
if (fragCoord.x > iMouse.x - 30.0 && | |
fragCoord.x < iMouse.x + 30.0 && | |
fragCoord.y > iMouse.y - 30.0 && |
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
void mainImage( out vec4 fragColor, in vec2 fragCoord ) | |
{ | |
vec3 col = vec3(0.5, 0.5, 0.5); | |
float radius = 50.0; | |
float dist_squared = dot(iMouse.xy - fragCoord.xy, iMouse.xy - fragCoord.xy); | |
if (dist_squared < (radius * radius)) { | |
col += vec3(0.0, 1.0, 1.0); | |
} | |
fragColor = vec4(col,1.0); | |
} |
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
// simple vertex shader | |
varying vec2 texCoord; | |
uniform float time; | |
void main() | |
{ | |
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; | |
gl_FrontColor = gl_Color; | |
gl_TexCoord[0] = gl_MultiTexCoord0; |
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 <SFML/Window.hpp> | |
#include <OpenGL/gl3.h> | |
#include <iostream> | |
#include <fstream> | |
using namespace std; | |
// Read a shader source from a file | |
// store the shader source in a std::vector<char> | |
void read_shader_src(const char *fname, std::vector<char> &buffer) { |
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
Shader "squidzoo/Outline" | |
{ | |
Properties | |
{ | |
_MainTex ("Texture", 2D) = "white" {} | |
_OutlineColor("Outline color", Color) = (0,0,0,1) | |
_OutlineWidth("Outline width", Range(1.0,5.0)) = 1.05 | |
} | |
CGINCLUDE |
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
public class CardController : MonoBehaviour { | |
public Sprite frontSprite; | |
public Sprite backSprite; | |
public float uncoverTime = 12.0f; | |
// Use this for initialization | |
void Start () { | |
GameObject card = new GameObject("Card"); // parent object | |
GameObject cardFront = new GameObject("CardFront"); |
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
// Author @patriciogv - 2015 | |
// http://patriciogonzalezvivo.com | |
#ifdef GL_ES | |
precision mediump float; | |
#endif | |
uniform vec2 u_resolution; | |
uniform vec2 u_mouse; | |
uniform float u_time; |
NewerOlder