Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No documentation #225

Open
theIDinside opened this issue Jan 19, 2021 · 6 comments
Open

No documentation #225

theIDinside opened this issue Jan 19, 2021 · 6 comments

Comments

@theIDinside
Copy link

As it stands right now, it's "impossible" to get this library working (unfortunately), by merely just git cloning it, and since the documentation is non-existent (required 3rd party libraries, whether they use GLAD or GLEW, GLFW etc, except minor details in the CMakeLists which is non-self explanatory) it is something of a couple-hour project just to test it (at which point it becomes unfeasible) to get it to working it seems.

I suggest, you add modern CMake commands to the CMakeLists.txt file, such as using "include(FetchContent)" and let FetchContent pull the 3rd party dependencies (freetype does not exist on github, so that can't be done via FetchContent, as it uses a git command). Because right now, I can't for the life of me get it to work - because I want it to use glad (which I've copied into the folder) and I want it to use GLFW (i added FetchContent(glfw ... ... ...) myself so that works, but it's complaining that GLEW is built for x86, while my machine is x64 (which immediately breaks the illusion of me having enough energy to find out what issues are where).

Suggestions;

Add all 3rd party dependencies that have github accounts, directly to the CMakeLists.txt (which would require users to install CMake v 3.16 I believe, as that's when FetchContent was added), this way whatever user that decides to test this library, will have the 3rd party deps cloned to their machine and built at the time when they build this library, thus removing hours of headache.

@theIDinside
Copy link
Author

For instance, adding GLFW to the project becomes:

include(FetchContent)
FetchContent_Declare(
        glfw
        GIT_REPOSITORY https://github.com/glfw/glfw.git
        GIT_TAG master
        SOURCE_DIR ${PROJECT_SOURCE_DIR}/glfw
)

FetchContent_MakeAvailable(glfw)

if (NOT glfw_POPULATED)
    FetchContent_Populate(glfw)
    add_subdirectory(${glfw_SOURCE_DIR} ${glfw_BINARY_DIR})
endif ()

And now the library/target "glfw" is public to any targets (such as those under demos). The same would go for freetype, if they allow you to put their source code on the github, you would merely do:

set(FT_DIR windows/freetype)
add_subdirectory(${FT_DIR})

And now the target "freetype" becomes available to every target in the CMake file (thus, you can remove the old, outdated and quite frankly horrible PkgFind, and you can instead type "freetype" instead of having to debug for long periods of time what magical variables such as FREETYPE_LIBRARIES mean, or if they are set, or anything).

For instance; if one adds

target_link_library(console freetype) 

We would get an error immediately if freetype wasn't define, whereas if we use ${SOME_VARIABLE} we now have to debug to see if A: the library exists but the magical variable isn't set, or vice versa thus adding layers upon layers of complexity when trying to debug the issues.

But by far the best part, is that this works under both Linux and Windows, thus removing some of the horrible problems one suffer under when working in Windows.

@rougier
Copy link
Owner

rougier commented Jan 20, 2021

Thanks for the report and sorry things did not went smoothly. The CMake has not been updated for a while and it can probably be improved in light fo your comments. Could make a PR?

@Xeverous
Copy link

I'm all in for the documentation. Found this project mentioned somewhere on Stack Overflow, looks interesting but I have to say: lack of proper (fundamental) documentation significantly reduces project's usability.

I'm looking at the repository (as a potential user of the library) but I can't find answers to these questions:

  • What are the true minimal dependencies to build it?
  • Can I run it without GLFW on SDL2 instead?
  • How to efficiently use the API?

@rougier
Copy link
Owner

rougier commented Feb 27, 2021

Problem is that the repor is not meant to be a library but rather a showcase showing how text can be rendered efficiently.

@Xeverous
Copy link

repor is not meant to be a library

This isn't documented either :) In fact, it is labeled as a library in the readme:

A small library for displaying Unicode in OpenGL using a single texture and

@rougier
Copy link
Owner

rougier commented Feb 27, 2021

Ah damn, you're right! Might be easier to modify the README.md in the short time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants