Checking in OPENGL2

This commit is contained in:
codeanticode
2011-02-01 09:35:04 +00:00
parent ece8bb95bf
commit 14b3439590
11 changed files with 11953 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/processing-core"/>
<classpathentry kind="lib" path="library/gluegen-rt.jar"/>
<classpathentry kind="lib" path="library/jogl.all.jar"/>
<classpathentry kind="lib" path="library/nativewindow.all.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>processing-opengl2</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,273 @@
#Wed Dec 29 10:09:39 KST 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=18
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=18
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=20
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=36
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=18
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=18
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
org.eclipse.jdt.core.formatter.blank_lines_before_field=0
org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
org.eclipse.jdt.core.formatter.blank_lines_before_method=1
org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
org.eclipse.jdt.core.formatter.blank_lines_before_package=0
org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=0
org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.comment.clear_blank_lines=false
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
org.eclipse.jdt.core.formatter.comment.format_block_comments=false
org.eclipse.jdt.core.formatter.comment.format_comments=true
org.eclipse.jdt.core.formatter.comment.format_header=false
org.eclipse.jdt.core.formatter.comment.format_html=true
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false
org.eclipse.jdt.core.formatter.comment.format_line_comments=false
org.eclipse.jdt.core.formatter.comment.format_source_code=true
org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
org.eclipse.jdt.core.formatter.comment.line_length=80
org.eclipse.jdt.core.formatter.compact_else_if=true
org.eclipse.jdt.core.formatter.continuation_indentation=2
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_empty_lines=false
org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
org.eclipse.jdt.core.formatter.indentation.size=2
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.join_lines_in_comments=true
org.eclipse.jdt.core.formatter.join_wrapped_lines=true
org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
org.eclipse.jdt.core.formatter.lineSplit=80
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
org.eclipse.jdt.core.formatter.tabulation.char=space
org.eclipse.jdt.core.formatter.tabulation.size=2
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true

View File

@@ -0,0 +1,4 @@
#Fri Feb 19 16:20:47 EST 2010
eclipse.preferences.version=1
formatter_profile=_processing
formatter_settings_version=11

View File

@@ -0,0 +1,26 @@
<?xml version="1.0"?>
<project name="Processing OpenGL2 Library" default="build">
<target name="clean" description="Clean the build directories">
<delete dir="bin" />
<delete file="library/opengl2.jar" />
</target>
<target name="compile" description="Compile sources">
<condition property="core-built">
<available file="../../../core/core.jar" />
</condition>
<fail unless="core-built" message="Please build the core library first and make sure it sits in ../../../core/core.jar" />
<mkdir dir="bin" />
<javac target="1.5"
srcdir="src" destdir="bin"
encoding="UTF-8"
includeAntRuntime="false"
classpath="../../../core/core.jar; library/jogl.all.jar; library/nativewindow.all.jar;" />
</target>
<target name="build" depends="compile" description="Build OpenGL2 library">
<jar basedir="bin" destfile="library/opengl2.jar" />
</target>
</project>

View File

@@ -0,0 +1,10 @@
# If you want to support more platforms, see the jogl.dev.java.net to get the
# natives libraries for the platform in question (i.e. Solaris).
name = OpenGL2
# In releases later than (but not including) 1.0.9, the applet JAR files
# are downloaded directly from Sun, so that a single version is cached
# on the user's computer, rather than increasing the download size with
# the versions for each platform.
applet = opengl2.jar

View File

