o3o / bindbc-raylib Goto Github PK
View Code? Open in Web Editor NEWA configurable dynamic and static D binding to the raylib (and raygui) library
License: Boost Software License 1.0
A configurable dynamic and static D binding to the raylib (and raygui) library
License: Boost Software License 1.0
Ciao Orfeo!
It says:
undefined reference to `_D3app4mainFZ14DrawTextureProMFS6bindbc6raylib5types9Texture2DSQBfQBbQx9RectangleQtSQCaQBwQBs7Vector2fSQCtQCpQCl5ColorZv'
Version:
Raylib 3.0.0-70-g72443f8f
Hi, great work you have here!
I tried to load the dll, both named as "libraylib.dll" (mingw version, as supplied by raylib's repo) and "raylib.dll" (as defined in your code, using just loadRaylib()). Tried 64bit and 32bit also, .dll in the same folder of the .exe binary. but sadly no success... It keeps returning "noLibrary".
I took a look on this package's code and compared it to bindbc-sdl (which is working fine on Windows) to see if I'd spot some error, but I'm new to Dlang and spotted none.
Am I missing something? Is there some other configuration or maybe some arg/flag to pass to the compiler?
could we add raymath (another header file built into raylib) bindings as well?
it provides a lot of important:
Vector2, Vector3, Matrix and Quaternion math related functions
see architecture on the raylib wiki for an overview.
According to bindbc-loader's errors() function:
Missing Symbol: rlEnableShader
Missing Symbol: rlDisableShader
Missing Symbol: rlEnableFramebuffer
Missing Symbol: rlDisableFramebuffer
Missing Symbol: rlCheckErrors
Missing Symbol: rlSetBlendMode
Missing Symbol: rlLoadFramebuffer
Missing Symbol: rlFramebufferAttach
Missing Symbol: rlFramebufferComplete
Missing Symbol: rlUnloadFramebuffer
Missing Symbol: rlDrawMeshInstanced
I'm guessing these were added sometime after raylib's 72443f8f
commit. When I check out the latest commit and build, I get these errors instead:
Missing Symbol: GetExtension
Missing Symbol: LoadImageEx
Missing Symbol: ImageExtractPalette
Missing Symbol: SetMusicLoopCount
So I'm guessing all that's needed is to move those rlgl functions into static if
blocks depending on the raylib version specified.
hello,
I followed your very detailed (thanks!) instructions in the README to build and install raylib from the 3.0.0
tag with RAYGUI support.
however, when i try to run the examples (any example), i get an output that looks like this:
Performing "debug" build using /usr/bin/dmd for x86_64.
bindbc-loader 0.3.1: target for configuration "noBC" is up to date.
bindbc-raylib 0.5.0: target for configuration "dynamic" is up to date.
core ~master: building configuration "basic"...
raylib version 300
Linking...
To force a rebuild of up-to-date targets, run again with --force.
Running ./basic_window
e: 7FFD84267EF0, m:7FFD84267F10
e: 7FFD84267EF0, m:7FFD84267F10
ERROR: badLibrary
im not sure what is wrong; i have these files properly installed (looks like a proper shared library):
lrwxrwxrwx 16 root 20 Jul 13:03 /usr/local/lib/libraylib.so -> libraylib.so.300
.rwxr-xr-x 1.4M root 20 Jul 13:03 /usr/local/lib/libraylib.so.3.0.0
lrwxrwxrwx 18 root 20 Jul 13:03 /usr/local/lib/libraylib.so.300 -> libraylib.so.3.0.0
and it seems like it is finding the library, just something about it is bad? i think i have the right version, because i built the clean 3.0.0
tag.
Hi! I notice in your examples that you're only checking for RaylibSupport.badLibrary
. Because of this, the else
branch will run even when the load function returns noLibrary
. I see that your loader is properly returning that when no library is found, so it's a possibility when your users misconfigure the library (like compiling for 64-bit but attempting to load a 32-bit dll).
The proper way to check for errors BindBC style is:
// Option 1
// I've configured my minimum required version at compile time,
// so any failure here means bailing out
if(retVal != raylibSupport)
errorOut();
// Option 2
// I've configured my preferred version at compile time,
// but I can run with a specific lower version
if(retVal == RaylibSupport.noLibrary || loadedRaylibVersion () < myMinimumRequiredVersion)
errorOut();
// Option 3
// I've configured my preferred version at compile time,
// but I can run with any version of the library. Only bail out
// when no library was loaded at all
if(retVal == RaylibSupport.noLibrary || loadedRaylibVersion == RaylibSupport.noLibrary)
errorOut();
The purpose of badLibrary
is to indicate that some version of the library may have loaded successfully, but it wasn't the one configured at compile time. Sometimes users may want to configure support for a higher version of a library and use a newer feature if it's available, but will still be happy to run if a lower version of the library loads.
Unfortunately, in your loader I see you're setting loadedVersion
to badLibrary
when a specific version fails to load, so it's currently not possible with this binding to use a lower library version. And the return value of your loadedRaylibVersion
is meaningless in that case, as it will always match the compile-time configured version. For it to be in line with the intent of the BindBC error handling API, lines like this:
if (errorCount() != errCount) {
loadedVersion = RaylibSupport.badLibrary;
} else {
loadedVersion = RaylibSupport.raylib250;
}
Should be changed to:
if (errorCount() != errCount) {
return RaylibSupport.badLibrary;
} else {
loadedVersion = RaylibSupport.raylib250;
}
Then if 3.0.0 fails to load because the user has a 2.5.0 dll, the show can still go on if the 2.5.0 features are acceptable.
Anyway, your examples should probably just use the first option I listed above and bail out on any failure, as I assume they'll be configured to the specific version that has the features you want to demo.
Compiled both raygui and raylib from master (there's no 2.6.1 release tagged) using README instructions.
$ cd examples/gui
$ dub
Performing "debug" build using /usr/bin/dmd for x86_64.
bindbc-loader 0.2.1: target for configuration "noBC" is up to date.
bindbc-raylib 0.1.0: target for configuration "dynamic" is up to date.
core ~master: target for configuration "cts" is up to date.
To force a rebuild of up-to-date targets, run again with --force.
Running ./cts
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
e: 7FFE52D70640, m:7FFE52D70660
ERRORbadLibrary
Program exited with code -11
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.