GithubHelp home page GithubHelp logo

custom vertex setup about imgui HOT 4 CLOSED

ocornut avatar ocornut commented on May 9, 2024
custom vertex setup

from imgui.

Comments (4)

ocornut avatar ocornut commented on May 9, 2024

Typically you can iterate over the vertices and "convert" them. For a few thousands vertices per frame the cost is minor. But it an excellent idea - what I'll do is that I'll add a #define to disable the ImDrawVert structure definition and you can provide yours. It won't handle every case but some of them. Make it more likely that you can just memcpy.

from imgui.

ocornut avatar ocornut commented on May 9, 2024

I looked into it today, was thinking adding
#define IMGUI_DONT_DEFINE_IMDRAWVERT_STRUCT
However there is the problem that imconfig.h is included before ImVec2 is defined.

Solutions I can think of now:

  • Change it to force the user to declare the structure itself as a #define,
  • Introduce a second "config" file included at the end of imgui.h
  • Allow for a few hardcoded ordering selected via a define - I think it misses the point a little, being only half-flexible when you want to be fully flexible.

All of those are quite awkward! Don't know what to do yet.

from imgui.

ocornut avatar ocornut commented on May 9, 2024

Done in 191e17e

You have to declare a macro called IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT that develop to the struct type.

from imgui.

mattiasljungstrom avatar mattiasljungstrom commented on May 9, 2024

Thanks!

from imgui.

Related Issues (20)

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.