Skip to content

Commit

Permalink
Removed Wren support
Browse files Browse the repository at this point in the history
Wren support was half-baked and never used. It would have required quite
some work to get it up to speed with the Lua bindings and then it would
also have required some LSP integration. As of today I see no point in
keeping this around.
  • Loading branch information
tanis2000 committed Jan 29, 2025
1 parent 9bcd42b commit 6148987
Show file tree
Hide file tree
Showing 242 changed files with 0 additions and 100,854 deletions.
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ The API is evolving all the time but the core is pretty stable. I keep adding an
- Experimental hot code reloading for game code
- Lua scripting through LuaJIT on supported platforms and fallback to Lua where LuaJIT is not available
- Luasocket is included out of the box
- Experimental Wren scripting support
- 3D physics through Newton Dynamics (desktop platforms only)

## Documentation
Expand Down Expand Up @@ -89,8 +88,6 @@ The current libraries are the following:
- parson
- Lua
- LuaJIT
- libuv (Wren's dependency)
- Wren
- Newton Dynamics
- Chipmunk (2D physics)

Expand All @@ -106,9 +103,7 @@ Right now there are a few areas that could use some help:

- Adding Linux support. It should work almost out of the box once you figure out the CMake scripts.
- More examples
- Travis scripts to build static libraries for all the different systems so that we can distribute Binocle as a binary library with just the headers and avoid having to recompile the whole library for every new project.
- Complete the Lua bindings
- Complete the Wren bindings

## Manually compiling the library

Expand Down
1 change: 0 additions & 1 deletion assets/wren/binocle/input.wren

This file was deleted.

28 changes: 0 additions & 28 deletions example/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <backend/binocle_material.h>
#include <binocle_lua.h>
#include <binocle_app.h>
#include <binocle_wren.h>

#if defined(__IPHONEOS__) || defined(__ANDROID__)
#include <SDL3/SDL_main.h>
Expand Down Expand Up @@ -107,9 +106,6 @@ binocle_audio_sound sound;
binocle_audio_music music;
char *binocle_data_dir;
binocle_app app;
struct binocle_wren_t *wren;
WrenHandle* gameClass;
WrenHandle* method;
sg_image render_target;
sg_shader default_shader;
sg_shader screen_shader;
Expand All @@ -126,13 +122,6 @@ game_state_t *game_state;
physics_state_t ps;
#endif

void wren_update(float dt) {
wrenEnsureSlots(wren->vm, 2);
wrenSetSlotHandle(wren->vm, 0, gameClass);
wrenSetSlotDouble(wren->vm, 1, dt);
WrenInterpretResult result = wrenCall(wren->vm, method);
}

#if defined(BINOCLE_HTTP)
void test_http_get() {
binocle_http_body_t body;
Expand Down Expand Up @@ -256,10 +245,6 @@ void main_loop() {
viewport.max.x = DESIGN_WIDTH;
viewport.max.y = DESIGN_HEIGHT;

#if !defined(ANDROID)
wren_update(dt);
#endif

#ifdef WITH_PHYSICS
advance_simulation(dt);
#endif
Expand Down Expand Up @@ -654,19 +639,6 @@ int main(int argc, char *argv[])
lua_test_profiler(filename);
//sprintf(filename, "%s%s", binocle_data_dir, "test_ffi.lua");
//lua_testffi(filename, &window);

wren = binocle_wren_new();
binocle_wren_init(wren);
binocle_wren_wrap_input(wren, &input);

char main_wren[1024];
sprintf(main_wren, "%s%s", binocle_data_dir, "main.wren");
binocle_wren_run_script(wren, main_wren);

wrenEnsureSlots(wren->vm, 1);
wrenGetVariable(wren->vm, "main", "game", 0);
gameClass = wrenGetSlotHandle(wren->vm, 0);
method = wrenMakeCallHandle(wren->vm, "update(_)");
#endif

#ifdef DEMOLOOP
Expand Down
2 changes: 0 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ set(BINOCLE_STATIC_LIBS
$<TARGET_OBJECTS:physfs>
$<TARGET_OBJECTS:rxi_map>
$<TARGET_OBJECTS:SDL3::SDL3-static>
$<TARGET_OBJECTS:libuv>
$<TARGET_OBJECTS:wren>
)

if (NOT EMSCRIPTEN AND NOT ANDROID AND NOT IOS AND NOT WATCHOS AND BINOCLE_HTTP)
Expand Down
117 changes: 0 additions & 117 deletions src/binocle/core/binocle_wren.c

This file was deleted.

38 changes: 0 additions & 38 deletions src/binocle/core/binocle_wren.h

This file was deleted.

2 changes: 0 additions & 2 deletions src/deps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ add_subdirectory(parson)
add_subdirectory(physfs)
add_subdirectory(rxi_map)
add_subdirectory(zlib)
add_subdirectory(libuv)
add_subdirectory(wren)

# SDL specific flags
set(SDL_STATIC ON)
Expand Down
78 changes: 0 additions & 78 deletions src/deps/libuv/.gitignore

This file was deleted.

40 changes: 0 additions & 40 deletions src/deps/libuv/.mailmap

This file was deleted.

Loading

0 comments on commit 6148987

Please sign in to comment.