Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/RAYLIB_INTEGRATION_REMAINING.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ shading).
### 1.3 Primary implementation surfaces

- `src/builtin_graphics.c` builtin additions.
- `fn/graphics.fn` ergonomic wrappers.
- `fn/gfxutils.fn` ergonomic wrappers.
- New focused demo showing two materials with different parameters.

### 1.4 Dependencies
Expand Down Expand Up @@ -82,7 +82,7 @@ from one scene to multiple scenes and effects.

### 2.3 Primary implementation surfaces

- `fn/graphics.fn` helper layer first.
- `fn/gfxutils.fn` helper layer first.
- `src/builtin_graphics.c` only if additional uniform upload primitives are
required.

Expand Down Expand Up @@ -114,7 +114,7 @@ texture usage.
### 3.3 Primary implementation surfaces

- `src/builtin_graphics.c` new builtin for sampler binding.
- `fn/graphics.fn` wrapper with simple call shape.
- `fn/gfxutils.fn` wrapper with simple call shape.

### 3.4 Dependencies

Expand Down
2 changes: 1 addition & 1 deletion fn/gfx_2d_primitives_demo.fn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Run: ./bin/fn --include=fn fn/gfx_2d_primitives_demo.fn
let
link "graphics.fn" as gfx;
link "gfxutils.fn" as gfx;
import gfx macro key_pressed_action;