@@ -0,0 +1,285 @@
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
Part of the Processing project - http://processing.org
Copyright (c) 2004-08 Ben Fry and Casey Reas
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General
Public License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
*/
package processing.opengl2;
import java.util.HashMap;
import processing.core.PApplet;
import processing.core.PConstants;
import processing.core.PFont;
import processing.core.PMetadata;
/**
* All the infrastructure needed for optimized font rendering
* in OpenGL.
* By Andres Colubri
*
*/
class PFontTexture extends PMetadata implements PConstants {
protected PApplet parent;
protected PFont font;
protected int maxTexWidth;
protected int maxTexHeight;
protected int offsetX;
protected int offsetY;
protected int lineHeight;
protected PTexture[] textures = null;
protected int currentTex;
protected int lastTex;
protected TextureInfo[] glyphTexinfos;
protected HashMap<PFont.Glyph, TextureInfo> texinfoMap;
public PFontTexture(PApplet parent, PFont font, int maxw, int maxh) {
this.parent = parent;
this.font = font;
initTexture(maxw, maxh);
}
public void delete() {
for (int i = 0; i < textures.length; i++) {
textures[i].delete();
}
}
protected void initTexture(int w, int h) {
maxTexWidth = w;
maxTexHeight = h;
currentTex = -1;
lastTex = -1;
addTexture();
offsetX = 0;
offsetY = 0;
lineHeight = 0;
texinfoMap = new HashMap<PFont.Glyph, TextureInfo>();
glyphTexinfos = new TextureInfo[font.getGlyphCount()];
addAllGlyphsToTexture();
}
public boolean addTexture() {
int w, h;
boolean resize;
w = maxTexWidth;
if (-1 < currentTex && textures[currentTex].glHeight < maxTexHeight) {
// The height of the current texture is less than the maximum, this
// means we can replace it with a larger texture.
h = PApplet.min(2 * textures[currentTex].glHeight, maxTexHeight);
resize = true;
} else {
h = PApplet.min(512, maxTexHeight / 4);
resize = false;
}
PTexture tex = new PTexture(parent, w, h, new PTexture.Parameters(ARGB, BILINEAR));
if (textures == null) {
textures = new PTexture[1];
textures[0] = tex;
currentTex = 0;
} else if (resize) {
// Replacing old smaller texture with larger one.
// But first we must copy the contents of the older
// texture into the new one.
PTexture tex0 = textures[currentTex];
tex.put(tex0);
textures[currentTex] = tex;
tex0.delete();
} else {
// Adding new texture to the list.
PTexture[] temp = textures;
textures = new PTexture[textures.length + 1];
PApplet.arrayCopy(temp, textures, temp.length);
textures[temp.length] = tex;
currentTex = textures.length - 1;
}
lastTex = currentTex;
// Make sure that the current texture is bound.
tex.bind();
return resize;
}
public void setFirstTexture() {
setTexture(0);
}
public void setTexture(int idx) {
if (0 <= idx && idx < textures.length) {
currentTex = idx;
textures[currentTex].bind();
}
}
// Add all the current glyphs to opengl texture.
public void addAllGlyphsToTexture() {
// loop over current glyphs.
for (int i = 0; i < font.getGlyphCount(); i++) {
addToTexture(i, font.getGlyph(i));
}
}
public void updateGlyphsTexCoords() {
// loop over current glyphs.
for (int i = 0; i < font.getGlyphCount(); i++) {
TextureInfo tinfo = glyphTexinfos[i];
if (tinfo != null && tinfo.texIndex == currentTex) {
tinfo.updateUV();
}
}
}
public TextureInfo getTexInfo(PFont.Glyph glyph) {
TextureInfo info = texinfoMap.get(glyph);
return info;
}
public TextureInfo addToTexture(PFont.Glyph glyph) {
int n = glyphTexinfos.length;
if (n == 0) {
glyphTexinfos = new TextureInfo[1];
}
addToTexture(n, glyph);
return glyphTexinfos[n];
}
// It was inside PFont.Glyph
// Adds this glyph to the opengl texture in PFont.
protected void addToTexture(int idx, PFont.Glyph glyph) {
// Converting the pixels array from the PImage into a valid RGBA array for OpenGL.
int[] rgba = new int[glyph.width * glyph.height];
int t = 0;
int p = 0;
if (PGraphicsOpenGL2.BIG_ENDIAN) {
for (int y = 0; y < glyph.height; y++) {
for (int x = 0; x < glyph.width; x++) {
rgba[t++] = 0xFFFFFF00 | glyph.image.pixels[p++];
}
}
} else {
for (int y = 0; y < glyph.height; y++) {
for (int x = 0; x < glyph.width; x++) {
rgba[t++] = (glyph.image.pixels[p++] << 24) | 0x00FFFFFF;
}
}
}
// Is there room for this glyph on the current line?
if (offsetX + glyph.width> textures[currentTex].glWidth) {
// No room, go to the next line:
offsetX = 0;
offsetY += lineHeight;
lineHeight = 0;
}
lineHeight = Math.max(lineHeight, glyph.height);
boolean resized = false;
if (offsetY + lineHeight > textures[currentTex].glHeight) {
// We run out of space in the current texture, we add a new texture:
resized = addTexture();
if (resized) {
// Because the current texture has been resized, we need to
// update the UV coordinates of all the glyphs associated to it:
updateGlyphsTexCoords();
} else {
// A new texture has been created. Reseting texture coordinates
// and line.
offsetX = 0;
offsetY = 0;
lineHeight = 0;
}
}
if (lastTex == -1) {
lastTex = 0;
}
// We assume GL_TEXTURE_2D is enabled at this point.
// We reset texture when it was resized because even the
// texture index didn't change, the texture is a new one
// in fact, so we need to rebind.
if (currentTex != lastTex || resized) {
setTexture(lastTex);
}
//PApplet.println(glyph.width * glyph.height + " " + rgba.length);
textures[currentTex].setTexels(offsetX, offsetY, glyph.width, glyph.height, rgba);
TextureInfo tinfo = new TextureInfo(currentTex, offsetX, offsetY + glyph.height, glyph.width, -glyph.height);
offsetX += glyph.width;
if (idx == glyphTexinfos.length) {
TextureInfo[] temp = new TextureInfo[glyphTexinfos.length + 1];
System.arraycopy(glyphTexinfos, 0, temp, 0, glyphTexinfos.length);
glyphTexinfos = temp;
}
glyphTexinfos[idx] = tinfo;
texinfoMap.put(glyph, tinfo);
}
public class TextureInfo {
public int texIndex;
public int[] crop;
public float u0, u1;
public float v0, v1;
public TextureInfo(int tidx, int cropX, int cropY, int cropW, int cropH) {
texIndex = tidx;
crop = new int[4];
crop[0] = cropX;
crop[1] = cropY;
crop[2] = cropW;
crop[3] = cropH;
u0 = (float)cropX / (float)textures[tidx].glWidth;
u1 = u0 + (float)cropW / (float)textures[tidx].glWidth;
v0 = (float)(cropY + cropH) / (float)textures[tidx].glHeight;
v1 = (float)cropY / (float)textures[tidx].glHeight;
}
void updateUV() {
u0 = (float)crop[0] / (float)textures[texIndex].glWidth;
u1 = u0 + (float)crop[2] / (float)textures[texIndex].glWidth;
v0 = (float)(crop[1] + crop[3]) / (float)textures[texIndex].glHeight;
v1 = (float)crop[1] / (float)textures[texIndex].glHeight;
}
}
}

