Skip to content

Instantly share code, notes, and snippets.

View victusfate's full-sized avatar
🚀

Mark Essel victusfate

🚀
View GitHub Profile
#include "testApp.h"
//--------------------------------------------------------------
void testApp::setup(){
ofEnableNormalizedTexCoords();
ofDisableArbTex();
ofSetFrameRate(60);
ofBackground(22,33,44);
// Shader + VAO/VBO
#include <GLUT/GLUT.h>
int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DEPTH | GLUT_SINGLE | GLUT_RGBA);
glutInitWindowPosition(100,100);
glutInitWindowSize(320,320);
glutCreateWindow("3D Tech- GLUT Tutorial");
return 0;
/*
Original: 1562391 by branan
Updated to use GLFW so it works on Mac OS X Lion
*/
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#define GLFW_NO_GLU
#define GLFW_INCLUDE_GL3
@victusfate
victusfate / main.cc
Last active August 29, 2015 13:56
opengl glfw opengl 3.2 with forward compatibility
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <vector>
using namespace std;
@victusfate
victusfate / 0_reuse_code.js
Created March 7, 2014 16:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#include <cmath>
#include <assert.h>
#include <core/TestPattern.h>
TestPattern::TestPattern()
:w(0)
,h(0)
,frame_num(0)
,duration(0)
#!/bin/bash
set -o errexit
# Author: David Underhill
# Script to permanently delete files/folders from your git repository. To use
# it, cd to your repository's root and then run the script with a list of paths
# you want to delete, e.g., git-delete-history path1 path2
#
# retrieved from: http://dound.com/2009/04/git-forever-remove-files-or-folders-from-history/
#
#include <GL/glew.h>
#include <GL/glut.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
void init();
void display();
#include <stdlib.h>
#include <stdio.h>
#include <GL/glew.h>
#include <GL/glfw.h>
static void pushModelview()
{
GLenum prev_matrix_mode;
glGetIntegerv(GL_MATRIX_MODE, &prev_matrix_mode);
glMatrixMode(GL_MODELVIEW);
@victusfate
victusfate / glEasy.c
Created March 14, 2014 21:04
opengl 4.3 for one stop shader shopping, from http://stackoverflow.com/a/17064557/51700
/* EDIT: With OpenGL 4.3 and its compute shaders there is now a more direct way for such
rather non-rasterization pure GPGPU tasks like image processing.
You can just invoke a compute shader (which is more similar to other GPU computing frameworks, like CUDA or OpenCL, than the other OpenGL shaders) on a regular 2D domain and process a texture (using OpenGL 4.2's image load/store functionality) directly in-place. In this case all you need is the corresponding compute shader:
*/
#version 430
layout(local_size_x=32,local_size_y=8) in; //or whatever fits hardware and shader
layout(binding = 0, rgba) uniform image2D img; //adjust format to the actual data