Skip to content

Instantly share code, notes, and snippets.

@prisonerjohn
Last active August 27, 2019 19:07
Show Gist options
  • Save prisonerjohn/04e3715543fff7e0d2e15bf19ebe4f40 to your computer and use it in GitHub Desktop.
Save prisonerjohn/04e3715543fff7e0d2e15bf19ebe4f40 to your computer and use it in GitHub Desktop.
Empty OF app.
#include "ofMain.h"
#include "ofApp.h"
int main()
{
ofSetupOpenGL(1920, 1080, OF_WINDOW);
ofRunApp(new ofApp());
}
#include "ofApp.h"
void ofApp::setup()
{
// Called once at app startup.
}
void ofApp::update()
{
// Called at the start of every frame.
}
void ofApp::draw()
{
// Called every frame after update.
}
void ofApp::keyPressed(int key)
{
// Called when a key is pressed.
}
void ofApp::keyReleased(int key)
{
// Called when a key is released.
}
void ofApp::mouseMoved(int x, int y)
{
// Called when the mouse is moved and no buttons are pressed.
}
void ofApp::mouseDragged(int x, int y, int button)
{
// Called when the mouse is moved while a button is pressed down.
}
void ofApp::mousePressed(int x, int y, int button)
{
// Called when a mouse button is pressed.
}
void ofApp::mouseReleased(int x, int y, int button)
{
// Called when a mouse button is released.
}
void ofApp::mouseEntered(int x, int y)
{
// Called when the mouse cursor enters the application window.
}
void ofApp::mouseExited(int x, int y)
{
// Called when the mouse cursor exits the application window.
}
void ofApp::windowResized(int w, int h)
{
// Called when the application window is resized.
}
void ofApp::gotMessage(ofMessage msg)
{
// I have no idea :/
}
void ofApp::dragEvent(ofDragInfo dragInfo)
{
// Called when a file or set of files are dragged onto the application window.
}
#pragma once
#include "ofMain.h"
class ofApp : public ofBaseApp
{
public:
void setup();
void update();
void draw();
void keyPressed(int key);
void keyReleased(int key);
void mouseMoved(int x, int y);
void mouseDragged(int x, int y, int button);
void mousePressed(int x, int y, int button);
void mouseReleased(int x, int y, int button);
void mouseEntered(int x, int y);
void mouseExited(int x, int y);
void windowResized(int w, int h);
void dragEvent(ofDragInfo dragInfo);
void gotMessage(ofMessage msg);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment