├── .clang-format
├── .gitignore
├── Add.vcxproj
├── Add.vcxproj.filters
├── Add.vcxproj.user
├── AddSubtract.vcxproj
├── AddSubtract.vcxproj.filters
├── AddSubtract.vcxproj.user
├── Alea.vcxproj
├── Alea.vcxproj.filters
├── Alea.vcxproj.user
├── BGR.vcxproj
├── BGR.vcxproj.user
├── BarrelBlur.vcxproj
├── BarrelBlur.vcxproj.filters
├── BarrelBlur.vcxproj.user
├── Bloom.vcxproj
├── Bloom.vcxproj.user
├── CreationSilexars.vcxproj
├── CreationSilexars.vcxproj.filters
├── CreationSilexars.vcxproj.user
├── Dissolve.vcxproj
├── Dissolve.vcxproj.filters
├── Dissolve.vcxproj.user
├── FFGL Plugin.aps
├── FFGL Plugin.sln
├── FFGLPlugins.def
├── MovingGradient.vcxproj
├── MovingGradient.vcxproj.filters
├── MovingGradient.vcxproj.user
├── Polygon.vcxproj
├── Polygon.vcxproj.filters
├── Polygon.vcxproj.user
├── README.md
├── Scanline.vcxproj
├── Scanline.vcxproj.filters
├── Scanline.vcxproj.user
├── Screenshake.vcxproj
├── Screenshake.vcxproj.filters
├── Screenshake.vcxproj.user
├── Strobotime.vcxproj
├── Strobotime.vcxproj.filters
├── Strobotime.vcxproj.user
├── Triskel.vcxproj
├── Triskel.vcxproj.filters
├── Triskel.vcxproj.user
├── lib
├── FFGLSDK.cpp
├── FFGLSDK.h
├── ffgl
│ ├── FFGL.cpp
│ ├── FFGL.h
│ ├── FFGLLib.h
│ ├── FFGLPluginInfo.cpp
│ ├── FFGLPluginInfo.h
│ ├── FFGLPluginInfoData.cpp
│ ├── FFGLPluginManager.cpp
│ ├── FFGLPluginManager.h
│ ├── FFGLPluginSDK.cpp
│ └── FFGLPluginSDK.h
├── ffglex
│ ├── FFGLFBO.cpp
│ ├── FFGLFBO.h
│ ├── FFGLScopedBufferBinding.cpp
│ ├── FFGLScopedBufferBinding.h
│ ├── FFGLScopedSamplerActivation.cpp
│ ├── FFGLScopedSamplerActivation.h
│ ├── FFGLScopedShaderBinding.cpp
│ ├── FFGLScopedShaderBinding.h
│ ├── FFGLScopedTextureBinding.cpp
│ ├── FFGLScopedTextureBinding.h
│ ├── FFGLScopedVAOBinding.cpp
│ ├── FFGLScopedVAOBinding.h
│ ├── FFGLScreenQuad.cpp
│ ├── FFGLScreenQuad.h
│ ├── FFGLShader.cpp
│ ├── FFGLShader.h
│ ├── FFGLUtilities.cpp
│ └── FFGLUtilities.h
└── glsdk_0_5_2
│ └── glload
│ ├── glload.doxy
│ ├── glload.lua
│ ├── include
│ ├── _int_gl_1_0.h
│ ├── _int_gl_1_0.hpp
│ ├── _int_gl_1_0_rem.h
│ ├── _int_gl_1_0_rem.hpp
│ ├── _int_gl_1_1.h
│ ├── _int_gl_1_1.hpp
│ ├── _int_gl_1_1_rem.h
│ ├── _int_gl_1_1_rem.hpp
│ ├── _int_gl_1_2.h
│ ├── _int_gl_1_2.hpp
│ ├── _int_gl_1_2_rem.h
│ ├── _int_gl_1_2_rem.hpp
│ ├── _int_gl_1_3.h
│ ├── _int_gl_1_3.hpp
│ ├── _int_gl_1_3_rem.h
│ ├── _int_gl_1_3_rem.hpp
│ ├── _int_gl_1_4.h
│ ├── _int_gl_1_4.hpp
│ ├── _int_gl_1_4_rem.h
│ ├── _int_gl_1_4_rem.hpp
│ ├── _int_gl_1_5.h
│ ├── _int_gl_1_5.hpp
│ ├── _int_gl_1_5_rem.h
│ ├── _int_gl_1_5_rem.hpp
│ ├── _int_gl_2_0.h
│ ├── _int_gl_2_0.hpp
│ ├── _int_gl_2_0_rem.h
│ ├── _int_gl_2_0_rem.hpp
│ ├── _int_gl_2_1.h
│ ├── _int_gl_2_1.hpp
│ ├── _int_gl_2_1_rem.h
│ ├── _int_gl_2_1_rem.hpp
│ ├── _int_gl_3_0.h
│ ├── _int_gl_3_0.hpp
│ ├── _int_gl_3_0_rem.h
│ ├── _int_gl_3_0_rem.hpp
│ ├── _int_gl_3_1.h
│ ├── _int_gl_3_1.hpp
│ ├── _int_gl_3_2.h
│ ├── _int_gl_3_2.hpp
│ ├── _int_gl_3_3.h
│ ├── _int_gl_3_3.hpp
│ ├── _int_gl_4_0.h
│ ├── _int_gl_4_0.hpp
│ ├── _int_gl_4_3.h
│ ├── _int_gl_4_3.hpp
│ ├── _int_gl_4_4.h
│ ├── _int_gl_4_4.hpp
│ ├── _int_gl_exts.h
│ ├── _int_gl_exts.hpp
│ ├── _int_gl_type.h
│ ├── _int_gl_type.hpp
│ ├── _int_glx_exts.h
│ ├── _int_glx_exts.hpp
│ ├── _int_glx_type.h
│ ├── _int_glx_type.hpp
│ ├── _int_load_test.hpp
│ ├── _int_wgl_exts.h
│ ├── _int_wgl_exts.hpp
│ ├── _int_wgl_type.h
│ ├── _int_wgl_type.hpp
│ ├── gl_1_0.h
│ ├── gl_1_0.hpp
│ ├── gl_1_1.h
│ ├── gl_1_1.hpp
│ ├── gl_1_2.h
│ ├── gl_1_2.hpp
│ ├── gl_1_3.h
│ ├── gl_1_3.hpp
│ ├── gl_1_4.h
│ ├── gl_1_4.hpp
│ ├── gl_1_5.h
│ ├── gl_1_5.hpp
│ ├── gl_2_0.h
│ ├── gl_2_0.hpp
│ ├── gl_2_1.h
│ ├── gl_2_1.hpp
│ ├── gl_3_0.h
│ ├── gl_3_0.hpp
│ ├── gl_3_1.h
│ ├── gl_3_1.hpp
│ ├── gl_3_1_comp.h
│ ├── gl_3_1_comp.hpp
│ ├── gl_3_2.h
│ ├── gl_3_2.hpp
│ ├── gl_3_2_comp.h
│ ├── gl_3_2_comp.hpp
│ ├── gl_3_3.h
│ ├── gl_3_3.hpp
│ ├── gl_3_3_comp.h
│ ├── gl_3_3_comp.hpp
│ ├── gl_4_0.h
│ ├── gl_4_0.hpp
│ ├── gl_4_0_comp.h
│ ├── gl_4_0_comp.hpp
│ ├── gl_4_1.h
│ ├── gl_4_1.hpp
│ ├── gl_4_1_comp.h
│ ├── gl_4_1_comp.hpp
│ ├── gl_4_2.h
│ ├── gl_4_2.hpp
│ ├── gl_4_2_comp.h
│ ├── gl_4_2_comp.hpp
│ ├── gl_4_3.h
│ ├── gl_4_3.hpp
│ ├── gl_4_3_comp.h
│ ├── gl_4_3_comp.hpp
│ ├── gl_4_4.h
│ ├── gl_4_4.hpp
│ ├── gl_4_4_comp.h
│ ├── gl_4_4_comp.hpp
│ ├── gl_all.h
│ ├── gl_all.hpp
│ ├── gl_core.h
│ ├── gl_core.hpp
│ ├── gl_load.h
│ ├── gl_load.hpp
│ ├── glx_all.h
│ ├── glx_all.hpp
│ ├── glx_load.h
│ ├── glx_load.hpp
│ ├── wgl_all.h
│ ├── wgl_all.hpp
│ ├── wgl_load.h
│ └── wgl_load.hpp
│ └── source
│ ├── gl_load.c
│ ├── gl_load_cpp.cpp
│ ├── glx_load.c
│ ├── glx_load_cpp.cpp
│ ├── wgl_load.c
│ └── wgl_load_cpp.cpp
└── src
├── api
├── Effect.cpp
├── Effect.h
├── Mixer.cpp
├── Mixer.h
├── Params.h
├── Plugin.cpp
├── Plugin.h
├── Source.cpp
└── Source.h
├── examples
├── Add.cpp
├── Add.h
├── AddSubtract.cpp
├── AddSubtract.h
├── Alea.cpp
├── Alea.h
├── BGR.cpp
├── BGR.h
├── BarrelBlur.cpp
├── BarrelBlur.h
├── Bloom.cpp
├── Bloom.h
├── CreationSilexars.cpp
├── CreationSilexars.h
├── Dissolve.cpp
├── Dissolve.h
├── MovingGradient.cpp
├── MovingGradient.h
├── Polygon.cpp
├── Polygon.h
├── Scanline.cpp
├── Scanline.h
├── Screenshake.cpp
├── Screenshake.h
├── Strobotime.cpp
├── Strobotime.h
├── Triskel.cpp
└── Triskel.h
└── helpers
├── Audio.cpp
├── Audio.h
└── Utils.h
/.clang-format:
--------------------------------------------------------------------------------
1 | ---
2 | Language: Cpp
3 | AccessModifierOffset : -4
4 | AlignAfterOpenBracket: Align
5 | AlignConsecutiveAssignments : true
6 | AlignConsecutiveDeclarations : false
7 | AlignEscapedNewlines : Right
8 | AlignOperands : true
9 | AlignTrailingComments : true
10 | AllowAllParametersOfDeclarationOnNextLine : false
11 | AllowShortBlocksOnASingleLine : false
12 | AllowShortCaseLabelsOnASingleLine : false
13 | AllowShortFunctionsOnASingleLine : None
14 | AllowShortIfStatementsOnASingleLine : false
15 | AllowShortLoopsOnASingleLine : false
16 | # AlwaysBreakAfterDefinitionReturnType : None
17 | AlwaysBreakAfterReturnType : None
18 | AlwaysBreakBeforeMultilineStrings : false
19 | AlwaysBreakTemplateDeclarations : true
20 | BinPackArguments : false
21 | BinPackParameters: false
22 | BraceWrapping :
23 | AfterClass : true
24 | AfterControlStatement : true
25 | AfterEnum : true
26 | AfterFunction : true
27 | AfterNamespace : true
28 | AfterObjCDeclaration : true
29 | AfterStruct : true
30 | AfterUnion : true
31 | #AfterExternBlock: false
32 | BeforeCatch : true
33 | BeforeElse : true
34 | IndentBraces : false
35 | SplitEmptyFunction : true
36 | SplitEmptyRecord : true
37 | SplitEmptyNamespace : true
38 | BreakAfterJavaFieldAnnotations : true
39 | BreakBeforeBinaryOperators : None
40 | BreakBeforeBraces: Custom
41 | BreakBeforeInheritanceComma : false
42 | BreakBeforeTernaryOperators : false
43 | BreakConstructorInitializers : AfterColon
44 | BreakStringLiterals : false
45 | ColumnLimit : 0
46 | CompactNamespaces : false
47 | ConstructorInitializerAllOnOneLineOrOnePerLine : true
48 | ConstructorInitializerIndentWidth : 4
49 | ContinuationIndentWidth : 4
50 | Cpp11BracedListStyle : false
51 | DerivePointerAlignment : false
52 | #DisableFormat : true
53 | FixNamespaceComments : true
54 | ForEachMacros:
55 | - foreach
56 | #IncludeBlocks : Preserve
57 | IndentCaseLabels : false
58 | #IndentPPDirectives : AfterHash
59 | IndentWidth : 4
60 | IndentWrappedFunctionNames : true
61 | JavaScriptQuotes : Leave
62 | JavaScriptWrapImports : false
63 | KeepEmptyLinesAtTheStartOfBlocks : false
64 | MaxEmptyLinesToKeep : 1
65 | NamespaceIndentation : None
66 | #ObjCBinPackProtocolList: Always
67 | ObjCBlockIndentWidth : 4
68 | ObjCSpaceAfterProperty : false
69 | ObjCSpaceBeforeProtocolList : false
70 | PenaltyBreakAssignment : 0
71 | PenaltyBreakBeforeFirstCallParameter : 0
72 | PenaltyBreakComment : 0
73 | PenaltyBreakFirstLessLess : 0
74 | PenaltyBreakString : 0
75 | PenaltyExcessCharacter : 0
76 | PenaltyReturnTypeOnItsOwnLine : 0
77 | PointerAlignment : Left
78 | ReflowComments : false
79 | SortIncludes : false
80 | SortUsingDeclarations : false
81 | SpaceAfterCStyleCast : false
82 | SpaceAfterTemplateKeyword : false
83 | SpaceBeforeAssignmentOperators : true
84 | #SpaceBeforeCtorInitializerColon : true
85 | SpaceBeforeParens : Never
86 | #SpaceBeforeRangeBasedForLoopColon : true
87 | SpaceInEmptyParentheses : false
88 | SpacesBeforeTrailingComments : 0
89 | SpacesInAngles : true
90 | SpacesInCStyleCastParentheses : false
91 | SpacesInContainerLiterals : true
92 | SpacesInParentheses : true
93 | SpacesInSquareBrackets : true
94 | Standard : Cpp11
95 | TabWidth : 4
96 | UseTab : ForContinuationAndIndentation
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | x64/
2 | binaries/
3 | .vs/
--------------------------------------------------------------------------------
/Add.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | api
7 |
8 |
9 | api
10 |
11 |
12 | api
13 |
14 |
15 | api
16 |
17 |
18 | api
19 |
20 |
21 | lib
22 |
23 |
24 | lib
25 |
26 |
27 |
28 |
29 |
30 | api
31 |
32 |
33 | api
34 |
35 |
36 | api
37 |
38 |
39 | api
40 |
41 |
42 | api
43 |
44 |
45 | api
46 |
47 |
48 |
49 |
50 | {75aa6755-6de5-41e7-b5f2-ba669bc3896e}
51 |
52 |
53 | {1667922b-a87c-4167-a6cb-f8d9df6a29e6}
54 |
55 |
56 |
--------------------------------------------------------------------------------
/Add.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/AddSubtract.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | api
7 |
8 |
9 | api
10 |
11 |
12 | api
13 |
14 |
15 | api
16 |
17 |
18 | api
19 |
20 |
21 | lib
22 |
23 |
24 | lib
25 |
26 |
27 |
28 |
29 |
30 | api
31 |
32 |
33 | api
34 |
35 |
36 | api
37 |
38 |
39 | api
40 |
41 |
42 | api
43 |
44 |
45 | api
46 |
47 |
48 |
49 |
50 | {cede20d0-14a2-40ed-b709-7c88ec1823c4}
51 |
52 |
53 | {02847dc9-a901-4b50-834a-36bf6c88630e}
54 |
55 |
56 |
--------------------------------------------------------------------------------
/AddSubtract.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Alea.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | api
7 |
8 |
9 | api
10 |
11 |
12 | api
13 |
14 |
15 | api
16 |
17 |
18 | api
19 |
20 |
21 | lib
22 |
23 |
24 | lib
25 |
26 |
27 |
28 |
29 |
30 | api
31 |
32 |
33 | api
34 |
35 |
36 | api
37 |
38 |
39 | api
40 |
41 |
42 | api
43 |
44 |
45 | api
46 |
47 |
48 | api
49 |
50 |
51 |
52 |
53 | {2545c4d3-ce10-443b-9631-c845564847bc}
54 |
55 |
56 | {cff59b82-4eed-47b1-a430-3cefed1ff5aa}
57 |
58 |
59 |
--------------------------------------------------------------------------------
/Alea.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/BGR.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/BarrelBlur.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | api
7 |
8 |
9 | api
10 |
11 |
12 | api
13 |
14 |
15 | api
16 |
17 |
18 | api
19 |
20 |
21 | lib
22 |
23 |
24 | lib
25 |
26 |
27 |
28 |
29 |
30 | api
31 |
32 |
33 | api
34 |
35 |
36 | api
37 |
38 |
39 | api
40 |
41 |
42 | api
43 |
44 |
45 | api
46 |
47 |
48 |
49 |
50 | {27b241f9-fa3c-4faf-9ed1-7bae099361cd}
51 |
52 |
53 | {09271159-cf81-462b-ab4e-5535ef08686c}
54 |
55 |
56 |
--------------------------------------------------------------------------------
/BarrelBlur.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Bloom.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/CreationSilexars.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | lib
6 |
7 |
8 | lib
9 |
10 |
11 | api
12 |
13 |
14 | api
15 |
16 |
17 | api
18 |
19 |
20 | api
21 |
22 |
23 | api
24 |
25 |
26 |
27 |
28 |
29 | api
30 |
31 |
32 | api
33 |
34 |
35 | api
36 |
37 |
38 | api
39 |
40 |
41 | api
42 |
43 |
44 | api
45 |
46 |
47 |
48 |
49 |
50 | {80cd77d1-9f6a-4fd1-960a-f106d29ec9f8}
51 |
52 |
53 | {f0e1390a-e871-4074-a31f-112bbbf31a96}
54 |
55 |
56 |
--------------------------------------------------------------------------------
/CreationSilexars.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Dissolve.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | lib
7 |
8 |
9 | lib
10 |
11 |
12 | api
13 |
14 |
15 | api
16 |
17 |
18 | api
19 |
20 |
21 | api
22 |
23 |
24 | api
25 |
26 |
27 |
28 |
29 |
30 | api
31 |
32 |
33 | api
34 |
35 |
36 | api
37 |
38 |
39 | api
40 |
41 |
42 | api
43 |
44 |
45 | api
46 |
47 |
48 |
49 |
50 | {cd553dc2-b051-463d-819e-1fb43ee4f0ef}
51 |
52 |
53 | {39d70b43-cac8-40b0-af20-a2d2722b0d0b}
54 |
55 |
56 |
--------------------------------------------------------------------------------
/Dissolve.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/FFGL Plugin.aps:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/flyingrub/FFGL-plugin-quickstart/e98650c0150382e0e1eac1ddeeb338ed6098957d/FFGL Plugin.aps
--------------------------------------------------------------------------------
/FFGLPlugins.def:
--------------------------------------------------------------------------------
1 |
2 | EXPORTS plugMain
3 |
--------------------------------------------------------------------------------
/MovingGradient.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | lib
6 |
7 |
8 | lib
9 |
10 |
11 |
12 | api
13 |
14 |
15 | api
16 |
17 |
18 | api
19 |
20 |
21 | api
22 |
23 |
24 | api
25 |
26 |
27 |
28 |
29 |
30 | api
31 |
32 |
33 | api
34 |
35 |
36 | api
37 |
38 |
39 | api
40 |
41 |
42 | api
43 |
44 |
45 | api
46 |
47 |
48 |
49 |
50 | {831b7acd-510c-4ac7-8a3c-479f36083c8a}
51 |
52 |
53 | {f0353912-dae1-4aae-a38a-f99e643fb73d}
54 |
55 |
56 |
--------------------------------------------------------------------------------
/MovingGradient.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Polygon.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | lib
6 |
7 |
8 | lib
9 |
10 |
11 | api
12 |
13 |
14 | api
15 |
16 |
17 | api
18 |
19 |
20 | api
21 |
22 |
23 | api
24 |
25 |
26 |
27 |
28 |
29 | api
30 |
31 |
32 | api
33 |
34 |
35 | api
36 |
37 |
38 | api
39 |
40 |
41 | api
42 |
43 |
44 | api
45 |
46 |
47 |
48 |
49 |
50 | {1e011db8-1221-4d36-a40b-079909a3b1cb}
51 |
52 |
53 | {d7cdfaab-4991-43f9-bd9c-16d6d91fcd00}
54 |
55 |
56 |
--------------------------------------------------------------------------------
/Polygon.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # NOT UPDATED ANYMORE
2 | As this has been merged in https://github.com/resolume/ffgl, this repo will not be updated anymore.
3 |
4 | https://github.com/flyingrub/ffgl/tree/more provide a few more examples to see what this framework is capable of.
5 |
6 | # FFGL Plugin quickstart
7 | This repository is intended to be a little framework around the FFGL SDK. It takes care of all the boring stuff and let you focus on what you really want to do : be creative.
8 |
9 | ### How do I use this ?
10 | Everything you need to know to start to write your own plugin can be found on the [wiki](https://github.com/resolume/ffgl/wiki) of this repo.
--------------------------------------------------------------------------------
/Scanline.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | api
6 |
7 |
8 | api
9 |
10 |
11 | api
12 |
13 |
14 | api
15 |
16 |
17 | api
18 |
19 |
20 | lib
21 |
22 |
23 | lib
24 |
25 |
26 |
27 |
28 |
29 | api
30 |
31 |
32 | api
33 |
34 |
35 | api
36 |
37 |
38 | api
39 |
40 |
41 | api
42 |
43 |
44 | api
45 |
46 |
47 |
48 |
49 |
50 | {1cc3d9c6-c2aa-4bf0-8f8f-728aae66d468}
51 |
52 |
53 | {12731fc0-33a5-4734-be75-76175ee7957a}
54 |
55 |
56 |
--------------------------------------------------------------------------------
/Scanline.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Screenshake.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | lib
7 |
8 |
9 | lib
10 |
11 |
12 | api
13 |
14 |
15 | api
16 |
17 |
18 | api
19 |
20 |
21 | api
22 |
23 |
24 | api
25 |
26 |
27 |
28 |
29 |
30 | api
31 |
32 |
33 | api
34 |
35 |
36 | api
37 |
38 |
39 | api
40 |
41 |
42 | api
43 |
44 |
45 | api
46 |
47 |
48 |
49 |
50 | {cd39377e-2b62-4d0b-8e1d-7bd442e69dd9}
51 |
52 |
53 | {fdfe4a76-a567-4ef7-93fc-4bc4d3f740de}
54 |
55 |
56 |
--------------------------------------------------------------------------------
/Screenshake.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Strobotime.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | api
6 |
7 |
8 | api
9 |
10 |
11 | api
12 |
13 |
14 | api
15 |
16 |
17 | api
18 |
19 |
20 | lib
21 |
22 |
23 | lib
24 |
25 |
26 |
27 |
28 |
29 | api
30 |
31 |
32 | api
33 |
34 |
35 | api
36 |
37 |
38 | api
39 |
40 |
41 | api
42 |
43 |
44 | api
45 |
46 |
47 |
48 |
49 |
50 | {07c1e186-9f1f-4154-a449-7d332e774721}
51 |
52 |
53 | {2d8c07f8-9edb-4880-9d49-1e3e44aa64ce}
54 |
55 |
56 |
--------------------------------------------------------------------------------
/Strobotime.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Triskel.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | lib
6 |
7 |
8 | lib
9 |
10 |
11 | api
12 |
13 |
14 | api
15 |
16 |
17 | api
18 |
19 |
20 | api
21 |
22 |
23 | api
24 |
25 |
26 |
27 |
28 |
29 | api
30 |
31 |
32 | api
33 |
34 |
35 | api
36 |
37 |
38 | api
39 |
40 |
41 | api
42 |
43 |
44 | api
45 |
46 |
47 |
48 |
49 |
50 | {9af19624-1681-477e-91d8-c9ac639a47a5}
51 |
52 |
53 | {d5cb4a05-8637-4cc5-afb3-8865ff94ce1f}
54 |
55 |
56 |
--------------------------------------------------------------------------------
/Triskel.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/lib/FFGLSDK.cpp:
--------------------------------------------------------------------------------
1 | #include "FFGLSDK.h"
2 |
3 | #include "ffgl/FFGL.cpp"
4 | #include "ffgl/FFGLPluginInfo.cpp"
5 | #include "ffgl/FFGLPluginInfoData.cpp"
6 | #include "ffgl/FFGLPluginManager.cpp"
7 | #include "ffgl/FFGLPluginSDK.cpp"
8 |
9 | #include "ffglex/FFGLFBO.cpp"
10 | #include "ffglex/FFGLScopedBufferBinding.cpp"
11 | #include "ffglex/FFGLScopedSamplerActivation.cpp"
12 | #include "ffglex/FFGLScopedShaderBinding.cpp"
13 | #include "ffglex/FFGLScopedTextureBinding.cpp"
14 | #include "ffglex/FFGLScopedVAOBinding.cpp"
15 | #include "ffglex/FFGLScreenQuad.cpp"
16 | #include "ffglex/FFGLShader.cpp"
17 | #include "ffglex/FFGLUtilities.cpp"
18 |
19 | #include "glsdk_0_5_2/glload/source/gl_load.c"
--------------------------------------------------------------------------------
/lib/FFGLSDK.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "ffgl/FFGL.h"
3 | #include "ffgl/FFGLLib.h"
4 | #include "ffgl/FFGLPluginSDK.h"
5 |
6 | #include "ffglex/FFGLFBO.h"
7 | #include "ffglex/FFGLScopedBufferBinding.h"
8 | #include "ffglex/FFGLScopedSamplerActivation.h"
9 | #include "ffglex/FFGLScopedShaderBinding.h"
10 | #include "ffglex/FFGLScopedTextureBinding.h"
11 | #include "ffglex/FFGLScopedVAOBinding.h"
12 | #include "ffglex/FFGLScreenQuad.h"
13 | #include "ffglex/FFGLShader.h"
14 | #include "ffglex/FFGLUtilities.h"
--------------------------------------------------------------------------------
/lib/ffgl/FFGLLib.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2 | // FFGLLib.h
3 | //
4 | // FreeFrame is an open-source cross-platform real-time video effects plugin system.
5 | // It provides a framework for developing video effects plugins and hosts on Windows,
6 | // Linux and Mac OSX.
7 | //
8 | // Copyright (c) 2006 www.freeframe.org
9 | // All rights reserved.
10 | //
11 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
12 |
13 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
14 | // FFGLLib.h by Trey Harrison
15 | // www.harrisondigitalmedia.com
16 | //
17 | // Last modified: Oct 01 2018 by Menno Vink
18 | // email:menno@resolume.com
19 | // -Changed GLdouble to GLfloat
20 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
21 |
22 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
23 | //
24 | // Redistribution and use in source and binary forms, with or without modification,
25 | // are permitted provided that the following conditions are met:
26 | //
27 | // * Redistributions of source code must retain the above copyright
28 | // notice, this list of conditions and the following disclaimer.
29 | // * Redistributions in binary form must reproduce the above copyright
30 | // notice, this list of conditions and the following disclaimer in
31 | // the documentation and/or other materials provided with the
32 | // distribution.
33 | // * Neither the name of FreeFrame nor the names of its
34 | // contributors may be used to endorse or promote products derived
35 | // from this software without specific prior written permission.
36 | //
37 | //
38 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
39 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
40 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
41 | // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
42 | // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
43 | // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
44 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
45 | // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
46 | // OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
47 | // OF THE POSSIBILITY OF SUCH DAMAGE.
48 | //
49 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
50 |
51 | #ifndef __FFGLLIB_H__
52 | #define __FFGLLIB_H__
53 |
54 | //FFGLTexCoords
55 | typedef struct FFGLTexCoordsTag
56 | {
57 | GLfloat s, t;
58 | } FFGLTexCoords;
59 |
60 | //helper function to return the s,t,r coordinate
61 | //that cooresponds to the width,height,depth of the used
62 | //portion of the texture
63 | inline FFGLTexCoords GetMaxGLTexCoords( FFGLTextureStruct t )
64 | {
65 | FFGLTexCoords texCoords;
66 |
67 | //the texture may only occupy a portion
68 | //of the allocated hardware texture memory
69 |
70 | //normalized (0..1) S and T coords
71 | texCoords.s = ( (GLfloat)t.Width ) / (GLfloat)t.HardwareWidth;
72 | texCoords.t = ( (GLfloat)t.Height ) / (GLfloat)t.HardwareHeight;
73 |
74 | return texCoords;
75 | }
76 |
77 | #endif
78 |
--------------------------------------------------------------------------------
/lib/ffgl/FFGLPluginInfo.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2004 - InfoMus Lab - DIST - University of Genova
3 | //
4 | // InfoMus Lab (Laboratorio di Informatica Musicale)
5 | // DIST - University of Genova
6 | //
7 | // http://www.infomus.dist.unige.it
8 | // news://infomus.dist.unige.it
9 | // mailto:staff@infomus.dist.unige.it
10 | //
11 | // Developer: Gualtiero Volpe
12 | // mailto:volpe@infomus.dist.unige.it
13 | //
14 | // Last modified: 2004-11-10
15 | //
16 |
17 | #include "FFGLPluginInfo.h"
18 | #include
19 | #include
20 | #include
21 |
22 | extern CFFGLPluginInfo* g_CurrPluginInfo;
23 |
24 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
25 | // CFFGLPluginInfo constructor and destructor
26 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
27 |
28 | CFFGLPluginInfo::CFFGLPluginInfo(
29 | FPCREATEINSTANCEGL* pCreateInstance,
30 | const char* pchUniqueID,
31 | const char* pchPluginName,
32 | unsigned int dwAPIMajorVersion,
33 | unsigned int dwAPIMinorVersion,
34 | unsigned int dwPluginMajorVersion,
35 | unsigned int dwPluginMinorVersion,
36 | unsigned int dwPluginType,
37 | const char* pchDescription,
38 | const char* pchAbout,
39 | unsigned int dwFreeFrameExtendedDataSize,
40 | const void* pFreeFrameExtendedDataBlock )
41 | {
42 | //This FFGL SDK is intended for developing plugins based on the FFGL 2.0 specification. Please
43 | //update your plugin code to use FFGL 2.0.
44 | assert( dwAPIMajorVersion >= 2 );
45 |
46 | m_pCreateInstance = pCreateInstance;
47 |
48 | // Filling PluginInfoStruct
49 | m_PluginInfo.APIMajorVersion = dwAPIMajorVersion;
50 | m_PluginInfo.APIMinorVersion = dwAPIMinorVersion;
51 |
52 | bool bEndFound = false;
53 | for( int i = 0; ( i < 16 ) && ( !bEndFound ); ++i )
54 | {
55 | if( pchPluginName[ i ] == 0 )
56 | bEndFound = true;
57 | ( m_PluginInfo.PluginName )[ i ] = ( bEndFound ) ? 0 : pchPluginName[ i ];
58 | }
59 |
60 | bEndFound = false;
61 | for( int j = 0; ( j < 4 ) && ( !bEndFound ); ++j )
62 | {
63 | if( pchUniqueID[ j ] == 0 )
64 | bEndFound = true;
65 | ( m_PluginInfo.PluginUniqueID )[ j ] = ( bEndFound ) ? 0 : pchUniqueID[ j ];
66 | }
67 |
68 | m_PluginInfo.PluginType = dwPluginType;
69 |
70 | // Filling PluginExtendedInfoStruct
71 | m_PluginExtendedInfo.About = strdup( pchAbout );
72 | m_PluginExtendedInfo.Description = strdup( pchDescription );
73 | m_PluginExtendedInfo.PluginMajorVersion = dwPluginMajorVersion;
74 | m_PluginExtendedInfo.PluginMinorVersion = dwPluginMinorVersion;
75 | if( ( dwFreeFrameExtendedDataSize > 0 ) && ( pFreeFrameExtendedDataBlock != NULL ) )
76 | {
77 | memcpy( m_PluginExtendedInfo.FreeFrameExtendedDataBlock, pFreeFrameExtendedDataBlock, dwFreeFrameExtendedDataSize );
78 | m_PluginExtendedInfo.FreeFrameExtendedDataSize = dwFreeFrameExtendedDataSize;
79 | }
80 | else
81 | {
82 | m_PluginExtendedInfo.FreeFrameExtendedDataBlock = NULL;
83 | m_PluginExtendedInfo.FreeFrameExtendedDataSize = 0;
84 | }
85 |
86 | g_CurrPluginInfo = this;
87 | }
88 |
89 | CFFGLPluginInfo::~CFFGLPluginInfo()
90 | {
91 | free( m_PluginExtendedInfo.About );
92 | free( m_PluginExtendedInfo.Description );
93 | }
94 |
95 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
96 | // CFFGLPluginInfo methods
97 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
98 |
99 | const PluginInfoStruct* CFFGLPluginInfo::GetPluginInfo() const
100 | {
101 | return &m_PluginInfo;
102 | }
103 |
104 | const PluginExtendedInfoStruct* CFFGLPluginInfo::GetPluginExtendedInfo() const
105 | {
106 | return &m_PluginExtendedInfo;
107 | }
108 |
109 | FPCREATEINSTANCEGL* CFFGLPluginInfo::GetFactoryMethod() const
110 | {
111 | return m_pCreateInstance;
112 | }
113 |
--------------------------------------------------------------------------------
/lib/ffgl/FFGLPluginInfoData.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // FFGLPluginInfoData.cpp
3 | //
4 | // Usually you do not need to edit this file!
5 | //
6 |
7 | #include "FFGLPluginInfo.h"
8 |
9 | //////////////////////////////////////////////////////////////////
10 | // Information about the plugin
11 | //////////////////////////////////////////////////////////////////
12 |
13 | CFFGLPluginInfo* g_CurrPluginInfo = NULL;
14 |
15 | //////////////////////////////////////////////////////////////////
16 | // Plugin dll entry point
17 | //////////////////////////////////////////////////////////////////
18 | #ifdef _WIN32
19 | BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved )
20 | {
21 | return TRUE;
22 | }
23 | #endif
24 |
--------------------------------------------------------------------------------
/lib/ffgl/FFGLPluginSDK.cpp:
--------------------------------------------------------------------------------
1 | #define _CRT_SECURE_NO_WARNINGS
2 | //
3 | // Copyright (c) 2004 - InfoMus Lab - DIST - University of Genova
4 | //
5 | // InfoMus Lab (Laboratorio di Informatica Musicale)
6 | // DIST - University of Genova
7 | //
8 | // http://www.infomus.dist.unige.it
9 | // news://infomus.dist.unige.it
10 | // mailto:staff@infomus.dist.unige.it
11 | //
12 | // Developer: Gualtiero Volpe
13 | // mailto:volpe@infomus.dist.unige.it
14 | //
15 | // Developer: Trey Harrison
16 | // mailto:trey@treyharrison.com
17 | //
18 | // Last modified: Oct. 26 2006
19 | //
20 |
21 | #include "FFGLPluginSDK.h"
22 | #include
23 | #include
24 |
25 | // Buffer used by the default implementation of getParameterDisplay
26 | static char s_DisplayValue[ 16 ];
27 |
28 | ////////////////////////////////////////////////////////
29 | // CFreeFrameGLPlugin constructor and destructor
30 | ////////////////////////////////////////////////////////
31 |
32 | CFreeFrameGLPlugin::CFreeFrameGLPlugin() :
33 | CFFGLPluginManager(),
34 | bpm( 120.0f ),
35 | barPhase( 0.0f )
36 | {
37 | }
38 |
39 | CFreeFrameGLPlugin::~CFreeFrameGLPlugin()
40 | {
41 | }
42 |
43 | ////////////////////////////////////////////////////////
44 | // Default implementation of CFreeFrameGLPlugin methods
45 | ////////////////////////////////////////////////////////
46 |
47 | char* CFreeFrameGLPlugin::GetParameterDisplay( unsigned int index )
48 | {
49 | unsigned int pType = m_pPlugin->GetParamType( index );
50 | if( pType != FF_FAIL )
51 | {
52 | if( pType == FF_TYPE_TEXT )
53 | {
54 | return m_pPlugin->GetTextParameter( index );
55 | }
56 | else
57 | {
58 | std::string stringValue = std::to_string(m_pPlugin->GetFloatParameter( index ));
59 | memset(s_DisplayValue, 0, sizeof(s_DisplayValue));
60 | memcpy(s_DisplayValue, stringValue.c_str(), std::min(sizeof(s_DisplayValue), stringValue.length()));
61 | return s_DisplayValue;
62 | }
63 | }
64 | return NULL;
65 | }
66 |
67 | FFResult CFreeFrameGLPlugin::SetFloatParameter( unsigned int index, float value )
68 | {
69 | return FF_FAIL;
70 | }
71 |
72 | FFResult CFreeFrameGLPlugin::SetTextParameter( unsigned int index, const char* value )
73 | {
74 | return FF_FAIL;
75 | }
76 |
77 | float CFreeFrameGLPlugin::GetFloatParameter( unsigned int index )
78 | {
79 | return 0.0;
80 | }
81 |
82 | char* CFreeFrameGLPlugin::GetTextParameter( unsigned int index )
83 | {
84 | return (char*)FF_FAIL;
85 | }
86 |
87 | FFResult CFreeFrameGLPlugin::GetInputStatus( unsigned int index )
88 | {
89 | if( index >= GetMaxInputs() )
90 | return FF_FAIL;
91 | return FF_INPUT_INUSE;
92 | }
93 |
94 | void CFreeFrameGLPlugin::SetBeatInfo( float bpm, float barPhase )
95 | {
96 | this->bpm = bpm;
97 | this->barPhase = barPhase;
98 | }
99 |
100 | void CFreeFrameGLPlugin::SetHostInfo(const char * hostname, const char * version)
101 | {
102 | hostInfos.name = hostname;
103 | hostInfos.version = version;
104 | }
105 |
106 | void CFreeFrameGLPlugin::SetSampleRate(unsigned int _sampleRate)
107 | {
108 | sampleRate = _sampleRate;
109 | }
110 |
111 |
--------------------------------------------------------------------------------
/lib/ffglex/FFGLFBO.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "../ffgl/FFGL.h"
3 |
4 | namespace ffglex
5 | {
6 | class FFGLFBO
7 | {
8 | public:
9 | FFGLFBO();
10 |
11 | int Create( int width, int height );
12 | int Create( int width, int height, GLuint pixelFormat );
13 | int BindAsRenderTarget();
14 | int UnbindAsRenderTarget( GLuint hostFbo );
15 |
16 | FFGLTextureStruct GetTextureInfo() const;
17 | void FreeResources();
18 | void ResizeViewPort();
19 |
20 | GLuint GetWidth()
21 | {
22 | return m_width;
23 | }
24 | GLuint GetHeight()
25 | {
26 | return m_height;
27 | }
28 | GLuint GetFBOHandle() const
29 | {
30 | return m_fboHandle;
31 | }
32 |
33 | protected:
34 | GLuint m_width;
35 | GLuint m_height;
36 | GLuint m_glWidth;
37 | GLuint m_glHeight;
38 | GLuint m_glPixelFormat;
39 | GLuint m_glTextureHandle;
40 | GLuint m_fboHandle;
41 | GLuint m_depthBufferHandle;
42 | };
43 |
44 | }//End namespace ffglex
--------------------------------------------------------------------------------
/lib/ffglex/FFGLScopedBufferBinding.cpp:
--------------------------------------------------------------------------------
1 | #include "FFGLScopedBufferBinding.h"
2 |
3 | namespace ffglex
4 | {
5 | ScopedBufferBinding::ScopedBufferBinding( GLenum target, GLuint newBinding ) :
6 | target( target ),
7 | isBound( true )
8 | {
9 | glBindBuffer( target, newBinding );
10 | }
11 | ScopedBufferBinding::~ScopedBufferBinding()
12 | {
13 | EndScope();
14 | }
15 |
16 | void ScopedBufferBinding::EndScope()
17 | {
18 | if( isBound )
19 | {
20 | glBindBuffer( target, 0 );
21 | isBound = false;
22 | }
23 | }
24 |
25 | }//End namespace ffglex
--------------------------------------------------------------------------------
/lib/ffglex/FFGLScopedBufferBinding.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "../ffgl/FFGL.h"//For OpenGL
3 |
4 | namespace ffglex
5 | {
6 | class ScopedBufferBinding
7 | {
8 | public:
9 | ScopedBufferBinding( GLenum target, GLuint newBinding );
10 | virtual ~ScopedBufferBinding();
11 |
12 | void EndScope();
13 |
14 | private:
15 | GLenum target;
16 | bool isBound;
17 | };
18 |
19 | class ScopedVBOBinding : public ScopedBufferBinding
20 | {
21 | public:
22 | ScopedVBOBinding( GLuint vboID ) :
23 | ScopedBufferBinding( GL_ARRAY_BUFFER, vboID )
24 | {
25 | }
26 | };
27 |
28 | }//End namespace ffglex
--------------------------------------------------------------------------------
/lib/ffglex/FFGLScopedSamplerActivation.cpp:
--------------------------------------------------------------------------------
1 | #include "FFGLScopedSamplerActivation.h"
2 |
3 | namespace ffglex
4 | {
5 | ScopedSamplerActivation::ScopedSamplerActivation( GLuint samplerIndex ) :
6 | isBound( true )
7 | {
8 | glActiveTexture( GL_TEXTURE0 + samplerIndex );
9 | }
10 | ScopedSamplerActivation::~ScopedSamplerActivation()
11 | {
12 | EndScope();
13 | }
14 |
15 | void ScopedSamplerActivation::EndScope()
16 | {
17 | if( isBound )
18 | {
19 | glActiveTexture( GL_TEXTURE0 + 0 );
20 | isBound = false;
21 | }
22 | }
23 |
24 | }//End namespace ffglex
--------------------------------------------------------------------------------
/lib/ffglex/FFGLScopedSamplerActivation.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "../ffgl/FFGL.h"//For OpenGL
3 |
4 | namespace ffglex
5 | {
6 | class ScopedSamplerActivation
7 | {
8 | public:
9 | ScopedSamplerActivation( GLuint samplerIndex );
10 | ~ScopedSamplerActivation();
11 |
12 | void EndScope();
13 |
14 | private:
15 | bool isBound;
16 | };
17 |
18 | }//End namespace ffglex
--------------------------------------------------------------------------------
/lib/ffglex/FFGLScopedShaderBinding.cpp:
--------------------------------------------------------------------------------
1 | #include "FFGLScopedShaderBinding.h"
2 |
3 | namespace ffglex
4 | {
5 | ScopedShaderBinding::ScopedShaderBinding( GLuint shaderID ) :
6 | isBound( true )
7 | {
8 | glUseProgram( shaderID );
9 | }
10 | ScopedShaderBinding::~ScopedShaderBinding()
11 | {
12 | EndScope();
13 | }
14 |
15 | void ScopedShaderBinding::EndScope()
16 | {
17 | if( isBound )
18 | {
19 | glUseProgram( 0 );
20 | isBound = false;
21 | }
22 | }
23 |
24 | }//End namespace ffglex
--------------------------------------------------------------------------------
/lib/ffglex/FFGLScopedShaderBinding.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "../ffgl/FFGL.h"//For OpenGL
3 |
4 | namespace ffglex
5 | {
6 | class ScopedShaderBinding
7 | {
8 | public:
9 | ScopedShaderBinding( GLuint shaderID );
10 | ~ScopedShaderBinding();
11 |
12 | void EndScope();
13 |
14 | private:
15 | bool isBound;
16 | };
17 |
18 | }//End namespace ffglex
--------------------------------------------------------------------------------
/lib/ffglex/FFGLScopedTextureBinding.cpp:
--------------------------------------------------------------------------------
1 | #include "FFGLScopedTextureBinding.h"
2 |
3 | namespace ffglex
4 | {
5 | ScopedTextureBinding::ScopedTextureBinding( GLenum target, GLuint textureID ) :
6 | target( target ),
7 | isBound( true )
8 | {
9 | glBindTexture( target, textureID );
10 | }
11 | ScopedTextureBinding::~ScopedTextureBinding()
12 | {
13 | EndScope();
14 | }
15 |
16 | void ScopedTextureBinding::EndScope()
17 | {
18 | if( isBound )
19 | {
20 | glBindTexture( target, 0 );
21 | isBound = false;
22 | }
23 | }
24 |
25 | }//End namespace ffglex
--------------------------------------------------------------------------------
/lib/ffglex/FFGLScopedTextureBinding.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "../ffgl/FFGL.h"//For OpenGL
3 |
4 | namespace ffglex
5 | {
6 | class ScopedTextureBinding
7 | {
8 | public:
9 | ScopedTextureBinding( GLenum target, GLuint textureID );
10 | virtual ~ScopedTextureBinding();
11 |
12 | void EndScope();
13 |
14 | private:
15 | GLenum target;
16 | bool isBound;
17 | };
18 |
19 | class Scoped2DTextureBinding : public ScopedTextureBinding
20 | {
21 | public:
22 | Scoped2DTextureBinding( GLuint textureID ) :
23 | ScopedTextureBinding( GL_TEXTURE_2D, textureID )
24 | {
25 | }
26 | };
27 |
28 | }//End namespace ffglex
--------------------------------------------------------------------------------
/lib/ffglex/FFGLScopedVAOBinding.cpp:
--------------------------------------------------------------------------------
1 | #include "FFGLScopedVAOBinding.h"
2 |
3 | namespace ffglex
4 | {
5 | ScopedVAOBinding::ScopedVAOBinding( GLuint vaoID ) :
6 | isBound( true )
7 | {
8 | glBindVertexArray( vaoID );
9 | }
10 | ScopedVAOBinding::~ScopedVAOBinding()
11 | {
12 | EndScope();
13 | }
14 |
15 | void ScopedVAOBinding::EndScope()
16 | {
17 | if( isBound )
18 | {
19 | glBindVertexArray( 0 );
20 | isBound = false;
21 | }
22 | }
23 |
24 | }//End namespace ffglex
--------------------------------------------------------------------------------
/lib/ffglex/FFGLScopedVAOBinding.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "../ffgl/FFGL.h"//For OpenGL
3 |
4 | namespace ffglex
5 | {
6 | class ScopedVAOBinding
7 | {
8 | public:
9 | ScopedVAOBinding( GLuint vaoID );
10 | ~ScopedVAOBinding();
11 |
12 | void EndScope();
13 |
14 | private:
15 | bool isBound;
16 | };
17 |
18 | }//End namespace ffglex
--------------------------------------------------------------------------------
/lib/ffglex/FFGLScreenQuad.cpp:
--------------------------------------------------------------------------------
1 | #include "FFGLScreenQuad.h"
2 | #include
3 | #include "FFGLScopedVAOBinding.h"
4 | #include "FFGLScopedBufferBinding.h"
5 | #include "FFGLUtilities.h"
6 |
7 | namespace ffglex
8 | {
9 |
10 | FFGLScreenQuad::FFGLScreenQuad() :
11 | vaoID( 0 ),
12 | vboID( 0 )
13 | {
14 | }
15 | FFGLScreenQuad::~FFGLScreenQuad()
16 | {
17 | //If any of these assertions hit you forgot to release this quad's gl resources.
18 | assert( vaoID == 0 );
19 | assert( vaoID == 0 );
20 | }
21 |
22 | /**
23 | * Allow this utility to load the data it requires to do it's rendering into it's buffers.
24 | * This function needs to be called using an active OpenGL context, for example in your plugin's
25 | * InitGL function.
26 | *
27 | * @return: Whether or not initialising this quad succeeded.
28 | */
29 | bool FFGLScreenQuad::Initialise()
30 | {
31 | glGenVertexArrays( 1, &vaoID );
32 | glGenBuffers( 1, &vboID );
33 | if( vaoID == 0 || vboID == 0 )
34 | {
35 | Release();
36 | return false;
37 | }
38 |
39 | //FFGL requires us to leave the context in a default state, so use these scoped bindings to
40 | //help us restore the state after we're done.
41 | ScopedVAOBinding vaoBinding( vaoID );
42 | ScopedVBOBinding vboBinding( vboID );
43 | glBufferData( GL_ARRAY_BUFFER, sizeof( TEXTURED_QUAD_VERTICES ), TEXTURED_QUAD_VERTICES, GL_STATIC_DRAW );
44 |
45 | glEnableVertexAttribArray( 0 );
46 | glVertexAttribPointer( 0, 3, GL_FLOAT, false, sizeof( TEXTURED_QUAD_VERTICES[ 0 ] ), (char*)NULL + 2 * sizeof( float ) );
47 | glEnableVertexAttribArray( 1 );
48 | glVertexAttribPointer( 1, 2, GL_FLOAT, false, sizeof( TEXTURED_QUAD_VERTICES[ 0 ] ), (char*)NULL + 0 * sizeof( float ) );
49 |
50 | //The array enablements are part of the vao binding and not the global context state so we dont have to disable those here.
51 |
52 | return true;
53 | }
54 | /**
55 | * Draw the quad. Depending on your vertex shader this will apply your fragment shader in the area where the quad ends up.
56 | * You need to have successfully initialised this quad before rendering it.
57 | */
58 | void FFGLScreenQuad::Draw()
59 | {
60 | if( vaoID == 0 || vboID == 0 )
61 | return;
62 |
63 | //Scoped binding to make sure we dont keep the vao bind after we're done rendering.
64 | ScopedVAOBinding vaoBinding( vaoID );
65 | glDrawArrays( GL_TRIANGLES, 0, 6 );
66 | }
67 | /**
68 | * Release the gpu resources this quad has loaded into vram. Call this before destruction if you've previously initialised us.
69 | */
70 | void FFGLScreenQuad::Release()
71 | {
72 | glDeleteBuffers( 1, &vboID );
73 | vboID = 0;
74 | glDeleteVertexArrays( 1, &vaoID );
75 | vaoID = 0;
76 | }
77 |
78 | }//End namespace ffglex
--------------------------------------------------------------------------------
/lib/ffglex/FFGLScreenQuad.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "../ffgl/FFGL.h"//For OpenGL
3 | #include
4 |
5 | namespace ffglex
6 | {
7 | /**
8 | * The ScreenQuad is a utility that helps you load vertex data representing a quad into a buffer
9 | * and setting up a vao to source it's vertex attributes from this buffer. You can then tell this
10 | * quad to draw itself which will use that buffer and vao to render the quad.
11 | */
12 | class FFGLScreenQuad
13 | {
14 | public:
15 | FFGLScreenQuad();
16 | FFGLScreenQuad( const FFGLScreenQuad& ) = delete;
17 | FFGLScreenQuad( FFGLScreenQuad&& ) = delete;
18 | ~FFGLScreenQuad();
19 |
20 | bool Initialise(); //Allow this utility to load the data it requires to do it's rendering into it's buffers.
21 | void Draw(); //Draw the quad. Depending on your vertex shader this will apply your fragment shader in the area where the quad ends up.
22 | void Release(); //Release the gpu resources this quad has loaded into vram. Call this before destruction if you've previously initialised us.
23 |
24 | private:
25 | GLuint vaoID;
26 | GLuint vboID;
27 | };
28 |
29 | }//End namespace ffglex
--------------------------------------------------------------------------------
/lib/ffglex/FFGLShader.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "../ffgl/FFGL.h"//For OpenGL
3 | #include
4 | #include
5 | #include