mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Change demo.odin to default
This commit is contained in:
@@ -51,7 +51,7 @@ del *.ilk > NUL 2> NUL
|
|||||||
|
|
||||||
cl %compiler_settings% "src\main.cpp" ^
|
cl %compiler_settings% "src\main.cpp" ^
|
||||||
/link %linker_settings% -OUT:%exe_name% ^
|
/link %linker_settings% -OUT:%exe_name% ^
|
||||||
&& odin run examples/demo/demo.odin -llvm-api -keep-temp-files
|
&& odin run examples/demo/demo.odin
|
||||||
if %errorlevel% neq 0 (
|
if %errorlevel% neq 0 (
|
||||||
goto end_of_build
|
goto end_of_build
|
||||||
)
|
)
|
||||||
|
|||||||
+29
-65
@@ -1935,70 +1935,34 @@ icons_texture_data_size := [2]int{0 = 512, 1 = 256};
|
|||||||
|
|
||||||
|
|
||||||
main :: proc() {
|
main :: proc() {
|
||||||
// cache size
|
when true {
|
||||||
Nx := 512;
|
the_basics();
|
||||||
Ny := 128;
|
control_flow();
|
||||||
Nz := 0;
|
named_proc_return_parameters();
|
||||||
is_array := false;
|
explicit_procedure_overloading();
|
||||||
|
struct_type();
|
||||||
// detect target based on input size
|
union_type();
|
||||||
switch {
|
using_statement();
|
||||||
case Nz > 0 && !is_array: fmt.println("1");
|
implicit_context_system();
|
||||||
case Nz > 0 && is_array: fmt.println("2");
|
parametric_polymorphism();
|
||||||
case Ny > 0 && !is_array: fmt.println("3");
|
array_programming();
|
||||||
case Ny > 0 && is_array: fmt.println("4");
|
map_type();
|
||||||
case: fmt.println("5");
|
implicit_selector_expression();
|
||||||
}
|
partial_switch();
|
||||||
|
cstring_example();
|
||||||
// fmt.println("(Nz > 0 && !is_array) ==", Nz > 0 && !is_array);
|
bit_set_type();
|
||||||
// fmt.println("(Nz > 0 && is_array) ==", Nz > 0 && is_array);
|
deferred_procedure_associations();
|
||||||
// fmt.println("(Ny > 0 && !is_array) ==", Ny > 0 && !is_array);
|
reflection();
|
||||||
// fmt.println("(Ny > 0 && is_array) ==", Ny > 0 && is_array);
|
quaternions();
|
||||||
|
inline_for_statement();
|
||||||
c0 := (Nz > 0) && !is_array;
|
where_clauses();
|
||||||
c1 := (Nz > 0) && is_array;
|
foreign_system();
|
||||||
c2 := (Ny > 0) && !is_array;
|
ranged_fields_for_array_compound_literals();
|
||||||
c3 := (Ny > 0) && is_array;
|
deprecated_attribute();
|
||||||
assert(c0 == false);
|
range_statements_with_multiple_return_values();
|
||||||
assert(c1 == false);
|
threading_example();
|
||||||
assert(c2 == true);
|
soa_struct_layout();
|
||||||
assert(c3 == false);
|
constant_literal_expressions();
|
||||||
// switch {
|
union_maybe();
|
||||||
// case c0: fmt.println("1");
|
|
||||||
// case c1: fmt.println("2");
|
|
||||||
// case c2: fmt.println("3");
|
|
||||||
// case c3: fmt.println("4");
|
|
||||||
// case: fmt.println("5");
|
|
||||||
// }
|
|
||||||
|
|
||||||
when false {
|
|
||||||
// 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();
|
|
||||||
// inline_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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user