Skip to content

Instantly share code, notes, and snippets.

#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <iostream>
//-----------------------------SHADERS--------------------------------------------------------------------
static unsigned int CompileShader(unsigned int type, const std::string& source)
{
unsigned int id = glCreateShader(type);
const char* src = source.c_str();
glShaderSource(id, 1, &src, nullptr);
glCompileShader(id);
//
// Copyright 2014-2015 Amazon.com,
// Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the AWS Mobile SDK For Unity
// Sample Application License Agreement (the "License").
// You may not use this file except in compliance with the
// License. A copy of the License is located
// in the "license" file accompanying this file. This file is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
@sebas86
sebas86 / sterownik.c
Last active August 29, 2015 14:07
Kod źródłowy programu sterownika sieciowego do artykułu „Sterownik domowy z interfejsem Ethernet” http://majsterkowo.pl/sterownik-domowy-z-interfejsem-ethernet/. Nie jestem autorem niniejszego programu, kod został wrzucony i przeformatowany z grzeczności – z powodu zepsutego formatowania źródeł zamieszczonych na stronie podlinkowanego wcześniej …
#include <avr/io.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <avr/pgmspace.h>
#include "ip_arp_udp_tcp.h"
#include "enc28j60.h"
#include "timeout.h"
#include "net.h"
#include "websrv_help_functions.h"
@sebas86
sebas86 / gist:8b9e10e76fd9aa2ace24
Last active August 29, 2015 14:05
Grayscale for OpenGL fixed-function pipline
#define intense 0.5f
#define blend 7.0f/12.0f
GLfloat weights_vector[4] = {intense, intense, intense, 0.0f};
GLfloat additions_vector[4] = {blend, blend, blend, 1.0f};
glEnable(GL_BLEND);
glActiveTexture(GL_TEXTURE0);
glEnable(GL_TEXTURE_2D);