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
//set the image size | |
int imageWidth = 960; | |
int imageHeight = 540; // change these to any integers | |
//instanciate a gradient variable | |
ofImage gradient = ofImage(); | |
gradient.allocate(960,540,OF_IMAGE_COLOR); | |
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 "ofMain.h" | |
#include "testApp.h" | |
#include "ofAppGlutWindow.h" | |
//======================================================================== | |
int main( ){ | |
ofAppGlutWindow window; | |
ofSetupOpenGL(&window, 960, 540, OF_WINDOW); // <-------- setup the GL context |
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
#pragma once | |
#include "ofMain.h" | |
class testApp : public ofBaseApp{ | |
public: | |
void setup(); | |
void update(); | |
void draw(); |
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 "testApp.h" | |
//-------------------------------------------------------------- | |
void testApp::setup(){ | |
ofSetLogLevel(OF_LOG_VERBOSE); | |
ofBackground(34, 34, 34); | |
ofSetVerticalSync(false); | |
ofEnableAlphaBlending(); | |
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 120 | |
void main(){ | |
//this is the fragment shader | |
//this is where the pixel level drawing happens | |
//gl_FragCoord gives us the x and y of the current pixel its drawing | |
gl_FragColor.r = gl_Color.r + 20; | |
gl_FragColor.g = gl_Color.g + 20; |
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 testApp::draw() | |
{ | |
if(doShader) | |
shader.begin(); | |
gradient.draw(0,0,960,540); | |
if(doShader) | |
shader.end(); |
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 120 | |
void main() { | |
vec4 color; | |
float xCor = gl_FragCoord.x; | |
vec4 white = vec4(1); | |
vec4 black = vec4(0); | |
float x = smoothstep(0, 960.0, xCor); |
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 "ofApp.h" | |
//-------------------------------------------------------------- | |
void ofApp::setup(){ | |
ofSetLogLevel(OF_LOG_VERBOSE); | |
ofBackground(34, 34, 34); | |
ofSetVerticalSync(false); | |
ofEnableAlphaBlending(); |
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 _TEST_APP | |
#define _TEST_APP | |
#include "ofMain.h" | |
#include "ofxAndroid.h" | |
class ofApp : public ofxAndroidApp{ | |
public: |
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 "ofMain.h" | |
#include "ofApp.h" | |
// comment out the line below if you want to use a fixed pipeline opengl renderer, | |
// otherwise leave this line uncommented if you want to use a programmable pipeline opengl renderer. | |
#define USE_PROGRAMMABLE_RENDERER | |
#ifdef USE_PROGRAMMABLE_RENDERER | |
#include "ofGLProgrammableRenderer.h" | |
#endif |
OlderNewer