Code Monkey home page Code Monkey logo

linc_bgfx's Introduction

Hits

git submodule update --init --recursive --remote

build bgfx libs for your platform

bgfx needs to be built on your platform to generate lib files we can link against.

Visit linc_bgfx/lib/bgfx and follow https://bkaradzic.github.io/bgfx/build.html and build all the libraries. It's recommended to build the examples as well as the tools.

genie --with-examples --with-tools <your compiler>

Review & Modify the libpaths as necessary in linc_bgfx/linc/linc_bgfx.xml (Temporary till we find a solution for all kinds of compilers, etc):

<section if="windows">
    <lib name="gdi32.lib"/>
    <lib name="kernel32.lib"/>
    <lib name="psapi.lib"/>
    <section unless="debug">
        <lib if="HXCPP_M64" name="${LINC_BGFX_PATH}lib/bgfx/.build/win64_vs2022/bin/bgfxRelease.lib"/>
        <lib if="HXCPP_M64" name="${LINC_BGFX_PATH}lib/bgfx/.build/win64_vs2022/bin/bimgRelease.lib"/>
        <lib if="HXCPP_M64" name="${LINC_BGFX_PATH}lib/bgfx/.build/win64_vs2022/bin/bimg_decodeRelease.lib"/>
        <lib if="HXCPP_M64" name="${LINC_BGFX_PATH}lib/bgfx/.build/win64_vs2022/bin/bimg_encodeRelease.lib"/>
        <lib if="HXCPP_M64" name="${LINC_BGFX_PATH}lib/bgfx/.build/win64_vs2022/bin/bxRelease.lib"/>
    </section>
    <section if="debug">
        <lib if="HXCPP_M64" name="${LINC_BGFX_PATH}lib/bgfx/.build/win64_vs2022/bin/bgfxDebug.lib"/>
        <lib if="HXCPP_M64" name="${LINC_BGFX_PATH}lib/bgfx/.build/win64_vs2022/bin/bimgDebug.lib"/>
        <lib if="HXCPP_M64" name="${LINC_BGFX_PATH}lib/bgfx/.build/win64_vs2022/bin/bimg_decodeDebug.lib"/>
        <lib if="HXCPP_M64" name="${LINC_BGFX_PATH}lib/bgfx/.build/win64_vs2022/bin/bimg_encodeDebug.lib"/>
        <lib if="HXCPP_M64" name="${LINC_BGFX_PATH}lib/bgfx/.build/win64_vs2022/bin/bxDebug.lib"/>
    </section>
</section>

linc_bgfx's People

Contributors

dazkind avatar

Stargazers

 avatar Chris Anderson avatar  avatar Alexander avatar Nick Philipp Häcker avatar Kn1ghtNight avatar Krtolica Vujadin avatar Datee avatar Benjamin avatar  avatar ForeignSasquatch avatar Jérémy Faivre avatar

Watchers

 avatar

linc_bgfx's Issues

setViewName missing string length

The function requires 3 parameters in BGFX:
setViewName(viewId, name, length) with types (ViewId, const char *, int32_t)

The externs don't give the string length to the function.

Expected:
afbeelding

Actual output:
afbeelding

This causes the build to fail.
I have not checked if there are other functions with the same problem.

NanoVG (fontstash.h, fonsFreeFontMem): Cannot unload fonts of which the index is higher than nfonts.

afbeelding

Description
There is a problem with NanoVG where certain fonts are unable to be unloaded.
Let's say I load a font called font1, then load another font called font2.
At this point stash->nfonts will be 2
If I now unload font1 stash->nfonts will be 1 again.
This means that font2 cannot be unloaded as there is a check in place (idx >= stash->nfonts)
I've confirmed this is the problem by trying to unload them in reverse order (font2, font1 instead of font1, font2) which made the problems disappear.

To Reproduce
Steps to reproduce the behavior:

  1. Load 2 or more fonts
  2. Unload the first font
  3. Try to unload the second font, the call to do this will return false.

Expected behavior
When you attempt step 3 of the reproduction steps, you should be able to unload the font and the function should return true.

Proposed solution
Instead of checking if idx >= stash->nfonts is true, possibly check if the font at the specified index is a nullptr, with perhaps some additional sanity-checks like idx >= FONS_INIT_FONTS

Additional details
Outside of the code added to this fork to free the font, there is also a problem with finding fonts. As it uses a for-loop for finding the fonts, where sometimes a font might be outside of the range of the font

BGFX Attrib Enum incorrect.

The generated enum:
afbeelding

Expected enum:
afbeelding

It seems like the enum is being generated incorrectly.
I have not verified if this is the case with other enums, so far this is the only enum with problems that I've found.
If I see other broken enums I'll report that here.

With kind regards,
http80

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.