Skip to content

Commit 52fb35b

Browse files
committed
examples
1 parent d0da5a2 commit 52fb35b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+2825
-0
lines changed

example-billboard/Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Attempt to load a config.make file.
2+
# If none is found, project defaults in config.project.make will be used.
3+
ifneq ($(wildcard config.make),)
4+
include config.make
5+
endif
6+
7+
# make sure the the OF_ROOT location is defined
8+
ifndef OF_ROOT
9+
OF_ROOT=$(realpath ../../..)
10+
endif
11+
12+
# call the project makefile!
13+
include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk

example-billboard/addons.make

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ofxRPI4Window
2+
ofxAssimpModelLoader
3+

example-billboard/bin/data/.gitkeep

Whitespace-only changes.

example-billboard/bin/data/dot.png

4.79 KB
Loading
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
uniform sampler2D tex;
2+
3+
void main (void) {
4+
gl_FragColor = texture2D(tex, gl_TexCoord[0].st) * gl_Color;
5+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
void main() {
3+
gl_TexCoord[0] = gl_MultiTexCoord0;
4+
vec4 eyeCoord = gl_ModelViewMatrix * gl_Vertex;
5+
gl_Position = gl_ProjectionMatrix * eyeCoord;
6+
float dist = sqrt(eyeCoord.x*eyeCoord.x + eyeCoord.y*eyeCoord.y + eyeCoord.z*eyeCoord.z);
7+
float att = 600.0 / dist;
8+
9+
gl_PointSize = gl_Normal.x * att;
10+
gl_FrontColor = gl_Color;
11+
}
12+
13+
14+
15+
16+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#version 300 es
2+
precision mediump float;
3+
4+
uniform sampler2D tex;
5+
6+
in vec4 colorVarying;
7+
8+
out vec4 fragColor;
9+
10+
void main (void) {
11+
fragColor = texture(tex, gl_PointCoord) * colorVarying;
12+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#version 300 es
2+
precision mediump float;
3+
4+
uniform mat4 orientationMatrix;
5+
uniform mat4 projectionMatrix;
6+
uniform mat4 modelViewMatrix;
7+
uniform mat4 textureMatrix;
8+
uniform mat4 modelViewProjectionMatrix;
9+
10+
in vec4 position;
11+
in vec4 color;
12+
in vec3 normal;
13+
14+
out vec4 colorVarying;
15+
16+
void main() {
17+
vec4 eyeCoord = modelViewMatrix * position;
18+
gl_Position = projectionMatrix * eyeCoord; // to be accurate this should premultiply by orientationMatrix
19+
20+
float dist = sqrt(eyeCoord.x*eyeCoord.x + eyeCoord.y*eyeCoord.y + eyeCoord.z*eyeCoord.z);
21+
float att = 600.0 / dist;
22+
23+
gl_PointSize = normal.x * att;
24+
colorVarying = color;
25+
}
26+
27+
28+
29+
30+

example-billboard/config.make

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
################################################################################
2+
# CONFIGURE PROJECT MAKEFILE (optional)
3+
# This file is where we make project specific configurations.
4+
################################################################################
5+
6+
################################################################################
7+
# OF ROOT
8+
# The location of your root openFrameworks installation
9+
# (default) OF_ROOT = ../../..
10+
################################################################################
11+
# OF_ROOT = ../../..
12+
13+
################################################################################
14+
# PROJECT ROOT
15+
# The location of the project - a starting place for searching for files
16+
# (default) PROJECT_ROOT = . (this directory)
17+
#
18+
################################################################################
19+
# PROJECT_ROOT = .
20+
21+
################################################################################
22+
# PROJECT SPECIFIC CHECKS
23+
# This is a project defined section to create internal makefile flags to
24+
# conditionally enable or disable the addition of various features within
25+
# this makefile. For instance, if you want to make changes based on whether
26+
# GTK is installed, one might test that here and create a variable to check.
27+
################################################################################
28+
# None
29+
30+
################################################################################
31+
# PROJECT EXTERNAL SOURCE PATHS
32+
# These are fully qualified paths that are not within the PROJECT_ROOT folder.
33+
# Like source folders in the PROJECT_ROOT, these paths are subject to
34+
# exlclusion via the PROJECT_EXLCUSIONS list.
35+
#
36+
# (default) PROJECT_EXTERNAL_SOURCE_PATHS = (blank)
37+
#
38+
# Note: Leave a leading space when adding list items with the += operator
39+
################################################################################
40+
# PROJECT_EXTERNAL_SOURCE_PATHS =
41+
42+
################################################################################
43+
# PROJECT EXCLUSIONS
44+
# These makefiles assume that all folders in your current project directory
45+
# and any listed in the PROJECT_EXTERNAL_SOURCH_PATHS are are valid locations
46+
# to look for source code. The any folders or files that match any of the
47+
# items in the PROJECT_EXCLUSIONS list below will be ignored.
48+
#
49+
# Each item in the PROJECT_EXCLUSIONS list will be treated as a complete
50+
# string unless teh user adds a wildcard (%) operator to match subdirectories.
51+
# GNU make only allows one wildcard for matching. The second wildcard (%) is
52+
# treated literally.
53+
#
54+
# (default) PROJECT_EXCLUSIONS = (blank)
55+
#
56+
# Will automatically exclude the following:
57+
#
58+
# $(PROJECT_ROOT)/bin%
59+
# $(PROJECT_ROOT)/obj%
60+
# $(PROJECT_ROOT)/%.xcodeproj
61+
#
62+
# Note: Leave a leading space when adding list items with the += operator
63+
################################################################################
64+
# PROJECT_EXCLUSIONS =
65+
66+
################################################################################
67+
# PROJECT LINKER FLAGS
68+
# These flags will be sent to the linker when compiling the executable.
69+
#
70+
# (default) PROJECT_LDFLAGS = -Wl,-rpath=./libs
71+
#
72+
# Note: Leave a leading space when adding list items with the += operator
73+
#
74+
# Currently, shared libraries that are needed are copied to the
75+
# $(PROJECT_ROOT)/bin/libs directory. The following LDFLAGS tell the linker to
76+
# add a runtime path to search for those shared libraries, since they aren't
77+
# incorporated directly into the final executable application binary.
78+
################################################################################
79+
#PROJECT_LDFLAGS=-lEGL_mesa
80+
81+
################################################################################
82+
# PROJECT DEFINES
83+
# Create a space-delimited list of DEFINES. The list will be converted into
84+
# CFLAGS with the "-D" flag later in the makefile.
85+
#
86+
# (default) PROJECT_DEFINES = (blank)
87+
#
88+
# Note: Leave a leading space when adding list items with the += operator
89+
################################################################################
90+
#PROJECT_DEFINES =
91+
92+
93+
################################################################################
94+
# PROJECT CFLAGS
95+
# This is a list of fully qualified CFLAGS required when compiling for this
96+
# project. These CFLAGS will be used IN ADDITION TO the PLATFORM_CFLAGS
97+
# defined in your platform specific core configuration files. These flags are
98+
# presented to the compiler BEFORE the PROJECT_OPTIMIZATION_CFLAGS below.
99+
#
100+
# (default) PROJECT_CFLAGS = (blank)
101+
#
102+
# Note: Before adding PROJECT_CFLAGS, note that the PLATFORM_CFLAGS defined in
103+
# your platform specific configuration file will be applied by default and
104+
# further flags here may not be needed.
105+
#
106+
# Note: Leave a leading space when adding list items with the += operator
107+
################################################################################
108+
# PROJECT_CFLAGS =
109+
110+
################################################################################
111+
# PROJECT OPTIMIZATION CFLAGS
112+
# These are lists of CFLAGS that are target-specific. While any flags could
113+
# be conditionally added, they are usually limited to optimization flags.
114+
# These flags are added BEFORE the PROJECT_CFLAGS.
115+
#
116+
# PROJECT_OPTIMIZATION_CFLAGS_RELEASE flags are only applied to RELEASE targets.
117+
#
118+
# (default) PROJECT_OPTIMIZATION_CFLAGS_RELEASE = (blank)
119+
#
120+
# PROJECT_OPTIMIZATION_CFLAGS_DEBUG flags are only applied to DEBUG targets.
121+
#
122+
# (default) PROJECT_OPTIMIZATION_CFLAGS_DEBUG = (blank)
123+
#
124+
# Note: Before adding PROJECT_OPTIMIZATION_CFLAGS, please note that the
125+
# PLATFORM_OPTIMIZATION_CFLAGS defined in your platform specific configuration
126+
# file will be applied by default and further optimization flags here may not
127+
# be needed.
128+
#
129+
# Note: Leave a leading space when adding list items with the += operator
130+
################################################################################
131+
# PROJECT_OPTIMIZATION_CFLAGS_RELEASE =
132+
# PROJECT_OPTIMIZATION_CFLAGS_DEBUG =
133+
134+
################################################################################
135+
# PROJECT COMPILERS
136+
# Custom compilers can be set for CC and CXX
137+
# (default) PROJECT_CXX = (blank)
138+
# (default) PROJECT_CC = (blank)
139+
# Note: Leave a leading space when adding list items with the += operator
140+
################################################################################
141+
# PROJECT_CXX =
142+
# PROJECT_CC =

example-billboard/src/main.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include "ofMain.h"
2+
#include "ofApp.h"
3+
#include "ofxRPI4Window.h"
4+
5+
//========================================================================
6+
int main( ){
7+
8+
ofSetLogLevel(OF_LOG_VERBOSE);
9+
10+
ofGLESWindowSettings settings;
11+
settings.setSize(1280, 720);
12+
settings.setGLESVersion(2);
13+
auto window = std::make_shared<ofxRPI4Window>(settings);
14+
15+
auto app = std::make_shared<ofApp>();
16+
ofRunApp(window, app);
17+
ofRunMainLoop();
18+
}

0 commit comments

Comments
 (0)