View File

@@ -0,0 +1,474 @@
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
Part of the Processing project - http://processing.org
Copyright (c) 2010 Ben Fry and Casey Reas
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License version 2.1 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General
Public License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
*/
package processing.opengl2;
import java.nio.IntBuffer;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.GL2GL3;
import processing.core.PApplet;
import processing.core.PConstants;
/**
* Encapsulates a Frame Buffer Object for offscreen rendering.
* When created with onscreen == true, it represents the normal
* framebuffer. Needed by the stack mechanism in OPENGL2 to return
* to onscreen rendering after a sequence of pushFramebuffer calls.
* It transparently handles the situations when the FBO extension is
* not available.
*
* By Andres Colubri.
*/
public class PFramebuffer implements PConstants {
protected PApplet parent;
protected PGraphicsOpenGL2 pgl;
protected GL gl;
protected GL2GL3 gl2;
protected int glFboID;
protected int glDepthBufferID;
protected int glStencilBufferID;
protected int glDepthStencilBufferID;
protected int glColorBufferMultisampleID;
protected int width;
protected int height;
protected int numColorBuffers;
protected int[] colorBufferAttchPoints;
protected int[] glColorBufferTargets;
protected int[] glColorBufferIDs;
protected boolean screenFb;
protected boolean noDepth;
protected boolean fboMode;
protected boolean multisample;
protected int nsamples;
protected PTexture backupTexture;
protected IntBuffer pixelBuffer;
PFramebuffer(PApplet parent) {
this(parent, 0, 0, false);
}
PFramebuffer(PApplet parent, int w, int h) {
this(parent, w, h, false);
}
PFramebuffer(PApplet parent, int w, int h, boolean screen) {
this.parent = parent;
pgl = (PGraphicsOpenGL2)parent.g;
glFboID = 0;
glDepthBufferID = 0;
glStencilBufferID = 0;
glDepthStencilBufferID = 0;
glColorBufferMultisampleID = 0;
screenFb = screen;
noDepth = false;
fboMode = PGraphicsOpenGL2.fboSupported;
numColorBuffers = 0;
multisample = false;
nsamples = 0;
gl = pgl.gl;
gl2 = pgl.gl2x;
createFramebuffer(w, h);
pixelBuffer = null;
if (!screenFb && !fboMode) {
// When FBOs are not available, rendering to texture is implemented by saving a portion of
// the screen, doing the "offscreen" rendering on this portion, copying the screen color
// buffer to the texture bound as color buffer to this PFramebuffer object and then drawing
// the backup texture back on the screen.
backupTexture = new PTexture(parent, width, height, new PTexture.Parameters(ARGB, POINT));
}
}
public void delete() {
deleteFramebuffer();
}
public void clear() {
pgl.pushFramebuffer();
pgl.setFramebuffer(this);
gl.glClearColor(0f, 0f, 0f, 0.0f);
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT | GL.GL_STENCIL_BUFFER_BIT);
pgl.popFramebuffer();
}
public void copy(PFramebuffer dest) {
gl.glBindFramebuffer(GL2.GL_READ_FRAMEBUFFER, this.glFboID);
gl.glBindFramebuffer(GL2.GL_DRAW_FRAMEBUFFER, dest.glFboID);
gl2.glBlitFramebuffer(0, 0, this.width, this.height, 0, 0, dest.width, dest.height,
GL.GL_COLOR_BUFFER_BIT, GL.GL_NEAREST);
}
public void setColorBuffer(PTexture tex) {
setColorBuffers(new PTexture[] { tex }, 1);
}
public void setColorBuffers(PTexture[] textures) {
setColorBuffers(textures, textures.length);
}
public void setColorBuffers(PTexture[] textures, int n) {
if (screenFb) return;
if (fboMode) {
pgl.pushFramebuffer();
pgl.setFramebuffer(this);
// Making sure nothing is attached.
for (int i = 0; i < numColorBuffers; i++) {
gl.glFramebufferTexture2D(GL.GL_FRAMEBUFFER, GL.GL_COLOR_ATTACHMENT0 + i,
GL.GL_TEXTURE_2D, 0, 0);
}
numColorBuffers = PApplet.min(n, textures.length);
colorBufferAttchPoints = new int[numColorBuffers];
glColorBufferTargets = new int[numColorBuffers];
glColorBufferIDs = new int[numColorBuffers];
for (int i = 0; i < numColorBuffers; i++) {
colorBufferAttchPoints[i] = GL.GL_COLOR_ATTACHMENT0 + i;
glColorBufferTargets[i] = textures[i].getGLTarget();
glColorBufferIDs[i] = textures[i].getGLID();
gl.glFramebufferTexture2D(GL.GL_FRAMEBUFFER, colorBufferAttchPoints[i],
glColorBufferTargets[i], glColorBufferIDs[i], 0);
}
if (validFbo() && textures != null && 0 < textures.length) {
width = textures[0].getGLWidth();
height = textures[0].getGLHeight();
}
pgl.popFramebuffer();
} else {
numColorBuffers = PApplet.min(n, textures.length);
glColorBufferTargets = new int[numColorBuffers];
glColorBufferIDs = new int[numColorBuffers];
for (int i = 0; i < numColorBuffers; i++) {
glColorBufferTargets[i] = textures[i].getGLTarget();
glColorBufferIDs[i] = textures[i].getGLID();
}
}
}
public void addColorBufferMultisample(int samples) {
if (screenFb) return;
if (fboMode) {
pgl.pushFramebuffer();
pgl.setFramebuffer(this);
multisample = true;
nsamples = samples;
numColorBuffers = 1;
colorBufferAttchPoints = new int[numColorBuffers];
colorBufferAttchPoints[0] = GL.GL_COLOR_ATTACHMENT0;
glColorBufferMultisampleID = pgl.createGLResource(PGraphicsOpenGL2.GL_RENDER_BUFFER);
gl.glBindRenderbuffer(GL.GL_RENDERBUFFER, glColorBufferMultisampleID);
gl2.glRenderbufferStorageMultisample(GL.GL_RENDERBUFFER, nsamples,
GL.GL_RGBA8, width, height);
gl.glFramebufferRenderbuffer(GL.GL_FRAMEBUFFER, colorBufferAttchPoints[0],
GL.GL_RENDERBUFFER, glColorBufferMultisampleID);
pgl.popFramebuffer();
}
}
public void addDepthStencilBuffer() {
if (screenFb) return;
if (width == 0 || height == 0) {
throw new RuntimeException("PFramebuffer: size undefined.");
}
if (fboMode) {
pgl.pushFramebuffer();
pgl.setFramebuffer(this);
glDepthStencilBufferID = pgl.createGLResource(PGraphicsOpenGL2.GL_RENDER_BUFFER);
gl.glBindRenderbuffer(GL.GL_RENDERBUFFER, glDepthStencilBufferID);
if (multisample) {
gl2.glRenderbufferStorageMultisample(GL.GL_RENDERBUFFER, nsamples, GL.GL_DEPTH24_STENCIL8, width, height);
} else {
gl.glRenderbufferStorage(GL.GL_RENDERBUFFER, GL.GL_DEPTH24_STENCIL8, width, height);
}
gl.glFramebufferRenderbuffer(GL.GL_FRAMEBUFFER, GL.GL_DEPTH_ATTACHMENT,
GL.GL_RENDERBUFFER, glDepthStencilBufferID);
gl.glFramebufferRenderbuffer(GL.GL_FRAMEBUFFER, GL.GL_STENCIL_ATTACHMENT,
GL.GL_RENDERBUFFER, glDepthStencilBufferID);
pgl.popFramebuffer();
}
}
public void addDepthBuffer(int bits) {
if (screenFb) return;
if (width == 0 || height == 0) {
throw new RuntimeException("PFramebuffer: size undefined.");
}
if (fboMode) {
pgl.pushFramebuffer();
pgl.setFramebuffer(this);
glDepthBufferID = pgl.createGLResource(PGraphicsOpenGL2.GL_RENDER_BUFFER);
gl.glBindRenderbuffer(GL.GL_RENDERBUFFER, glDepthBufferID);
int glConst = GL.GL_DEPTH_COMPONENT16;
if (bits == 16) {
glConst = GL.GL_DEPTH_COMPONENT16;
} else if (bits == 24) {
glConst = GL.GL_DEPTH_COMPONENT24;
} else if (bits == 32) {
glConst = GL.GL_DEPTH_COMPONENT32;
}
if (multisample) {
gl2.glRenderbufferStorageMultisample(GL.GL_RENDERBUFFER, nsamples, glConst, width, height);
} else {
gl.glRenderbufferStorage(GL.GL_RENDERBUFFER, glConst, width, height);
}
gl.glFramebufferRenderbuffer(GL.GL_FRAMEBUFFER, GL.GL_DEPTH_ATTACHMENT,
GL.GL_RENDERBUFFER, glDepthBufferID);
pgl.popFramebuffer();
}
}
public void addStencilBuffer(int bits) {
if (screenFb) return;
if (width == 0 || height == 0) {
throw new RuntimeException("PFramebuffer: size undefined.");
}
if (fboMode) {
pgl.pushFramebuffer();
pgl.setFramebuffer(this);
glStencilBufferID = pgl.createGLResource(PGraphicsOpenGL2.GL_RENDER_BUFFER);
gl.glBindRenderbuffer(GL.GL_RENDERBUFFER, glStencilBufferID);
int glConst = GL.GL_STENCIL_INDEX1;
if (bits == 1) {
glConst = GL.GL_STENCIL_INDEX1;
} else if (bits == 4) {
glConst = GL.GL_STENCIL_INDEX4;
} else if (bits == 8) {
glConst = GL.GL_STENCIL_INDEX8;
}
if (multisample) {
gl2.glRenderbufferStorageMultisample(GL.GL_RENDERBUFFER, nsamples, glConst, width, height);
} else {
gl.glRenderbufferStorage(GL.GL_RENDERBUFFER, glConst, width, height);
}
gl.glFramebufferRenderbuffer(GL.GL_FRAMEBUFFER, GL.GL_STENCIL_ATTACHMENT,
GL.GL_RENDERBUFFER, glStencilBufferID);
pgl.popFramebuffer();
}
}
public void bind() {
if (screenFb) {
if (PGraphicsOpenGL2.fboSupported) {
gl.glBindFramebuffer(GL.GL_FRAMEBUFFER, 0);
}
} else if (fboMode) {
gl.glBindFramebuffer(GL.GL_FRAMEBUFFER, glFboID);
} else {
backupScreen();
if (noDepth) {
gl.glDisable(GL.GL_DEPTH_TEST);
}
}
}
public void disableDepthTest() {
noDepth = true;
}
public void finish() {
if (noDepth) {
// No need to clear depth buffer because depth testing was disabled.
if (pgl.hintEnabled(DISABLE_DEPTH_TEST)) {
gl.glDisable(GL.GL_DEPTH_TEST);
} else {
gl.glEnable(GL.GL_DEPTH_TEST);
}
}
if (!screenFb && !fboMode) {
copyToColorBuffers();
restoreBackup();
if (!noDepth) {
// Reading the contents of the depth buffer is not possible in OpenGL ES:
// http://www.idevgames.com/forum/archive/index.php?t-15828.html
// so if this framebuffer uses depth and is offscreen with no FBOs, then
// the depth buffer is cleared to avoid artifacts when rendering more stuff
// after this offscreen render.
// A consequence of this behavior is that all the offscreen rendering when
// no FBOs are available should be done before any onscreen drawing.
gl.glClearColor(0, 0, 0, 0);
gl.glClear(GL.GL_DEPTH_BUFFER_BIT);
}
}
}
// Saves content of the screen into the backup texture.
public void backupScreen() {
if (pixelBuffer == null) allocatePixelBuffer();
gl.glReadPixels(0, 0, width, height, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, pixelBuffer);
copyToTexture(pixelBuffer, backupTexture.getGLID(), backupTexture.getGLTarget());
}
// Draws the contents of the backup texture to the screen.
public void restoreBackup() {
pgl.drawTexture(backupTexture, 0, 0, width, height, 0, 0, width, height);
}
// Copies current content of screen to color buffers.
public void copyToColorBuffers() {
if (pixelBuffer == null) allocatePixelBuffer();
gl.glReadPixels(0, 0, width, height, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, pixelBuffer);
for (int i = 0; i < numColorBuffers; i++) {
copyToTexture(pixelBuffer, glColorBufferIDs[i], glColorBufferTargets[i]);
}
}
public void readPixels() {
if (pixelBuffer == null) allocatePixelBuffer();
gl.glReadPixels(0, 0, width, height, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, pixelBuffer);
}
public void getPixels(int[] pixels) {
if (pixelBuffer != null) {
pixelBuffer.get(pixels);
pixelBuffer.rewind();
}
}
public IntBuffer getPixelBuffer() {
return pixelBuffer;
}
// Internal copy to texture method.
protected void copyToTexture(IntBuffer buffer, int glid, int gltarget) {
gl.glEnable(gltarget);
gl.glBindTexture(gltarget, glid);
gl.glTexSubImage2D(gltarget, 0, 0, 0, width, height, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, buffer);
gl.glBindTexture(gltarget, 0);
gl.glDisable(gltarget);
}
protected void allocatePixelBuffer() {
pixelBuffer = IntBuffer.allocate(width * height);
pixelBuffer.rewind();
}
protected void createFramebuffer(int w, int h) {
deleteFramebuffer(); // Just in the case this object is being re-initialized.
width = w;
height = h;
if (screenFb) {
glFboID = 0;
} else if (fboMode) {
glFboID = pgl.createGLResource(PGraphicsOpenGL2.GL_FRAME_BUFFER);
} else {
glFboID = 0;
}
}
protected void deleteFramebuffer() {
if (glFboID != 0) {
pgl.deleteGLResource(glFboID, PGraphicsOpenGL2.GL_FRAME_BUFFER);
glFboID = 0;
}
if (glDepthBufferID != 0) {
pgl.deleteGLResource(glDepthBufferID, PGraphicsOpenGL2.GL_RENDER_BUFFER);
glDepthBufferID = 0;
}
if (glStencilBufferID != 0) {
pgl.deleteGLResource(glStencilBufferID, PGraphicsOpenGL2.GL_RENDER_BUFFER);
glStencilBufferID = 0;
}
if (glColorBufferMultisampleID != 0) {
pgl.deleteGLResource(glColorBufferMultisampleID, PGraphicsOpenGL2.GL_RENDER_BUFFER);
glColorBufferMultisampleID = 0;
}
if (glDepthStencilBufferID != 0) {
pgl.deleteGLResource(glDepthStencilBufferID, PGraphicsOpenGL2.GL_RENDER_BUFFER);
glDepthStencilBufferID = 0;
}
width = height = 0;
}
public boolean validFbo() {
int status = gl.glCheckFramebufferStatus(GL.GL_FRAMEBUFFER);
if (status == GL.GL_FRAMEBUFFER_COMPLETE) {
return true;
} else if (status == GL.GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT) {
throw new RuntimeException("PFramebuffer: GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT (" + Integer.toHexString(status) + ")");
} else if (status == GL.GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT) {
throw new RuntimeException("PFramebuffer: GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT (" + Integer.toHexString(status) + ")");
} else if (status == GL.GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS) {
throw new RuntimeException("PFramebuffer: GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS (" + Integer.toHexString(status) + ")");
} else if (status == GL.GL_FRAMEBUFFER_INCOMPLETE_FORMATS) {
throw new RuntimeException("PFramebuffer: GL_FRAMEBUFFER_INCOMPLETE_FORMATS (" + Integer.toHexString(status) + ")");
/*
} else if (status == GL.GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER) {
throw new RuntimeException("PFramebuffer: GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER (" + Integer.toHexString(status) + ")");
} else if (status == GL.GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER) {
throw new RuntimeException("PFramebuffer: GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER (" + Integer.toHexString(status) + ")");
*/
} else if (status == GL.GL_FRAMEBUFFER_UNSUPPORTED) {
throw new RuntimeException("PFramebuffer: GL_FRAMEBUFFER_UNSUPPORTED" + Integer.toHexString(status));
} else {
throw new RuntimeException("PFramebuffer: unknown framebuffer error (" + Integer.toHexString(status) + ")");
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff