Initial commit
This commit is contained in:
1
.idea/.name
generated
Normal file
1
.idea/.name
generated
Normal file
@@ -0,0 +1 @@
|
|||||||
|
jogl-compute-shaders-fireworks
|
||||||
23
.idea/compiler.xml
generated
Normal file
23
.idea/compiler.xml
generated
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="CompilerConfiguration">
|
||||||
|
<option name="DEFAULT_COMPILER" value="Javac" />
|
||||||
|
<resourceExtensions />
|
||||||
|
<wildcardResourcePatterns>
|
||||||
|
<entry name="!?*.java" />
|
||||||
|
<entry name="!?*.form" />
|
||||||
|
<entry name="!?*.class" />
|
||||||
|
<entry name="!?*.groovy" />
|
||||||
|
<entry name="!?*.scala" />
|
||||||
|
<entry name="!?*.flex" />
|
||||||
|
<entry name="!?*.kt" />
|
||||||
|
<entry name="!?*.clj" />
|
||||||
|
</wildcardResourcePatterns>
|
||||||
|
<annotationProcessing>
|
||||||
|
<profile default="true" name="Default" enabled="false">
|
||||||
|
<processorPath useClasspath="true" />
|
||||||
|
</profile>
|
||||||
|
</annotationProcessing>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
|
|
||||||
5
.idea/encodings.xml
generated
Normal file
5
.idea/encodings.xml
generated
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
|
||||||
|
</project>
|
||||||
|
|
||||||
10
.idea/misc.xml
generated
Normal file
10
.idea/misc.xml
generated
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="EntryPointsManager">
|
||||||
|
<entry_points version="2.0" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK">
|
||||||
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
|
|
||||||
9
.idea/modules.xml
generated
Normal file
9
.idea/modules.xml
generated
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/jogl-compute-shaders-fireworks.iml" filepath="$PROJECT_DIR$/jogl-compute-shaders-fireworks.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
|
|
||||||
5
.idea/scopes/scope_settings.xml
generated
Normal file
5
.idea/scopes/scope_settings.xml
generated
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<component name="DependencyValidationManager">
|
||||||
|
<state>
|
||||||
|
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
|
||||||
|
</state>
|
||||||
|
</component>
|
||||||
8
.idea/vcs.xml
generated
Normal file
8
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="" />
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
|
|
||||||
630
.idea/workspace.xml
generated
Normal file
630
.idea/workspace.xml
generated
Normal file
@@ -0,0 +1,630 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ChangeListManager">
|
||||||
|
<list default="true" id="0193c0b3-1608-4943-8e86-0ee275fde56d" name="Default" comment="">
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/gluegen-rt-natives-linux-amd64.jar" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/gluegen-rt-natives-linux-i586.jar" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/gluegen-rt-natives-macosx-universal.jar" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/gluegen-rt-natives-windows-amd64.jar" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/gluegen-rt-natives-windows-i586.jar" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/gluegen-rt.jar" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/jogl-all-natives-linux-amd64.jar" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/jogl-all-natives-linux-i586.jar" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/jogl-all-natives-macosx-universal.jar" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/jogl-all-natives-windows-amd64.jar" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/jogl-all-natives-windows-i586.jar" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/jogl-all-noawt.jar" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/slf4j-api-1.7.5.jar" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/slf4j-simple-1.7.2.jar" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/.name" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/persesgames/jogl/shader/ComputeProgram.java" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/persesgames/jogl/explosion/ExplosionComputeHandler.java" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/persesgames/jogl/Keyboard.java" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/persesgames/jogl/Renderer.java" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/persesgames/jogl/shader/ShaderProgram.java" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/persesgames/jogl/TestJogl.java" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/persesgames/jogl/Timer.java" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/persesgames/jogl/Util.java" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/compiler.xml" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/encodings.xml" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/persesgames/jogl/explosion/explShader.frag" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/persesgames/jogl/explosion/explShader.vert" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/persesgames/jogl/explosion/explosion.comp" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/com/persesgames/jogl/explosion/explosionCleanUp.comp" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/jogl-compute-shaders-fireworks.iml" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/misc.xml" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/modules.xml" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/scopes/scope_settings.xml" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/vcs.xml" />
|
||||||
|
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
|
||||||
|
</list>
|
||||||
|
<ignored path="jogl-compute-shaders-fireworks.iws" />
|
||||||
|
<ignored path=".idea/workspace.xml" />
|
||||||
|
<option name="TRACKING_ENABLED" value="true" />
|
||||||
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||||
|
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||||
|
</component>
|
||||||
|
<component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
|
||||||
|
<component name="CreatePatchCommitExecutor">
|
||||||
|
<option name="PATCH_PATH" value="" />
|
||||||
|
</component>
|
||||||
|
<component name="DaemonCodeAnalyzer">
|
||||||
|
<disable_hints />
|
||||||
|
</component>
|
||||||
|
<component name="DebuggerManager">
|
||||||
|
<breakpoint_any default_suspend_policy="SuspendAll" default_condition_enabled="true">
|
||||||
|
<breakpoint>
|
||||||
|
<option name="NOTIFY_CAUGHT" value="true" />
|
||||||
|
<option name="NOTIFY_UNCAUGHT" value="true" />
|
||||||
|
<option name="ENABLED" value="false" />
|
||||||
|
<option name="LOG_ENABLED" value="false" />
|
||||||
|
<option name="LOG_EXPRESSION_ENABLED" value="false" />
|
||||||
|
<option name="REMOVE_AFTER_HIT" value="false" />
|
||||||
|
<option name="SUSPEND_POLICY" value="SuspendAll" />
|
||||||
|
<option name="SUSPEND" value="true" />
|
||||||
|
<option name="COUNT_FILTER_ENABLED" value="false" />
|
||||||
|
<option name="COUNT_FILTER" value="0" />
|
||||||
|
<option name="CONDITION_ENABLED" value="true" />
|
||||||
|
<option name="CLASS_FILTERS_ENABLED" value="false" />
|
||||||
|
<option name="INSTANCE_FILTERS_ENABLED" value="false" />
|
||||||
|
<option name="CONDITION" value="" />
|
||||||
|
<option name="LOG_MESSAGE" value="" />
|
||||||
|
</breakpoint>
|
||||||
|
<breakpoint>
|
||||||
|
<option name="NOTIFY_CAUGHT" value="true" />
|
||||||
|
<option name="NOTIFY_UNCAUGHT" value="true" />
|
||||||
|
<option name="ENABLED" value="false" />
|
||||||
|
<option name="LOG_ENABLED" value="false" />
|
||||||
|
<option name="LOG_EXPRESSION_ENABLED" value="false" />
|
||||||
|
<option name="REMOVE_AFTER_HIT" value="false" />
|
||||||
|
<option name="SUSPEND_POLICY" value="SuspendAll" />
|
||||||
|
<option name="SUSPEND" value="true" />
|
||||||
|
<option name="COUNT_FILTER_ENABLED" value="false" />
|
||||||
|
<option name="COUNT_FILTER" value="0" />
|
||||||
|
<option name="CONDITION_ENABLED" value="true" />
|
||||||
|
<option name="CLASS_FILTERS_ENABLED" value="false" />
|
||||||
|
<option name="INSTANCE_FILTERS_ENABLED" value="false" />
|
||||||
|
<option name="CONDITION" value="" />
|
||||||
|
<option name="LOG_MESSAGE" value="" />
|
||||||
|
</breakpoint>
|
||||||
|
</breakpoint_any>
|
||||||
|
<ui_properties default_suspend_policy="SuspendAll" default_condition_enabled="true" />
|
||||||
|
<breakpoint_rules />
|
||||||
|
<ui_properties />
|
||||||
|
</component>
|
||||||
|
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
|
||||||
|
<component name="FavoritesManager">
|
||||||
|
<favorites_list name="jogl-compute-shaders-fireworks" />
|
||||||
|
</component>
|
||||||
|
<component name="FileEditorManager">
|
||||||
|
<leaf>
|
||||||
|
<file leaf-file-name="Util.java" pinned="false" current="false" current-in-tab="false">
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/com/persesgames/jogl/Util.java">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state line="27" column="0" selection-start="694" selection-end="694" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="558">
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
</file>
|
||||||
|
<file leaf-file-name="explShader.frag" pinned="false" current="false" current-in-tab="false">
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/com/persesgames/jogl/explosion/explShader.frag">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="450">
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
</file>
|
||||||
|
<file leaf-file-name="explShader.vert" pinned="false" current="false" current-in-tab="false">
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/com/persesgames/jogl/explosion/explShader.vert">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state line="22" column="0" selection-start="485" selection-end="485" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="504">
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
</file>
|
||||||
|
<file leaf-file-name="ExplosionComputeHandler.java" pinned="false" current="true" current-in-tab="true">
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/com/persesgames/jogl/explosion/ExplosionComputeHandler.java">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state line="19" column="3" selection-start="490" selection-end="490" vertical-scroll-proportion="0.3051643" vertical-offset="147" max-vertical-offset="3726">
|
||||||
|
<folding>
|
||||||
|
<element signature="imports" expanded="true" />
|
||||||
|
</folding>
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
</file>
|
||||||
|
<file leaf-file-name="Renderer.java" pinned="false" current="false" current-in-tab="false">
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/com/persesgames/jogl/Renderer.java">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state line="216" column="0" selection-start="6298" selection-end="6298" vertical-scroll-proportion="0.0" vertical-offset="3212" max-vertical-offset="3852">
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
</file>
|
||||||
|
<file leaf-file-name="Timer.java" pinned="false" current="false" current-in-tab="false">
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/com/persesgames/jogl/Timer.java">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state line="13" column="13" selection-start="230" selection-end="230" vertical-scroll-proportion="0.0" vertical-offset="1299" max-vertical-offset="1926">
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
</file>
|
||||||
|
</leaf>
|
||||||
|
</component>
|
||||||
|
<component name="FindManager">
|
||||||
|
<FindUsagesManager>
|
||||||
|
<setting name="OPEN_NEW_TAB" value="false" />
|
||||||
|
</FindUsagesManager>
|
||||||
|
</component>
|
||||||
|
<component name="Git.Settings">
|
||||||
|
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||||
|
</component>
|
||||||
|
<component name="IdeDocumentHistory">
|
||||||
|
<option name="changedFiles">
|
||||||
|
<list>
|
||||||
|
<option value="$PROJECT_DIR$/src/jogl/Util.java" />
|
||||||
|
<option value="$PROJECT_DIR$/src/com/persesgames/jogl/Renderer.java" />
|
||||||
|
<option value="$PROJECT_DIR$/src/com/persesgames/jogl/explosion/explShader.vert" />
|
||||||
|
<option value="$PROJECT_DIR$/src/com/persesgames/jogl/explosion/ExplosionComputeHandler.java" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
<component name="ProjectFrameBounds">
|
||||||
|
<option name="x" value="439" />
|
||||||
|
<option name="y" value="34" />
|
||||||
|
<option name="width" value="1481" />
|
||||||
|
<option name="height" value="1142" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectLevelVcsManager" settingsEditedManually="true">
|
||||||
|
<OptionsSetting value="true" id="Add" />
|
||||||
|
<OptionsSetting value="true" id="Remove" />
|
||||||
|
<OptionsSetting value="true" id="Checkout" />
|
||||||
|
<OptionsSetting value="true" id="Update" />
|
||||||
|
<OptionsSetting value="true" id="Status" />
|
||||||
|
<OptionsSetting value="true" id="Edit" />
|
||||||
|
<ConfirmationsSetting value="0" id="Add" />
|
||||||
|
<ConfirmationsSetting value="0" id="Remove" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectReloadState">
|
||||||
|
<option name="STATE" value="2" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectView">
|
||||||
|
<navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
|
||||||
|
<flattenPackages />
|
||||||
|
<showMembers />
|
||||||
|
<showModules />
|
||||||
|
<showLibraryContents />
|
||||||
|
<hideEmptyPackages />
|
||||||
|
<abbreviatePackageNames />
|
||||||
|
<autoscrollToSource />
|
||||||
|
<autoscrollFromSource />
|
||||||
|
<sortByType />
|
||||||
|
</navigator>
|
||||||
|
<panes>
|
||||||
|
<pane id="ProjectPane">
|
||||||
|
<subPane>
|
||||||
|
<PATH>
|
||||||
|
<PATH_ELEMENT>
|
||||||
|
<option name="myItemId" value="jogl-compute-shaders-fireworks" />
|
||||||
|
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||||
|
</PATH_ELEMENT>
|
||||||
|
</PATH>
|
||||||
|
<PATH>
|
||||||
|
<PATH_ELEMENT>
|
||||||
|
<option name="myItemId" value="jogl-compute-shaders-fireworks" />
|
||||||
|
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||||
|
</PATH_ELEMENT>
|
||||||
|
<PATH_ELEMENT>
|
||||||
|
<option name="myItemId" value="jogl-compute-shaders-fireworks" />
|
||||||
|
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||||
|
</PATH_ELEMENT>
|
||||||
|
</PATH>
|
||||||
|
</subPane>
|
||||||
|
</pane>
|
||||||
|
<pane id="Scope" />
|
||||||
|
<pane id="PackagesPane" />
|
||||||
|
</panes>
|
||||||
|
</component>
|
||||||
|
<component name="PropertiesComponent">
|
||||||
|
<property name="GoToClass.includeLibraries" value="false" />
|
||||||
|
<property name="GoToClass.toSaveIncludeLibraries" value="false" />
|
||||||
|
<property name="GoToFile.includeJavaFiles" value="false" />
|
||||||
|
<property name="MemberChooser.sorted" value="false" />
|
||||||
|
<property name="MemberChooser.showClasses" value="true" />
|
||||||
|
<property name="MemberChooser.copyJavadoc" value="false" />
|
||||||
|
<property name="last_opened_file_path" value="$PROJECT_DIR$/lib" />
|
||||||
|
<property name="project.structure.last.edited" value="Modules" />
|
||||||
|
<property name="project.structure.proportion" value="0.0" />
|
||||||
|
<property name="project.structure.side.proportion" value="0.2" />
|
||||||
|
<property name="recentsLimit" value="5" />
|
||||||
|
<property name="dynamic.classpath" value="false" />
|
||||||
|
<property name="options.lastSelected" value="settings.github" />
|
||||||
|
<property name="options.splitter.main.proportions" value="0.3" />
|
||||||
|
<property name="options.splitter.details.proportions" value="0.2" />
|
||||||
|
<property name="options.searchVisible" value="true" />
|
||||||
|
</component>
|
||||||
|
<component name="PsiViewer.ProjectComponent">
|
||||||
|
<option name="HIGHLIGHT" value="false" />
|
||||||
|
<option name="FILTER_WHITESPACE" value="false" />
|
||||||
|
<option name="SHOW_PROPERTIES" value="true" />
|
||||||
|
<option name="SPLIT_DIVIDER_POSITION" value="300" />
|
||||||
|
<option name="AUTOSCROLL_TO_SOURCE" value="false" />
|
||||||
|
<option name="AUTOSCROLL_FROM_SOURCE" value="false" />
|
||||||
|
</component>
|
||||||
|
<component name="RecentsManager">
|
||||||
|
<key name="CopyFile.RECENT_KEYS">
|
||||||
|
<recent name="$PROJECT_DIR$/src" />
|
||||||
|
<recent name="$PROJECT_DIR$/lib" />
|
||||||
|
</key>
|
||||||
|
</component>
|
||||||
|
<component name="RunManager" selected="Application.TestJogl (1)">
|
||||||
|
<configuration default="false" name="TestJogl" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
||||||
|
<option name="MAIN_CLASS_NAME" value="jogl.TestJogl" />
|
||||||
|
<option name="VM_PARAMETERS" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH" />
|
||||||
|
<option name="ENABLE_SWING_INSPECTOR" value="false" />
|
||||||
|
<option name="ENV_VARIABLES" />
|
||||||
|
<option name="PASS_PARENT_ENVS" value="true" />
|
||||||
|
<module name="jogl-compute-shaders-fireworks" />
|
||||||
|
<envs />
|
||||||
|
<RunnerSettings RunnerId="Run" />
|
||||||
|
<ConfigurationWrapper RunnerId="Run" />
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
<configuration default="false" name="TestJogl (1)" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
||||||
|
<option name="MAIN_CLASS_NAME" value="com.persesgames.jogl.TestJogl" />
|
||||||
|
<option name="VM_PARAMETERS" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH" />
|
||||||
|
<option name="ENABLE_SWING_INSPECTOR" value="false" />
|
||||||
|
<option name="ENV_VARIABLES" />
|
||||||
|
<option name="PASS_PARENT_ENVS" value="true" />
|
||||||
|
<module name="jogl-compute-shaders-fireworks" />
|
||||||
|
<envs />
|
||||||
|
<RunnerSettings RunnerId="Run" />
|
||||||
|
<ConfigurationWrapper RunnerId="Run" />
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
<configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin" singleton="true">
|
||||||
|
<module name="" />
|
||||||
|
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" />
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
<configuration default="true" type="DartCommandLineRunConfigurationType" factoryName="Dart Command Line Application">
|
||||||
|
<option name="VMOptions" />
|
||||||
|
<option name="arguments" />
|
||||||
|
<option name="filePath" />
|
||||||
|
<option name="name" value="Dart" />
|
||||||
|
<option name="saveOutputToFile" value="false" />
|
||||||
|
<option name="showConsoleOnStdErr" value="false" />
|
||||||
|
<option name="showConsoleOnStdOut" value="false" />
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
<configuration default="true" type="DartUnitRunConfigurationType" factoryName="DartUnit">
|
||||||
|
<option name="VMOptions" />
|
||||||
|
<option name="arguments" />
|
||||||
|
<option name="filePath" />
|
||||||
|
<option name="scope" value="ALL" />
|
||||||
|
<option name="testName" />
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
<configuration default="true" type="Remote" factoryName="Remote">
|
||||||
|
<option name="USE_SOCKET_TRANSPORT" value="true" />
|
||||||
|
<option name="SERVER_MODE" value="false" />
|
||||||
|
<option name="SHMEM_ADDRESS" value="javadebug" />
|
||||||
|
<option name="HOST" value="localhost" />
|
||||||
|
<option name="PORT" value="5005" />
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
<configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug" singleton="true">
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
<configuration default="true" type="Applet" factoryName="Applet">
|
||||||
|
<module name="" />
|
||||||
|
<option name="MAIN_CLASS_NAME" />
|
||||||
|
<option name="HTML_FILE_NAME" />
|
||||||
|
<option name="HTML_USED" value="false" />
|
||||||
|
<option name="WIDTH" value="400" />
|
||||||
|
<option name="HEIGHT" value="300" />
|
||||||
|
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
|
||||||
|
<option name="VM_PARAMETERS" />
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH" />
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
<configuration default="true" type="Application" factoryName="Application">
|
||||||
|
<option name="MAIN_CLASS_NAME" />
|
||||||
|
<option name="VM_PARAMETERS" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH" />
|
||||||
|
<option name="ENABLE_SWING_INSPECTOR" value="false" />
|
||||||
|
<option name="ENV_VARIABLES" />
|
||||||
|
<option name="PASS_PARENT_ENVS" value="true" />
|
||||||
|
<module name="" />
|
||||||
|
<envs />
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
<configuration default="true" type="JUnit" factoryName="JUnit">
|
||||||
|
<module name="" />
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH" />
|
||||||
|
<option name="PACKAGE_NAME" />
|
||||||
|
<option name="MAIN_CLASS_NAME" />
|
||||||
|
<option name="METHOD_NAME" />
|
||||||
|
<option name="TEST_OBJECT" value="class" />
|
||||||
|
<option name="VM_PARAMETERS" value="-ea" />
|
||||||
|
<option name="PARAMETERS" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||||
|
<option name="ENV_VARIABLES" />
|
||||||
|
<option name="PASS_PARENT_ENVS" value="true" />
|
||||||
|
<option name="TEST_SEARCH_SCOPE">
|
||||||
|
<value defaultName="moduleWithDependencies" />
|
||||||
|
</option>
|
||||||
|
<envs />
|
||||||
|
<patterns />
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
<list size="2">
|
||||||
|
<item index="0" class="java.lang.String" itemvalue="Application.TestJogl" />
|
||||||
|
<item index="1" class="java.lang.String" itemvalue="Application.TestJogl (1)" />
|
||||||
|
</list>
|
||||||
|
<recent_temporary>
|
||||||
|
<list size="2">
|
||||||
|
<item index="0" class="java.lang.String" itemvalue="Application.TestJogl (1)" />
|
||||||
|
<item index="1" class="java.lang.String" itemvalue="Application.TestJogl" />
|
||||||
|
</list>
|
||||||
|
</recent_temporary>
|
||||||
|
<configuration name="<template>" type="TestNG" default="true" selected="false">
|
||||||
|
<option name="MAIN_CLASS_NAME" />
|
||||||
|
<option name="VM_PARAMETERS" value="-ea" />
|
||||||
|
<option name="PARAMETERS" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||||
|
</configuration>
|
||||||
|
<configuration name="<template>" type="WebApp" default="true" selected="false">
|
||||||
|
<Host>localhost</Host>
|
||||||
|
<Port>5050</Port>
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
|
<component name="ShelveChangesManager" show_recycled="false" />
|
||||||
|
<component name="SvnConfiguration" maxAnnotateRevisions="500" myUseAcceleration="nothing" myAutoUpdateAfterCommit="false" cleanupOnStartRun="false" SSL_PROTOCOLS="all">
|
||||||
|
<option name="USER" value="" />
|
||||||
|
<option name="PASSWORD" value="" />
|
||||||
|
<option name="mySSHConnectionTimeout" value="30000" />
|
||||||
|
<option name="mySSHReadTimeout" value="30000" />
|
||||||
|
<option name="LAST_MERGED_REVISION" />
|
||||||
|
<option name="MERGE_DRY_RUN" value="false" />
|
||||||
|
<option name="MERGE_DIFF_USE_ANCESTRY" value="true" />
|
||||||
|
<option name="UPDATE_LOCK_ON_DEMAND" value="false" />
|
||||||
|
<option name="IGNORE_SPACES_IN_MERGE" value="false" />
|
||||||
|
<option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" />
|
||||||
|
<option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />
|
||||||
|
<option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />
|
||||||
|
<option name="FORCE_UPDATE" value="false" />
|
||||||
|
<option name="IGNORE_EXTERNALS" value="false" />
|
||||||
|
<myIsUseDefaultProxy>false</myIsUseDefaultProxy>
|
||||||
|
</component>
|
||||||
|
<component name="TaskManager">
|
||||||
|
<task active="true" id="Default" summary="Default task">
|
||||||
|
<changelist id="0193c0b3-1608-4943-8e86-0ee275fde56d" name="Default" comment="" />
|
||||||
|
<created>1389957748775</created>
|
||||||
|
<updated>1389957748775</updated>
|
||||||
|
<workItem from="1389957751293" duration="57000" />
|
||||||
|
<workItem from="1389957808723" duration="676000" />
|
||||||
|
</task>
|
||||||
|
<servers />
|
||||||
|
</component>
|
||||||
|
<component name="TimeTrackingManager">
|
||||||
|
<option name="totallyTimeSpent" value="733000" />
|
||||||
|
</component>
|
||||||
|
<component name="ToolWindowManager">
|
||||||
|
<frame x="439" y="34" width="1481" height="1142" extended-state="0" />
|
||||||
|
<editor active="true" />
|
||||||
|
<layout>
|
||||||
|
<window_info id="Palette	" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="Kotlin" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
|
||||||
|
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
|
||||||
|
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.33065328" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.2546973" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
|
||||||
|
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32964823" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="PsiViewer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
||||||
|
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
|
||||||
|
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
|
||||||
|
</layout>
|
||||||
|
</component>
|
||||||
|
<component name="Vcs.Log.UiProperties">
|
||||||
|
<option name="RECENTLY_FILTERED_USERS">
|
||||||
|
<collection />
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
<component name="VcsContentAnnotationSettings">
|
||||||
|
<option name="myLimit" value="2678400000" />
|
||||||
|
</component>
|
||||||
|
<component name="VcsManagerConfiguration">
|
||||||
|
<option name="myTodoPanelSettings">
|
||||||
|
<TodoPanelSettings />
|
||||||
|
</option>
|
||||||
|
<MESSAGE value="Initial commit" />
|
||||||
|
<option name="LAST_COMMIT_MESSAGE" value="Initial commit" />
|
||||||
|
</component>
|
||||||
|
<component name="XDebuggerManager">
|
||||||
|
<breakpoint-manager />
|
||||||
|
</component>
|
||||||
|
<component name="antWorkspaceConfiguration">
|
||||||
|
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
|
||||||
|
<option name="FILTER_TARGETS" value="false" />
|
||||||
|
</component>
|
||||||
|
<component name="editorHistoryManager">
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/com/persesgames/jogl/Util.java">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state line="10" column="13" selection-start="167" selection-end="167" vertical-scroll-proportion="0.0" vertical-offset="180" max-vertical-offset="558">
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/com/persesgames/jogl/Renderer.java">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state line="216" column="0" selection-start="6298" selection-end="6298" vertical-scroll-proportion="0.0" vertical-offset="3212" max-vertical-offset="3852">
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/com/persesgames/jogl/Timer.java">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state line="13" column="13" selection-start="230" selection-end="230" vertical-scroll-proportion="0.0" vertical-offset="1299" max-vertical-offset="1926">
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/com/persesgames/jogl/Util.java">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state line="27" column="0" selection-start="694" selection-end="694" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="558">
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/com/persesgames/jogl/explosion/explShader.frag">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="640">
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/com/persesgames/jogl/explosion/explShader.vert">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state line="22" column="0" selection-start="485" selection-end="485" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="504">
|
||||||
|
<folding />
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
<entry file="file://$PROJECT_DIR$/src/com/persesgames/jogl/explosion/ExplosionComputeHandler.java">
|
||||||
|
<provider selected="true" editor-type-id="text-editor">
|
||||||
|
<state line="19" column="3" selection-start="490" selection-end="490" vertical-scroll-proportion="0.3051643" vertical-offset="147" max-vertical-offset="3726">
|
||||||
|
<folding>
|
||||||
|
<element signature="imports" expanded="true" />
|
||||||
|
</folding>
|
||||||
|
</state>
|
||||||
|
</provider>
|
||||||
|
</entry>
|
||||||
|
</component>
|
||||||
|
<component name="masterDetails">
|
||||||
|
<states>
|
||||||
|
<state key="ArtifactsStructureConfigurable.UI">
|
||||||
|
<settings>
|
||||||
|
<artifact-editor />
|
||||||
|
<splitter-proportions>
|
||||||
|
<option name="proportions">
|
||||||
|
<list>
|
||||||
|
<option value="0.2" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</splitter-proportions>
|
||||||
|
</settings>
|
||||||
|
</state>
|
||||||
|
<state key="FacetStructureConfigurable.UI">
|
||||||
|
<settings>
|
||||||
|
<last-edited>No facets are configured</last-edited>
|
||||||
|
<splitter-proportions>
|
||||||
|
<option name="proportions">
|
||||||
|
<list>
|
||||||
|
<option value="0.2" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</splitter-proportions>
|
||||||
|
</settings>
|
||||||
|
</state>
|
||||||
|
<state key="GlobalLibrariesConfigurable.UI">
|
||||||
|
<settings>
|
||||||
|
<last-edited>Dart SDK</last-edited>
|
||||||
|
<splitter-proportions>
|
||||||
|
<option name="proportions">
|
||||||
|
<list>
|
||||||
|
<option value="0.2" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</splitter-proportions>
|
||||||
|
</settings>
|
||||||
|
</state>
|
||||||
|
<state key="JdkListConfigurable.UI">
|
||||||
|
<settings>
|
||||||
|
<last-edited>1.7</last-edited>
|
||||||
|
<splitter-proportions>
|
||||||
|
<option name="proportions">
|
||||||
|
<list>
|
||||||
|
<option value="0.2" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</splitter-proportions>
|
||||||
|
</settings>
|
||||||
|
</state>
|
||||||
|
<state key="ModuleStructureConfigurable.UI">
|
||||||
|
<settings>
|
||||||
|
<last-edited>jogl-compute-shaders-fireworks</last-edited>
|
||||||
|
<splitter-proportions>
|
||||||
|
<option name="proportions">
|
||||||
|
<list>
|
||||||
|
<option value="0.2" />
|
||||||
|
<option value="0.6" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</splitter-proportions>
|
||||||
|
</settings>
|
||||||
|
</state>
|
||||||
|
<state key="ProjectJDKs.UI">
|
||||||
|
<settings>
|
||||||
|
<last-edited>1.7</last-edited>
|
||||||
|
<splitter-proportions>
|
||||||
|
<option name="proportions">
|
||||||
|
<list>
|
||||||
|
<option value="0.2" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</splitter-proportions>
|
||||||
|
</settings>
|
||||||
|
</state>
|
||||||
|
<state key="ProjectLibrariesConfigurable.UI">
|
||||||
|
<settings>
|
||||||
|
<splitter-proportions>
|
||||||
|
<option name="proportions">
|
||||||
|
<list>
|
||||||
|
<option value="0.2" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</splitter-proportions>
|
||||||
|
</settings>
|
||||||
|
</state>
|
||||||
|
</states>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
|
|
||||||
22
jogl-compute-shaders-fireworks.iml
Normal file
22
jogl-compute-shaders-fireworks.iml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library>
|
||||||
|
<CLASSES>
|
||||||
|
<root url="file://$MODULE_DIR$/lib" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
<jarDirectory url="file://$MODULE_DIR$/lib" recursive="false" />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
|
|
||||||
BIN
lib/gluegen-rt-natives-linux-amd64.jar
Normal file
BIN
lib/gluegen-rt-natives-linux-amd64.jar
Normal file
Binary file not shown.
BIN
lib/gluegen-rt-natives-linux-i586.jar
Normal file
BIN
lib/gluegen-rt-natives-linux-i586.jar
Normal file
Binary file not shown.
BIN
lib/gluegen-rt-natives-macosx-universal.jar
Normal file
BIN
lib/gluegen-rt-natives-macosx-universal.jar
Normal file
Binary file not shown.
BIN
lib/gluegen-rt-natives-windows-amd64.jar
Normal file
BIN
lib/gluegen-rt-natives-windows-amd64.jar
Normal file
Binary file not shown.
BIN
lib/gluegen-rt-natives-windows-i586.jar
Normal file
BIN
lib/gluegen-rt-natives-windows-i586.jar
Normal file
Binary file not shown.
BIN
lib/gluegen-rt.jar
Normal file
BIN
lib/gluegen-rt.jar
Normal file
Binary file not shown.
BIN
lib/jogl-all-natives-linux-amd64.jar
Normal file
BIN
lib/jogl-all-natives-linux-amd64.jar
Normal file
Binary file not shown.
BIN
lib/jogl-all-natives-linux-i586.jar
Normal file
BIN
lib/jogl-all-natives-linux-i586.jar
Normal file
Binary file not shown.
BIN
lib/jogl-all-natives-macosx-universal.jar
Normal file
BIN
lib/jogl-all-natives-macosx-universal.jar
Normal file
Binary file not shown.
BIN
lib/jogl-all-natives-windows-amd64.jar
Normal file
BIN
lib/jogl-all-natives-windows-amd64.jar
Normal file
Binary file not shown.
BIN
lib/jogl-all-natives-windows-i586.jar
Normal file
BIN
lib/jogl-all-natives-windows-i586.jar
Normal file
Binary file not shown.
BIN
lib/jogl-all-noawt.jar
Normal file
BIN
lib/jogl-all-noawt.jar
Normal file
Binary file not shown.
BIN
lib/slf4j-api-1.7.5.jar
Normal file
BIN
lib/slf4j-api-1.7.5.jar
Normal file
Binary file not shown.
BIN
lib/slf4j-simple-1.7.2.jar
Normal file
BIN
lib/slf4j-simple-1.7.2.jar
Normal file
Binary file not shown.
41
src/com/persesgames/jogl/Keyboard.java
Normal file
41
src/com/persesgames/jogl/Keyboard.java
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
package com.persesgames.jogl;
|
||||||
|
|
||||||
|
import com.jogamp.newt.event.KeyEvent;
|
||||||
|
import com.jogamp.newt.event.KeyListener;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Date: 12/30/13
|
||||||
|
* Time: 9:25 PM
|
||||||
|
*/
|
||||||
|
public class Keyboard implements KeyListener {
|
||||||
|
|
||||||
|
private boolean [] pressed = new boolean[127];
|
||||||
|
private boolean [] released = new boolean[127];
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void keyPressed(KeyEvent keyEvent) {
|
||||||
|
if (keyEvent.getKeyCode() > 0 && keyEvent.getKeyCode() < pressed.length) {
|
||||||
|
pressed[keyEvent.getKeyCode()] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void keyReleased(KeyEvent keyEvent) {
|
||||||
|
if (keyEvent.getKeyCode() > 0 && keyEvent.getKeyCode() < pressed.length) {
|
||||||
|
pressed[keyEvent.getKeyCode()] = false;
|
||||||
|
released[keyEvent.getKeyCode()] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isPressed(short keyCode) {
|
||||||
|
return keyCode < pressed.length && pressed[keyCode];
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isReleased(short keyCode) {
|
||||||
|
boolean result = keyCode < pressed.length && released[keyCode];
|
||||||
|
|
||||||
|
released[keyCode] = false;
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
216
src/com/persesgames/jogl/Renderer.java
Normal file
216
src/com/persesgames/jogl/Renderer.java
Normal file
@@ -0,0 +1,216 @@
|
|||||||
|
package com.persesgames.jogl;
|
||||||
|
|
||||||
|
import com.jogamp.newt.event.KeyEvent;
|
||||||
|
import com.jogamp.newt.opengl.GLWindow;
|
||||||
|
import com.persesgames.jogl.explosion.ExplosionComputeHandler;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import javax.media.opengl.*;
|
||||||
|
import java.util.Random;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Date: 10/25/13
|
||||||
|
* Time: 7:42 PM
|
||||||
|
*/
|
||||||
|
public class Renderer implements GLEventListener {
|
||||||
|
private final static Logger logger = LoggerFactory.getLogger(Renderer.class);
|
||||||
|
|
||||||
|
private final static int MAX_ENTITIES_PER_COLOR = 2000000;
|
||||||
|
|
||||||
|
private final Random random = new Random(System.nanoTime());
|
||||||
|
|
||||||
|
private volatile boolean stopped = false;
|
||||||
|
private volatile boolean dirty = true;
|
||||||
|
|
||||||
|
private final GLWindow glWindow;
|
||||||
|
|
||||||
|
private int width = 100, height = 100;
|
||||||
|
|
||||||
|
private Keyboard keyboard;
|
||||||
|
|
||||||
|
private boolean checkError = false;
|
||||||
|
|
||||||
|
private long lastLog = System.nanoTime();
|
||||||
|
private long start = System.currentTimeMillis();
|
||||||
|
private Timer timer = new Timer(TimeUnit.SECONDS, 1);
|
||||||
|
|
||||||
|
private ExplosionComputeHandler explosionComputeHandler;
|
||||||
|
|
||||||
|
public Renderer(GLWindow glWindow, Keyboard keyboard) {
|
||||||
|
this.glWindow = glWindow;
|
||||||
|
this.keyboard = keyboard;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void stop() {
|
||||||
|
stopped = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void redraw() {
|
||||||
|
dirty = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void run() {
|
||||||
|
Renderer.this.glWindow.display();
|
||||||
|
|
||||||
|
while(!stopped) {
|
||||||
|
if (dirty) {
|
||||||
|
//logger.info("rendering+" + System.currentTimeMillis());
|
||||||
|
Renderer.this.glWindow.display();
|
||||||
|
//Renderer.this.glWindow.swapBuffers();
|
||||||
|
dirty = true;
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
Thread.sleep(1);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
logger.warn(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stopped = keyboard.isPressed(KeyEvent.VK_ESCAPE);
|
||||||
|
}
|
||||||
|
|
||||||
|
Renderer.this.glWindow.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(GLAutoDrawable drawable) {
|
||||||
|
timer.start("init");
|
||||||
|
|
||||||
|
GL4 gl = drawable.getGL().getGL4();
|
||||||
|
|
||||||
|
gl.setSwapInterval(0);
|
||||||
|
|
||||||
|
// debug init
|
||||||
|
//gl = new DebugGL4(gl);
|
||||||
|
|
||||||
|
logger.info("Chosen GLCapabilities: " + drawable.getChosenGLCapabilities());
|
||||||
|
logger.info("INIT GL IS: " + gl.getClass().getName());
|
||||||
|
logger.info("GL_VENDOR: " + gl.glGetString(GL.GL_VENDOR));
|
||||||
|
logger.info("GL_RENDERER: " + gl.glGetString(GL.GL_RENDERER));
|
||||||
|
logger.info("GL_VERSION: " + gl.glGetString(GL.GL_VERSION));
|
||||||
|
|
||||||
|
int [] result = new int[3];
|
||||||
|
gl.glGetIntegerv(GL2.GL_MAX_VERTEX_ATTRIBS, result, 0);
|
||||||
|
logger.info("GL_MAX_VERTEX_ATTRIBS=" + result[0]);
|
||||||
|
|
||||||
|
gl.glGetIntegerv(GL4.GL_MAX_COMPUTE_WORK_GROUP_SIZE, result, 0);
|
||||||
|
logger.info("GL_MAX_COMPUTE_WORK_GROUP_SIZE= {},{},{}", result[0], result[1], result[2]);
|
||||||
|
|
||||||
|
gl.glGetIntegerv(GL4.GL_MAX_COMPUTE_WORK_GROUP_COUNT, result, 0);
|
||||||
|
logger.info("GL_MAX_COMPUTE_WORK_GROUP_COUNT= {},{},{}", result[0], result[1], result[2]);
|
||||||
|
|
||||||
|
explosionComputeHandler = new ExplosionComputeHandler(gl);
|
||||||
|
explosionComputeHandler.init();
|
||||||
|
explosionComputeHandler.createNewExplosionData();
|
||||||
|
explosionComputeHandler.updateGpu();
|
||||||
|
|
||||||
|
timer.stop("init");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void dispose(GLAutoDrawable drawable) {
|
||||||
|
explosionComputeHandler.dispose();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private long lastDelta = System.nanoTime();
|
||||||
|
private float delta = 0f;
|
||||||
|
private void calculateCurrentDelta() {
|
||||||
|
long nanoDelta = System.nanoTime() - lastDelta;
|
||||||
|
|
||||||
|
delta = (nanoDelta / 1000000000f);
|
||||||
|
|
||||||
|
lastDelta = System.nanoTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void display(GLAutoDrawable drawable) {
|
||||||
|
//logger.info("display+" + System.currentTimeMillis());
|
||||||
|
|
||||||
|
calculateCurrentDelta();
|
||||||
|
|
||||||
|
GL4 gl = drawable.getGL().getGL4();
|
||||||
|
|
||||||
|
if (checkError) {
|
||||||
|
// debug
|
||||||
|
gl.glGetError();
|
||||||
|
gl = new DebugGL4(gl);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (keyboard.isPressed(KeyEvent.VK_SHIFT)) {
|
||||||
|
explosionComputeHandler.createNewExplosionData();
|
||||||
|
explosionComputeHandler.updateGpu();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (keyboard.isReleased(KeyEvent.VK_SPACE)) {
|
||||||
|
explosionComputeHandler.createNewExplosionData();
|
||||||
|
explosionComputeHandler.updateGpu();
|
||||||
|
}
|
||||||
|
|
||||||
|
gl.glEnable(GL.GL_BLEND);
|
||||||
|
gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_DST_ALPHA);
|
||||||
|
|
||||||
|
gl.glViewport(0, 0, width, height);
|
||||||
|
|
||||||
|
// Clear screen
|
||||||
|
gl.glClearColor(0.1f, 0.0f, 0.1f, 1f);
|
||||||
|
gl.glClear(GL2ES2.GL_COLOR_BUFFER_BIT);
|
||||||
|
|
||||||
|
timer.start("getCount");
|
||||||
|
|
||||||
|
/*
|
||||||
|
timer.start("BindBuffer");
|
||||||
|
gl.glBindBuffer(GL4.GL_ATOMIC_COUNTER_BUFFER, atomicHandle);
|
||||||
|
timer.stop("BindBuffer");
|
||||||
|
// again we map the buffer to userCounters, but this time for read-only access
|
||||||
|
timer.start("MapBufferRange");
|
||||||
|
ByteBuffer last = gl.glMapBufferRange(GL4.GL_ATOMIC_COUNTER_BUFFER, 0, 4, GL4.GL_MAP_READ_BIT);
|
||||||
|
timer.stop("MapBufferRange");
|
||||||
|
particleCount = last.getInt();
|
||||||
|
timer.start("UnmapBuffer");
|
||||||
|
gl.glUnmapBuffer(GL4.GL_ATOMIC_COUNTER_BUFFER);
|
||||||
|
timer.stop("UnmapBuffer");
|
||||||
|
*/
|
||||||
|
|
||||||
|
timer.stop("getCount");
|
||||||
|
|
||||||
|
timer.start("compute");
|
||||||
|
|
||||||
|
explosionComputeHandler.execute(delta);
|
||||||
|
explosionComputeHandler.cleanUp();
|
||||||
|
|
||||||
|
timer.stop("compute");
|
||||||
|
|
||||||
|
timer.start("getGpuData");
|
||||||
|
|
||||||
|
explosionComputeHandler.getGpuData();
|
||||||
|
|
||||||
|
timer.stop("getGpuData");
|
||||||
|
|
||||||
|
timer.start("draw");
|
||||||
|
|
||||||
|
explosionComputeHandler.render();
|
||||||
|
|
||||||
|
timer.stop("draw");
|
||||||
|
|
||||||
|
timer.log();
|
||||||
|
|
||||||
|
if (lastLog < System.nanoTime() - TimeUnit.SECONDS.toNanos(1)) {
|
||||||
|
lastLog = System.nanoTime();
|
||||||
|
|
||||||
|
logger.info("Explosion particles: {}", explosionComputeHandler.getParticleCount());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reshape(GLAutoDrawable drawable, int x, int y, int w, int h) {
|
||||||
|
logger.info("reshape+" + System.currentTimeMillis());
|
||||||
|
|
||||||
|
this.width = w;
|
||||||
|
this.height = h;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
50
src/com/persesgames/jogl/TestJogl.java
Normal file
50
src/com/persesgames/jogl/TestJogl.java
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
package com.persesgames.jogl;
|
||||||
|
|
||||||
|
import com.jogamp.newt.opengl.GLWindow;
|
||||||
|
|
||||||
|
import javax.media.opengl.GLCapabilities;
|
||||||
|
import javax.media.opengl.GLProfile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Date: 10/25/13
|
||||||
|
* Time: 7:27 PM
|
||||||
|
*/
|
||||||
|
public class TestJogl {
|
||||||
|
|
||||||
|
public static void main(String [] args) {
|
||||||
|
TestJogl test = new TestJogl();
|
||||||
|
|
||||||
|
test.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
private final Renderer renderer;
|
||||||
|
|
||||||
|
public TestJogl() {
|
||||||
|
GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL4ES3));
|
||||||
|
|
||||||
|
caps.setDoubleBuffered(true);
|
||||||
|
|
||||||
|
GLWindow glWindow = GLWindow.create(caps);
|
||||||
|
|
||||||
|
glWindow.setTitle("jogl-triangle");
|
||||||
|
|
||||||
|
glWindow.setSize(800, 800);
|
||||||
|
|
||||||
|
glWindow.setFullscreen(false);
|
||||||
|
glWindow.setUndecorated(false);
|
||||||
|
glWindow.setPointerVisible(true);
|
||||||
|
glWindow.setVisible(true);
|
||||||
|
|
||||||
|
Keyboard keyboard = new Keyboard();
|
||||||
|
glWindow.addKeyListener(keyboard);
|
||||||
|
|
||||||
|
renderer = new Renderer(glWindow, keyboard);
|
||||||
|
|
||||||
|
glWindow.addGLEventListener(renderer);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void run() {
|
||||||
|
renderer.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
106
src/com/persesgames/jogl/Timer.java
Normal file
106
src/com/persesgames/jogl/Timer.java
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
package com.persesgames.jogl;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Date: 1/4/14
|
||||||
|
* Time: 8:00 PM
|
||||||
|
*/
|
||||||
|
public class Timer {
|
||||||
|
private final static Logger logger = LoggerFactory.getLogger(Timer.class);
|
||||||
|
|
||||||
|
private Map<String, Long> start = new HashMap<>();
|
||||||
|
private Map<String, Long> times = new HashMap<>();
|
||||||
|
private Map<String, Long> calls = new HashMap<>();
|
||||||
|
private long nanoStart = System.nanoTime();
|
||||||
|
|
||||||
|
private final TimeUnit unit;
|
||||||
|
private final int units;
|
||||||
|
|
||||||
|
private long lastLog = System.nanoTime();
|
||||||
|
|
||||||
|
public Timer(TimeUnit unit, int units) {
|
||||||
|
this.unit = unit;
|
||||||
|
this.units = units;
|
||||||
|
}
|
||||||
|
|
||||||
|
private long getStart(String timer) {
|
||||||
|
Long result = start.get(timer);
|
||||||
|
|
||||||
|
if (result == null) {
|
||||||
|
result = System.nanoTime();
|
||||||
|
start.put(timer, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private long getTime(String timer) {
|
||||||
|
Long result = times.get(timer);
|
||||||
|
|
||||||
|
if (result == null) {
|
||||||
|
result = 0l;
|
||||||
|
|
||||||
|
times.put(timer, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private long getCalls(String timer) {
|
||||||
|
Long result = calls.get(timer);
|
||||||
|
|
||||||
|
if (result == null) {
|
||||||
|
result = 0l;
|
||||||
|
|
||||||
|
calls.put(timer, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void start(String timer) {
|
||||||
|
start.put(timer, System.nanoTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void stop(String timer) {
|
||||||
|
long start = getStart(timer);
|
||||||
|
|
||||||
|
long delta = System.nanoTime() - start;
|
||||||
|
|
||||||
|
long time = getTime(timer);
|
||||||
|
|
||||||
|
time += delta;
|
||||||
|
|
||||||
|
times.put(timer, time);
|
||||||
|
calls.put(timer, getCalls(timer) + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void reset() {
|
||||||
|
lastLog = System.nanoTime();
|
||||||
|
|
||||||
|
start.clear();
|
||||||
|
times.clear();
|
||||||
|
calls.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void log() {
|
||||||
|
if (System.nanoTime() > (lastLog + unit.toNanos(units))) {
|
||||||
|
|
||||||
|
for (String timer : times.keySet()) {
|
||||||
|
logger.info("Timer '{}' calls '{}' time '{}ms' time/call '{}ms'", timer, getCalls(timer), (getTime(timer) / 1000000d), (getTime(timer) / 1000000d) / (double)getCalls(timer));
|
||||||
|
}
|
||||||
|
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
27
src/com/persesgames/jogl/Util.java
Normal file
27
src/com/persesgames/jogl/Util.java
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
package com.persesgames.jogl;
|
||||||
|
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Date: 10/25/13
|
||||||
|
* Time: 11:03 PM
|
||||||
|
*/
|
||||||
|
public class Util {
|
||||||
|
|
||||||
|
public static String loadAsText(Class cls, String name) {
|
||||||
|
byte [] buffer = new byte[1024];
|
||||||
|
int nr;
|
||||||
|
try (InputStream in = cls.getResourceAsStream(name); ByteArrayOutputStream out = new ByteArrayOutputStream()) {
|
||||||
|
while((nr = in.read(buffer)) > 0) {
|
||||||
|
out.write(buffer,0,nr);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new String(out.toByteArray(), "UTF-8");
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new IllegalStateException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
203
src/com/persesgames/jogl/explosion/ExplosionComputeHandler.java
Normal file
203
src/com/persesgames/jogl/explosion/ExplosionComputeHandler.java
Normal file
@@ -0,0 +1,203 @@
|
|||||||
|
package com.persesgames.jogl.explosion;
|
||||||
|
|
||||||
|
import com.jogamp.common.nio.Buffers;
|
||||||
|
import com.persesgames.jogl.shader.ComputeProgram;
|
||||||
|
import com.persesgames.jogl.shader.ShaderProgram;
|
||||||
|
import com.persesgames.jogl.Util;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import javax.media.opengl.GL;
|
||||||
|
import javax.media.opengl.GL2ES2;
|
||||||
|
import javax.media.opengl.GL4;
|
||||||
|
import java.nio.FloatBuffer;
|
||||||
|
import java.nio.IntBuffer;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Date: 1/15/14
|
||||||
|
* Time: 8:23 PM
|
||||||
|
*/
|
||||||
|
public class ExplosionComputeHandler {
|
||||||
|
private final static Logger logger = LoggerFactory.getLogger(ExplosionComputeHandler.class);
|
||||||
|
|
||||||
|
private final static int EXPLOSION_PARTICLES = 256;
|
||||||
|
private final static int MAX_EXPLOSION_PARTICLES = 1000000;
|
||||||
|
|
||||||
|
private final Random random = new Random(System.nanoTime());
|
||||||
|
|
||||||
|
private GL4 gl;
|
||||||
|
|
||||||
|
private ShaderProgram explProgram;
|
||||||
|
|
||||||
|
private ComputeProgram explosionProgram;
|
||||||
|
private ComputeProgram explCleanUpProgram;
|
||||||
|
|
||||||
|
private FloatBuffer explBuffer = Buffers.newDirectFloatBuffer(MAX_EXPLOSION_PARTICLES * 8);
|
||||||
|
private IntBuffer atomicBuffer = Buffers.newDirectIntBuffer(5);
|
||||||
|
|
||||||
|
|
||||||
|
private int newParticleCount = 0;
|
||||||
|
private int particleCount = 0;
|
||||||
|
|
||||||
|
// opengl handles
|
||||||
|
private int explHandle;
|
||||||
|
private int atomicHandle;
|
||||||
|
|
||||||
|
public ExplosionComputeHandler(GL4 gl) {
|
||||||
|
this.gl = gl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void createNewExplosionData() {
|
||||||
|
float x = random.nextFloat() * 2f - 1f;
|
||||||
|
float y = random.nextFloat() * 2f - 1f;
|
||||||
|
|
||||||
|
if (newParticleCount > (MAX_EXPLOSION_PARTICLES - EXPLOSION_PARTICLES)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
float r = random.nextFloat() * 0.25f;
|
||||||
|
float g = random.nextFloat() * 0.25f;
|
||||||
|
float b = random.nextFloat() * 0.25f;
|
||||||
|
|
||||||
|
for (int i = newParticleCount; i < newParticleCount + EXPLOSION_PARTICLES; i++) {
|
||||||
|
int offset = i * 8;
|
||||||
|
|
||||||
|
float angle = (float) (random.nextFloat() * Math.PI * 2f);
|
||||||
|
float velocity = (random.nextFloat() * 0.25f) + (random.nextFloat() * 0.25f);
|
||||||
|
|
||||||
|
explBuffer.put(offset + 0, x);
|
||||||
|
explBuffer.put(offset + 1, y);
|
||||||
|
explBuffer.put(offset + 2, (float) (Math.sin(angle) * velocity));
|
||||||
|
explBuffer.put(offset + 3, (float) (Math.cos(angle) * velocity));
|
||||||
|
|
||||||
|
explBuffer.put(offset + 4, r);
|
||||||
|
explBuffer.put(offset + 5, g);
|
||||||
|
explBuffer.put(offset + 6, b);
|
||||||
|
explBuffer.put(offset + 7, random.nextFloat() * 0.5f + 0.5f);
|
||||||
|
}
|
||||||
|
|
||||||
|
newParticleCount = newParticleCount + EXPLOSION_PARTICLES;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init() {
|
||||||
|
explosionProgram = new ComputeProgram(gl, Util.loadAsText(getClass(), "explosion.comp"));
|
||||||
|
explosionProgram.getUniformLocation("delta");
|
||||||
|
|
||||||
|
explCleanUpProgram = new ComputeProgram(gl, Util.loadAsText(getClass(), "explosionCleanUp.comp"));
|
||||||
|
|
||||||
|
explProgram = new ShaderProgram(gl,
|
||||||
|
Util.loadAsText(getClass(), "explShader.vert"),
|
||||||
|
Util.loadAsText(getClass(), "explShader.frag"));
|
||||||
|
|
||||||
|
int[] tmpHandle = new int[2];
|
||||||
|
gl.glGenBuffers(2, tmpHandle, 0);
|
||||||
|
|
||||||
|
explHandle = tmpHandle[0];
|
||||||
|
atomicHandle = tmpHandle[1];
|
||||||
|
|
||||||
|
// Select the VBO, GPU memory data, to use for vertices
|
||||||
|
gl.glBindBuffer(GL2ES2.GL_ARRAY_BUFFER, explHandle);
|
||||||
|
|
||||||
|
// transfer data to VBO, this perform the copy of data from CPU -> GPU memory
|
||||||
|
gl.glBufferData(GL.GL_ARRAY_BUFFER, explBuffer.limit() * 4, explBuffer, GL.GL_DYNAMIC_DRAW);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateGpu() {
|
||||||
|
// Select the VBO, GPU memory data, to use for vertices
|
||||||
|
gl.glBindBuffer(GL2ES2.GL_ARRAY_BUFFER, explHandle);
|
||||||
|
|
||||||
|
// transfer data to VBO, this perform the copy of data from CPU -> GPU memory
|
||||||
|
// gl.glBufferData(GL.GL_ARRAY_BUFFER, particleCount * 4 * 8, explBuffer, GL.GL_DYNAMIC_DRAW);
|
||||||
|
gl.glBufferSubData(GL.GL_ARRAY_BUFFER, particleCount * 4 * 8, newParticleCount * 4 * 8, explBuffer);
|
||||||
|
|
||||||
|
// Select the VBO, GPU memory data, to use for vertices
|
||||||
|
gl.glBindBuffer(GL4.GL_ATOMIC_COUNTER_BUFFER, atomicHandle);
|
||||||
|
|
||||||
|
atomicBuffer.put(0, particleCount + newParticleCount);
|
||||||
|
|
||||||
|
// transfer data to VBO, this perform the copy of data from CPU -> GPU memory
|
||||||
|
gl.glBufferData(GL4.GL_ATOMIC_COUNTER_BUFFER, 4, atomicBuffer, GL.GL_DYNAMIC_DRAW);
|
||||||
|
|
||||||
|
gl.glBindBuffer(GL2ES2.GL_ARRAY_BUFFER, 0);
|
||||||
|
gl.glBindBuffer(GL4.GL_ATOMIC_COUNTER_BUFFER, 0);
|
||||||
|
|
||||||
|
newParticleCount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void execute(float delta) {
|
||||||
|
explosionProgram.begin();
|
||||||
|
|
||||||
|
gl.glUniform1f(explosionProgram.getUniformLocation("delta"), delta);
|
||||||
|
|
||||||
|
gl.glBindBufferBase(GL4.GL_SHADER_STORAGE_BUFFER, 0, explHandle);
|
||||||
|
gl.glBindBufferBase(GL4.GL_ATOMIC_COUNTER_BUFFER, 1, atomicHandle);
|
||||||
|
|
||||||
|
explosionProgram.compute((particleCount / 512) + 1, 1, 1);
|
||||||
|
|
||||||
|
gl.glBindBufferBase(GL4.GL_SHADER_STORAGE_BUFFER, 0, 0);
|
||||||
|
gl.glBindBufferBase(GL4.GL_ATOMIC_COUNTER_BUFFER, 1, 0);
|
||||||
|
|
||||||
|
explosionProgram.end();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void cleanUp() {
|
||||||
|
explCleanUpProgram.begin();
|
||||||
|
|
||||||
|
gl.glBindBufferBase(GL4.GL_SHADER_STORAGE_BUFFER, 0, explHandle);
|
||||||
|
gl.glBindBufferBase(GL4.GL_ATOMIC_COUNTER_BUFFER, 1, atomicHandle);
|
||||||
|
|
||||||
|
explCleanUpProgram.compute((particleCount / 512) + 1, 1, 1);
|
||||||
|
|
||||||
|
gl.glBindBufferBase(GL4.GL_SHADER_STORAGE_BUFFER, 0, 0);
|
||||||
|
gl.glBindBufferBase(GL4.GL_ATOMIC_COUNTER_BUFFER, 1, 0);
|
||||||
|
|
||||||
|
explCleanUpProgram.end();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void render() {
|
||||||
|
explProgram.begin();
|
||||||
|
|
||||||
|
if (particleCount > 0) {
|
||||||
|
gl.glEnableVertexAttribArray(0);
|
||||||
|
gl.glEnableVertexAttribArray(1);
|
||||||
|
|
||||||
|
gl.glBindBuffer(GL2ES2.GL_ARRAY_BUFFER, explHandle);
|
||||||
|
|
||||||
|
// Associate Vertex attribute 0 with the last bound VBO
|
||||||
|
gl.glVertexAttribPointer(0 /* the vertex attribute */, 2,
|
||||||
|
GL2ES2.GL_FLOAT, false /* normalized? */, 32 /* stride */,
|
||||||
|
0 /* The bound VBO data offset */);
|
||||||
|
|
||||||
|
// Associate Vertex attribute 0 with the last bound VBO
|
||||||
|
gl.glVertexAttribPointer(1 /* the vertex attribute */, 4,
|
||||||
|
GL2ES2.GL_FLOAT, false /* normalized? */, 32 /* stride */,
|
||||||
|
16 /* The bound VBO data offset */);
|
||||||
|
|
||||||
|
gl.glDrawArrays(GL2ES2.GL_POINTS, 0, particleCount);
|
||||||
|
|
||||||
|
gl.glDisableVertexAttribArray(0);
|
||||||
|
gl.glDisableVertexAttribArray(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
explProgram.end();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getGpuData() {
|
||||||
|
gl.glBindBuffer(GL4.GL_ATOMIC_COUNTER_BUFFER, atomicHandle);
|
||||||
|
gl.glGetBufferSubData(GL4.GL_ATOMIC_COUNTER_BUFFER, 0, 4, atomicBuffer);
|
||||||
|
particleCount = atomicBuffer.get(0);
|
||||||
|
newParticleCount = 0;
|
||||||
|
gl.glBindBuffer(GL4.GL_ATOMIC_COUNTER_BUFFER, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getParticleCount() {
|
||||||
|
return particleCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void dispose() {
|
||||||
|
explProgram.dispose();
|
||||||
|
explosionProgram.dispose();
|
||||||
|
explCleanUpProgram.dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
19
src/com/persesgames/jogl/explosion/explShader.frag
Normal file
19
src/com/persesgames/jogl/explosion/explShader.frag
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
#if __VERSION__ >= 130
|
||||||
|
#define varying in
|
||||||
|
out vec4 mgl_FragColor;
|
||||||
|
#define texture2D texture
|
||||||
|
#define gl_FragColor mgl_FragColor
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef GL_ES
|
||||||
|
precision mediump float;
|
||||||
|
precision mediump int;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
varying vec4 varying_Color;
|
||||||
|
|
||||||
|
void main (void) {
|
||||||
|
float alpha = 1 - smoothstep(0, 1, 2 * distance(gl_PointCoord.st, vec2(0.5, 0.5)));
|
||||||
|
|
||||||
|
gl_FragColor = vec4(varying_Color.rgb, varying_Color.a * alpha);
|
||||||
|
}
|
||||||
22
src/com/persesgames/jogl/explosion/explShader.vert
Normal file
22
src/com/persesgames/jogl/explosion/explShader.vert
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#if __VERSION__ >= 130
|
||||||
|
#define attribute in
|
||||||
|
#define varying out
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef GL_ES
|
||||||
|
precision mediump float;
|
||||||
|
precision mediump int;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
attribute vec4 attribute_Position;
|
||||||
|
attribute vec4 attribute_Color;
|
||||||
|
|
||||||
|
varying vec4 varying_Color;
|
||||||
|
|
||||||
|
void main(void) {
|
||||||
|
mat4 uniform_Projection = mat4(1);
|
||||||
|
|
||||||
|
gl_PointSize = 15f;
|
||||||
|
gl_Position = uniform_Projection * attribute_Position; //vec4(attribute_Position.x, attribute_Position.y, 0, 1);
|
||||||
|
varying_Color = attribute_Color;
|
||||||
|
}
|
||||||
42
src/com/persesgames/jogl/explosion/explosion.comp
Normal file
42
src/com/persesgames/jogl/explosion/explosion.comp
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
#version 430 core
|
||||||
|
#define pi 3.141592653589793238462643383279
|
||||||
|
|
||||||
|
precision mediump float;
|
||||||
|
precision mediump int;
|
||||||
|
|
||||||
|
struct explosion {
|
||||||
|
vec4 positionVelocity;
|
||||||
|
vec4 color;
|
||||||
|
};
|
||||||
|
|
||||||
|
layout (std430, binding = 0) buffer entities {
|
||||||
|
explosion e[];
|
||||||
|
};
|
||||||
|
|
||||||
|
layout(binding = 1, offset = 0) uniform atomic_uint lastCounter;
|
||||||
|
|
||||||
|
uniform float delta;
|
||||||
|
|
||||||
|
layout(local_size_x = 512) in;
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
uint gid = gl_GlobalInvocationID.x;
|
||||||
|
uint last = atomicCounter(lastCounter);
|
||||||
|
|
||||||
|
if (gid < last) {
|
||||||
|
vec2 position = e[gid].positionVelocity.xy;
|
||||||
|
vec2 velocity = e[gid].positionVelocity.zw;
|
||||||
|
vec4 color = e[gid].color;
|
||||||
|
|
||||||
|
if (color.a > 0.0) {
|
||||||
|
//velocity = velocity * 0.99;
|
||||||
|
position = position + velocity * delta * color.a;
|
||||||
|
color.a = color.a - (delta / 2);
|
||||||
|
} else {
|
||||||
|
color.a = 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
e[gid].positionVelocity = vec4(position, velocity);
|
||||||
|
e[gid].color = color;
|
||||||
|
}
|
||||||
|
}
|
||||||
36
src/com/persesgames/jogl/explosion/explosionCleanUp.comp
Normal file
36
src/com/persesgames/jogl/explosion/explosionCleanUp.comp
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
#version 430 core
|
||||||
|
#define pi 3.141592653589793238462643383279
|
||||||
|
|
||||||
|
precision mediump float;
|
||||||
|
precision mediump int;
|
||||||
|
|
||||||
|
struct explosion {
|
||||||
|
vec4 positionVelocity;
|
||||||
|
vec4 color;
|
||||||
|
};
|
||||||
|
|
||||||
|
layout (std430, binding = 0) buffer entities {
|
||||||
|
explosion e[];
|
||||||
|
};
|
||||||
|
|
||||||
|
layout(binding = 1, offset = 0) uniform atomic_uint lastCounter;
|
||||||
|
|
||||||
|
layout (local_size_x = 512) in;
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
uint gid = gl_GlobalInvocationID.x;
|
||||||
|
uint last = atomicCounter(lastCounter);
|
||||||
|
|
||||||
|
if (gid < last && last > 0) {
|
||||||
|
vec4 color = e[gid].color;
|
||||||
|
|
||||||
|
if (color.a == 0.0) {
|
||||||
|
uint old = atomicCounterDecrement(lastCounter);
|
||||||
|
|
||||||
|
e[gid].positionVelocity = e[old].positionVelocity;
|
||||||
|
e[gid].color = e[old].color;
|
||||||
|
|
||||||
|
e[old].color.a = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
126
src/com/persesgames/jogl/shader/ComputeProgram.java
Normal file
126
src/com/persesgames/jogl/shader/ComputeProgram.java
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
package com.persesgames.jogl.shader;
|
||||||
|
|
||||||
|
import com.persesgames.jogl.Renderer;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import javax.media.opengl.GL2ES2;
|
||||||
|
import javax.media.opengl.GL4;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/*-----------------------------------------------------+
|
||||||
|
| App |
|
||||||
|
| pPPAPPp |
|
||||||
|
| APP PPa |
|
||||||
|
| APA pPP PapA PapA |
|
||||||
|
| PPA APA pP P pP P |
|
||||||
|
| APPPPPPPA PPp Ap Ap Ap Ap |
|
||||||
|
| apPPA aPP P P |
|
||||||
|
| APA pPP p p |
|
||||||
|
| pPP PPA |
|
||||||
|
| PPp PPPp |
|
||||||
|
| |
|
||||||
|
| Created by: App Software |
|
||||||
|
| Email: info@appsoftware.nl |
|
||||||
|
| Web: http://www.appsoftware.nl/ |
|
||||||
|
| |
|
||||||
|
+-----------------------------------------------------*/
|
||||||
|
|
||||||
|
public class ComputeProgram {
|
||||||
|
private final static Logger logger = LoggerFactory.getLogger(Renderer.class);
|
||||||
|
|
||||||
|
protected GL4 gl;
|
||||||
|
|
||||||
|
private int shaderProgram;
|
||||||
|
private int computeShader;
|
||||||
|
|
||||||
|
private Map<String, Integer> uniformLocations = new HashMap<>();
|
||||||
|
private Map<String, Integer> attribLocations = new HashMap<>();
|
||||||
|
|
||||||
|
public ComputeProgram(GL4 gl, String compute) {
|
||||||
|
this.gl = gl;
|
||||||
|
|
||||||
|
|
||||||
|
computeShader = createAndCompileShader(GL4.GL_COMPUTE_SHADER, compute);
|
||||||
|
|
||||||
|
shaderProgram = gl.glCreateProgram();
|
||||||
|
|
||||||
|
gl.glAttachShader(shaderProgram, computeShader);
|
||||||
|
|
||||||
|
gl.glLinkProgram(shaderProgram);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUniformLocation(String uniform) {
|
||||||
|
Integer result = uniformLocations.get(uniform);
|
||||||
|
|
||||||
|
if (result == null) {
|
||||||
|
result = gl.glGetUniformLocation(shaderProgram, uniform);
|
||||||
|
|
||||||
|
uniformLocations.put(uniform, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAttribLocation(String attrib) {
|
||||||
|
Integer result = attribLocations.get(attrib);
|
||||||
|
|
||||||
|
if (result == null) {
|
||||||
|
result = gl.glGetAttribLocation(shaderProgram, attrib);
|
||||||
|
|
||||||
|
attribLocations.put(attrib, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void bindAttributeLocation(int location, String name) {
|
||||||
|
gl.glBindAttribLocation(shaderProgram, location, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void begin() {
|
||||||
|
gl.glUseProgram(shaderProgram);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void compute(int x, int y, int z) {
|
||||||
|
gl.glDispatchCompute(x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void end() {
|
||||||
|
gl.glUseProgram(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void dispose() {
|
||||||
|
gl.glDetachShader(shaderProgram, computeShader);
|
||||||
|
gl.glDeleteShader(computeShader);
|
||||||
|
|
||||||
|
gl.glDeleteProgram(shaderProgram);
|
||||||
|
}
|
||||||
|
|
||||||
|
private int createAndCompileShader(int type, String shaderString) {
|
||||||
|
int shader = gl.glCreateShader(type);
|
||||||
|
|
||||||
|
String[] vlines = new String[]{shaderString};
|
||||||
|
int[] vlengths = new int[]{vlines[0].length()};
|
||||||
|
|
||||||
|
gl.glShaderSource(shader, vlines.length, vlines, vlengths, 0);
|
||||||
|
gl.glCompileShader(shader);
|
||||||
|
|
||||||
|
int[] compiled = new int[1];
|
||||||
|
gl.glGetShaderiv(shader, GL2ES2.GL_COMPILE_STATUS, compiled, 0);
|
||||||
|
|
||||||
|
if (compiled[0] == 0) {
|
||||||
|
int[] logLength = new int[1];
|
||||||
|
gl.glGetShaderiv(shader, GL2ES2.GL_INFO_LOG_LENGTH, logLength, 0);
|
||||||
|
|
||||||
|
byte[] log = new byte[logLength[0]];
|
||||||
|
gl.glGetShaderInfoLog(shader, logLength[0], (int[]) null, 0, log, 0);
|
||||||
|
|
||||||
|
throw new IllegalStateException("Error compiling the shader: " + new String(log));
|
||||||
|
}
|
||||||
|
|
||||||
|
return shader;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
131
src/com/persesgames/jogl/shader/ShaderProgram.java
Normal file
131
src/com/persesgames/jogl/shader/ShaderProgram.java
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
package com.persesgames.jogl.shader;
|
||||||
|
|
||||||
|
import com.persesgames.jogl.Renderer;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import javax.media.opengl.GL2ES2;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/*-----------------------------------------------------+
|
||||||
|
| App |
|
||||||
|
| pPPAPPp |
|
||||||
|
| APP PPa |
|
||||||
|
| APA pPP PapA PapA |
|
||||||
|
| PPA APA pP P pP P |
|
||||||
|
| APPPPPPPA PPp Ap Ap Ap Ap |
|
||||||
|
| apPPA aPP P P |
|
||||||
|
| APA pPP p p |
|
||||||
|
| pPP PPA |
|
||||||
|
| PPp PPPp |
|
||||||
|
| |
|
||||||
|
| Created by: App Software |
|
||||||
|
| Email: info@appsoftware.nl |
|
||||||
|
| Web: http://www.appsoftware.nl/ |
|
||||||
|
| |
|
||||||
|
+-----------------------------------------------------*/
|
||||||
|
|
||||||
|
public class ShaderProgram {
|
||||||
|
private final static Logger logger = LoggerFactory.getLogger(Renderer.class);
|
||||||
|
|
||||||
|
private GL2ES2 gl;
|
||||||
|
|
||||||
|
private int shaderProgram;
|
||||||
|
private int vertShader;
|
||||||
|
private int fragShader;
|
||||||
|
|
||||||
|
private Map<String, Integer> uniformLocations = new HashMap<>();
|
||||||
|
private Map<String, Integer> attribLocations = new HashMap<>();
|
||||||
|
|
||||||
|
public ShaderProgram(GL2ES2 gl, String vertex, String fragment) {
|
||||||
|
this.gl = gl;
|
||||||
|
|
||||||
|
if (gl.isGL3core()) {
|
||||||
|
logger.info("GL3 core detected: explicit adding #version 130 to shaders");
|
||||||
|
|
||||||
|
vertex = "#version 130\n" + vertex;
|
||||||
|
fragment = "#version 130\n" + fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
vertShader = createAndCompileShader(GL2ES2.GL_VERTEX_SHADER, vertex);
|
||||||
|
fragShader = createAndCompileShader(GL2ES2.GL_FRAGMENT_SHADER, fragment);
|
||||||
|
|
||||||
|
shaderProgram = gl.glCreateProgram();
|
||||||
|
|
||||||
|
gl.glAttachShader(shaderProgram, vertShader);
|
||||||
|
gl.glAttachShader(shaderProgram, fragShader);
|
||||||
|
|
||||||
|
gl.glLinkProgram(shaderProgram);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUniformLocation(String uniform) {
|
||||||
|
Integer result = uniformLocations.get(uniform);
|
||||||
|
|
||||||
|
if (result == null) {
|
||||||
|
result = gl.glGetUniformLocation(shaderProgram, uniform);
|
||||||
|
|
||||||
|
uniformLocations.put(uniform, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAttribLocation(String attrib) {
|
||||||
|
Integer result = attribLocations.get(attrib);
|
||||||
|
|
||||||
|
if (result == null) {
|
||||||
|
result = gl.glGetAttribLocation(shaderProgram, attrib);
|
||||||
|
|
||||||
|
attribLocations.put(attrib, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void bindAttributeLocation(int location, String name) {
|
||||||
|
gl.glBindAttribLocation(shaderProgram, location, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void begin() {
|
||||||
|
gl.glUseProgram(shaderProgram);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void end() {
|
||||||
|
gl.glUseProgram(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void dispose() {
|
||||||
|
gl.glDetachShader(shaderProgram, vertShader);
|
||||||
|
gl.glDeleteShader(vertShader);
|
||||||
|
gl.glDetachShader(shaderProgram, fragShader);
|
||||||
|
gl.glDeleteShader(fragShader);
|
||||||
|
gl.glDeleteProgram(shaderProgram);
|
||||||
|
}
|
||||||
|
|
||||||
|
private int createAndCompileShader(int type, String shaderString) {
|
||||||
|
int shader = gl.glCreateShader(type);
|
||||||
|
|
||||||
|
String[] vlines = new String[]{shaderString};
|
||||||
|
int[] vlengths = new int[]{vlines[0].length()};
|
||||||
|
|
||||||
|
gl.glShaderSource(shader, vlines.length, vlines, vlengths, 0);
|
||||||
|
gl.glCompileShader(shader);
|
||||||
|
|
||||||
|
int[] compiled = new int[1];
|
||||||
|
gl.glGetShaderiv(shader, GL2ES2.GL_COMPILE_STATUS, compiled, 0);
|
||||||
|
|
||||||
|
if (compiled[0] == 0) {
|
||||||
|
int[] logLength = new int[1];
|
||||||
|
gl.glGetShaderiv(shader, GL2ES2.GL_INFO_LOG_LENGTH, logLength, 0);
|
||||||
|
|
||||||
|
byte[] log = new byte[logLength[0]];
|
||||||
|
gl.glGetShaderInfoLog(shader, logLength[0], (int[]) null, 0, log, 0);
|
||||||
|
|
||||||
|
throw new IllegalStateException("Error compiling the shader: " + new String(log));
|
||||||
|
}
|
||||||
|
|
||||||
|
return shader;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user