aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/demo/demo.odin76
1 files changed, 42 insertions, 34 deletions
diff --git a/examples/demo/demo.odin b/examples/demo/demo.odin
index c287e4054..d12df2776 100644
--- a/examples/demo/demo.odin
+++ b/examples/demo/demo.odin
@@ -2339,10 +2339,18 @@ matrix_type :: proc() {
m4 := mat4(m2)
assert(m4[2, 2] == 1)
assert(m4[3, 3] == 1)
- fmt.println("m2", m2)
+ fmt.printf("m2 %#v\n", m2)
fmt.println("m4", m4)
fmt.println("mat2(m4)", mat2(m4))
assert(mat2(m4) == m2)
+
+ b4 := mat4{
+ 1, 2, 0, 0,
+ 3, 4, 0, 0,
+ 5, 0, 6, 0,
+ 0, 7, 0, 8,
+ }
+ fmt.println("b4", matrix_flatten(b4))
}
{ // Casting non-square matrices
@@ -2414,39 +2422,39 @@ matrix_type :: proc() {
main :: proc() {
when true {
- the_basics()
- control_flow()
- named_proc_return_parameters()
- explicit_procedure_overloading()
- struct_type()
- union_type()
- using_statement()
- implicit_context_system()
- parametric_polymorphism()
- array_programming()
- map_type()
- implicit_selector_expression()
- partial_switch()
- cstring_example()
- bit_set_type()
- deferred_procedure_associations()
- reflection()
- quaternions()
- unroll_for_statement()
- where_clauses()
- foreign_system()
- ranged_fields_for_array_compound_literals()
- deprecated_attribute()
- range_statements_with_multiple_return_values()
- threading_example()
- soa_struct_layout()
- constant_literal_expressions()
- union_maybe()
- explicit_context_definition()
- relative_data_types()
- or_else_operator()
- or_return_operator()
- arbitrary_precision_maths()
+ // the_basics()
+ // control_flow()
+ // named_proc_return_parameters()
+ // explicit_procedure_overloading()
+ // struct_type()
+ // union_type()
+ // using_statement()
+ // implicit_context_system()
+ // parametric_polymorphism()
+ // array_programming()
+ // map_type()
+ // implicit_selector_expression()
+ // partial_switch()
+ // cstring_example()
+ // bit_set_type()
+ // deferred_procedure_associations()
+ // reflection()
+ // quaternions()
+ // unroll_for_statement()
+ // where_clauses()
+ // foreign_system()
+ // ranged_fields_for_array_compound_literals()
+ // deprecated_attribute()
+ // range_statements_with_multiple_return_values()
+ // threading_example()
+ // soa_struct_layout()
+ // constant_literal_expressions()
+ // union_maybe()
+ // explicit_context_definition()
+ // relative_data_types()
+ // or_else_operator()
+ // or_return_operator()
+ // arbitrary_precision_maths()
matrix_type()
}
}