fn loop(angle) {
Expand Down
2 changes: 1 addition & 1 deletion fn/gfx_3d_demo.fn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Run: ./bin/fn --include=fn fn/gfx_3d_demo.fn
let
link "graphics.fn" as gfx;
link "gfxutils.fn" as gfx;
import gfx macro key_held_action;
import gfx macro key_pressed_action;

Expand Down
2 changes: 1 addition & 1 deletion fn/gfx_3d_mouse_look_demo.fn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Run: ./bin/fn --include=fn fn/gfx_3d_mouse_look_demo.fn
let
link "graphics.fn" as gfx;
link "gfxutils.fn" as gfx;
import gfx macro key_held_action;
import gfx macro key_pressed_action;

Expand Down
2 changes: 1 addition & 1 deletion fn/gfx_audio_demo.fn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// Uses /home/bill/Music/01.mp3 for playback.
let
link "graphics.fn" as gfx;
link "gfxutils.fn" as gfx;
import gfx macro key_pressed_action;

fn clamp_volume(v) {
Expand Down
2 changes: 1 addition & 1 deletion fn/gfx_camera2d_demo.fn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Run: ./bin/fn --include=fn fn/gfx_camera2d_demo.fn
let
link "graphics.fn" as gfx;
link "gfxutils.fn" as gfx;
import gfx macro key_held_action;
import gfx macro key_pressed_action;

Expand Down
2 changes: 1 addition & 1 deletion fn/gfx_demo.fn
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let
link "graphics.fn" as gfx;
link "gfxutils.fn" as gfx;
import gfx macro key_held_action;
import gfx macro key_pressed_action;

Expand Down
2 changes: 1 addition & 1 deletion fn/gfx_font_demo.fn
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//
// Run: ./bin/fn --include=fn fn/gfx_font_demo.fn
let
link "graphics.fn" as gfx;
link "gfxutils.fn" as gfx;
link "listutils.fn" as list;
import gfx macro key_pressed_action;

Expand Down
2 changes: 1 addition & 1 deletion fn/gfx_material_teaspoon_demo.fn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Run: ./bin/fn --include=fn fn/gfx_material_teaspoon_demo.fn
let
link "graphics.fn" as gfx;
link "gfxutils.fn" as gfx;
import gfx macro key_held_action;
import gfx macro key_pressed_action;

Expand Down
2 changes: 1 addition & 1 deletion fn/gfx_model_demo.fn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Run: ./bin/fn --include=fn fn/gfx_model_demo.fn
let
link "graphics.fn" as gfx;
link "gfxutils.fn" as gfx;
import gfx macro key_held_action;
import gfx macro key_pressed_action;

Expand Down
2 changes: 1 addition & 1 deletion fn/gfx_music_demo.fn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// Uses /home/bill/Music/01.mp3 for playback.
let
link "graphics.fn" as gfx;
link "gfxutils.fn" as gfx;
import gfx macro key_pressed_action;

fn clamp_volume(v) {
Expand Down
2 changes: 1 addition & 1 deletion fn/gfx_render_texture_demo.fn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Run: ./bin/fn --include=fn fn/gfx_render_texture_demo.fn
let
link "graphics.fn" as gfx;
link "gfxutils.fn" as gfx;
import gfx macro key_held_action;
import gfx macro key_pressed_action;

Expand Down
2 changes: 1 addition & 1 deletion fn/gfx_sampler_demo.fn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Run: ./bin/fn --include=fn fn/gfx_sampler_demo.fn
let
link "graphics.fn" as gfx;
link "gfxutils.fn" as gfx;
import gfx macro key_pressed_action;

fn loop(shader, tex0, tex1, blend, dir) {
Expand Down
2 changes: 1 addition & 1 deletion fn/gfx_shader_cache_benchmark.fn
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let
link "graphics.fn" as gfx;
link "gfxutils.fn" as gfx;

fn seed_render_texture(rt) {
gfx.render_to_texture(rt, gfx.rgb(14, 18, 28), fn () {
Expand Down
2 changes: 1 addition & 1 deletion fn/gfx_shader_demo.fn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Run: ./bin/fn --include=fn fn/gfx_shader_demo.fn
let
link "graphics.fn" as gfx;
link "gfxutils.fn" as gfx;
import gfx macro key_pressed_action;

fn loop(shader, tex, amount, dir) {
Expand Down
2 changes: 1 addition & 1 deletion fn/gfx_shader_postprocess_demo.fn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Run: ./bin/fn --include=fn fn/gfx_shader_postprocess_demo.fn
let
link "graphics.fn" as gfx;
link "gfxutils.fn" as gfx;
import gfx macro key_pressed_action;

fn update_osc(value, step, min, max) {
Expand Down
2 changes: 1 addition & 1 deletion fn/gfx_shadow_demo.fn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Run: ./bin/fn --include=fn fn/gfx_shadow_demo.fn
let
link "graphics.fn" as gfx;
link "gfxutils.fn" as gfx;
link "ioutils.fn" as io;
link "listutils.fn" as list;
import gfx macro key_held_action;
Expand Down
2 changes: 1 addition & 1 deletion fn/gfx_teapot_lit_demo.fn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Run: ./bin/fn --include=fn fn/gfx_teapot_lit_demo.fn
let
link "graphics.fn" as gfx;
link "gfxutils.fn" as gfx;
import gfx macro key_held_action;
import gfx macro key_pressed_action;

Expand Down
2 changes: 1 addition & 1 deletion fn/gfx_teapot_two_lights_demo.fn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Run: ./bin/fn --include=fn fn/gfx_teapot_two_lights_demo.fn
let
link "graphics.fn" as gfx;
link "gfxutils.fn" as gfx;
import gfx macro key_held_action;
import gfx macro key_pressed_action;

Expand Down
2 changes: 1 addition & 1 deletion fn/gfx_test.fn
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let
link "graphics.fn" as gfx;
link "gfxutils.fn" as gfx;

fn animate(x) {
if (gfx.should_close()) {
Expand Down
2 changes: 1 addition & 1 deletion fn/gfx_texture_demo.fn
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//
// Run: ./bin/fn --include=fn fn/gfx_texture_demo.fn
let
link "graphics.fn" as gfx;
link "gfxutils.fn" as gfx;
import gfx macro key_pressed_action;

fn loop(tex, angle) {
Expand Down
2 changes: 1 addition & 1 deletion fn/gfx_transform_demo.fn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Run: ./bin/fn --include=fn fn/gfx_transform_demo.fn
let
link "graphics.fn" as gfx;
link "gfxutils.fn" as gfx;
import gfx macro key_pressed_action;

fn loop(angle) {
Expand Down
10 changes: 8 additions & 2 deletions fn/graphics.fn → fn/gfxutils.fn
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,10 @@ syntax keyHeldActionHead ::= "[" body: Syntax(keyHeldActionClauses) "]" {
body
};

syntax keyHeldActionClauses ::= key: Syntax(keyActionKeyExpr) "=>" body: Nest ";" rest: Syntax(keyHeldActionClauses) quote {
syntax keyHeldActionClauses ::= key: Syntax(keyActionKeyExpr) "=>"
body: Nest ";"
rest: Syntax(keyHeldActionClauses)
quote {
if (key_held(unquote(key))) {
unquote(body)
} else {
Expand All @@ -389,7 +392,10 @@ syntax keyPressedActionHead ::= "[" body: Syntax(keyPressedActionClauses) "]" {
body
};

syntax keyPressedActionClauses ::= key: Syntax(keyActionKeyExpr) "=>" body: Nest ";" rest: Syntax(keyPressedActionClauses) quote {
syntax keyPressedActionClauses ::= key: Syntax(keyActionKeyExpr) "=>"
body: Nest ";"
rest: Syntax(keyPressedActionClauses)
quote {
if (key_pressed(unquote(key))) {
unquote(body)
} else {
Expand Down
2 changes: 1 addition & 1 deletion tests/fn/fail_gfx_input_action_missing_default.fn
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let
link "graphics.fn" as gfx;
link "gfxutils.fn" as gfx;
import gfx macro key_held_action;

broken = key_held_action[
Expand Down
2 changes: 1 addition & 1 deletion tests/fn/fail_gfx_input_action_split_arrow.fn
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let
link "graphics.fn" as gfx;
link "gfxutils.fn" as gfx;
import gfx macro key_held_action;

broken = key_held_action[
Expand Down
2 changes: 1 addition & 1 deletion tests/fn/test_gfx_input_action_macros.fn
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let
link "graphics.fn" as gfx;
link "gfxutils.fn" as gfx;
import gfx macro key_held_action;
import gfx macro key_pressed_action;
in
Expand Down
2 changes: 1 addition & 1 deletion tests/fn/test_gfx_material_phase1_smoke.fn
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let
link "graphics.fn" as gfx;
link "gfxutils.fn" as gfx;
in
if (gfx.enabled()) {
{
Expand Down
2 changes: 1 addition & 1 deletion tests/fn/test_gfx_render_texture_sampler_smoke.fn
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let
link "graphics.fn" as gfx;
link "gfxutils.fn" as gfx;
in
if (gfx.enabled()) {
{
Expand Down
2 changes: 1 addition & 1 deletion tests/fn/test_gfx_resource_churn_smoke.fn
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let
link "graphics.fn" as gfx;
link "gfxutils.fn" as gfx;

fn churn_cycle(remaining) {
if (remaining <= 0) {
Expand Down
2 changes: 1 addition & 1 deletion tests/fn/test_gfx_sampler_smoke.fn
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let
link "graphics.fn" as gfx;
link "gfxutils.fn" as gfx;

fn loop_frames(n, shader, tex0, tex1) {
if (n <= 0) { true }
Expand Down
2 changes: 1 addition & 1 deletion tests/fn/test_gfx_shader_reload_smoke.fn
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let
link "graphics.fn" as gfx;
link "gfxutils.fn" as gfx;

fn seed_render_texture(rt, tex) {
gfx.render_to_texture(rt, gfx.rgb(10, 12, 18), fn () {
Expand Down
2 changes: 1 addition & 1 deletion tests/fn/test_gfx_shader_smoke.fn
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let
link "graphics.fn" as gfx;
link "gfxutils.fn" as gfx;
in
if (gfx.enabled()) {
{
Expand Down
2 changes: 1 addition & 1 deletion tests/fn/test_gfx_shadow_smoke.fn
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let
link "graphics.fn" as gfx;
link "gfxutils.fn" as gfx;

fn draw_scene(model) {
assert(gfx.draw_plane(gfx.vec3(0, 0, 0), gfx.vec3(12, 0, 12), gfx.rgb(44, 58, 82)));
Expand Down
Loading