ebassi / graphene

A thin layer of graphic data types

Home Page:http://ebassi.github.io/graphene

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

If graphene is a usable substitute for GLM, mention so in README?

yarwelp opened this issue · comments

commented

Hello, I came here from a thread on Reddit where someone suggested that graphene might be a usable replacement for GLM. I am very new to OpenGL still but I am looking to use something other than GLM because using GLM means that one has to use a C++ compiler, which in turn feels unnecessary because all of my code that I've written is pure C.

The manual for Graphene mentions the following:

Most of this stuff exists, in various forms, in other libraries, but it has the major drawback of coming along with the rest of those libraries, which may or may not be what you want. Those libraries are also available in various languages, as long as those languages are C++; again, it may or may not be something you want.

However, neither the manual nor the README mentions GLM nor OpenGL.

What I'm wondering is, would Graphene be a usable substitute for GLM?

If so, consider mentioning OpenGL in the README file and maybe mentioning GLM in the manual, so that when people come to Graphene they can quickly know if it's useful for this purpose. If it's not then of course there is no point in mentioning it explicitly.

However, neither the manual nor the README mentions GLM nor OpenGL.

Mostly because I never used GLM, and Graphene is not related to OpenGL at all, even if one of the original reasons for implementing it was writing a GL-based (and Vulkan-based) rendering API, among other things.

Since I never used GLM I cannot compare it with Graphene; and since I cannot compare them, I cannot say it you can use Graphene as a substitute of GLM. From what I can see, the GLM API seem to cover more GL-related cases, including things like colorspace conversion, half-types, and logarithms.

Personally, I see no point in comparisons with other libraries. The README and website make it fairly clear what Graphene provides:

  • a C99 API
  • basic vector and matrix types, implemented using SIMD instructions on various architectures
  • complex types and API for implementing 2D and 3D transformations

If API is missing, I can consider adding it, and I will gladly review patches to that effect.

commented

Thanks for your answer, makes sense. I guess first and foremost what I am wondering is if the datatypes of graphene can be passed directly to OpenGL, for example arrays of your graphene_vec3_t and graphene_vec4_t structs. If some or all of your datatypes can be passed directly to OpenGL then I think that single fact is worth mentioning in the README and writing a bit about in the manual.

In general, anything that has a to_float() function can be used to generate an array of floating point values that can then be passed to other layers in the stack — including OpenGL. I'll make sure to be more explicit about it.